diff --git a/Default.png b/Default.png new file mode 100755 index 0000000..fb439ae Binary files /dev/null and b/Default.png differ diff --git a/Fonts/arial.ttf b/Fonts/arial.ttf new file mode 100755 index 0000000..abc899c Binary files /dev/null and b/Fonts/arial.ttf differ diff --git a/Fonts/comic.ttf b/Fonts/comic.ttf new file mode 100755 index 0000000..c4bd6c1 Binary files /dev/null and b/Fonts/comic.ttf differ diff --git a/Fonts/comicbd.ttf b/Fonts/comicbd.ttf new file mode 100755 index 0000000..c98583a Binary files /dev/null and b/Fonts/comicbd.ttf differ diff --git a/Icon.png b/Icon.png new file mode 100755 index 0000000..71b7245 Binary files /dev/null and b/Icon.png differ diff --git a/Images/Game/Characters/Fox/air_attack.png b/Images/Game/Characters/Fox/air_attack.png new file mode 100755 index 0000000..68061fe Binary files /dev/null and b/Images/Game/Characters/Fox/air_attack.png differ diff --git a/Images/Game/Characters/Fox/air_attack_down.png b/Images/Game/Characters/Fox/air_attack_down.png new file mode 100755 index 0000000..884e9b6 Binary files /dev/null and b/Images/Game/Characters/Fox/air_attack_down.png differ diff --git a/Images/Game/Characters/Fox/air_attack_side.png b/Images/Game/Characters/Fox/air_attack_side.png new file mode 100755 index 0000000..81a5964 Binary files /dev/null and b/Images/Game/Characters/Fox/air_attack_side.png differ diff --git a/Images/Game/Characters/Fox/air_attack_up.png b/Images/Game/Characters/Fox/air_attack_up.png new file mode 100755 index 0000000..e3444f8 Binary files /dev/null and b/Images/Game/Characters/Fox/air_attack_up.png differ diff --git a/Images/Game/Characters/Fox/crouch.png b/Images/Game/Characters/Fox/crouch.png new file mode 100755 index 0000000..9ad7810 Binary files /dev/null and b/Images/Game/Characters/Fox/crouch.png differ diff --git a/Images/Game/Characters/Fox/fall.png b/Images/Game/Characters/Fox/fall.png new file mode 100755 index 0000000..6b3845c Binary files /dev/null and b/Images/Game/Characters/Fox/fall.png differ diff --git a/Images/Game/Characters/Fox/ghost.png b/Images/Game/Characters/Fox/ghost.png new file mode 100755 index 0000000..2d623cf Binary files /dev/null and b/Images/Game/Characters/Fox/ghost.png differ diff --git a/Images/Game/Characters/Fox/hang.png b/Images/Game/Characters/Fox/hang.png new file mode 100755 index 0000000..8956e6e Binary files /dev/null and b/Images/Game/Characters/Fox/hang.png differ diff --git a/Images/Game/Characters/Fox/hurt_flip.png b/Images/Game/Characters/Fox/hurt_flip.png new file mode 100755 index 0000000..c7e150d Binary files /dev/null and b/Images/Game/Characters/Fox/hurt_flip.png differ diff --git a/Images/Game/Characters/Fox/hurt_fly.png b/Images/Game/Characters/Fox/hurt_fly.png new file mode 100755 index 0000000..5c73bbf Binary files /dev/null and b/Images/Game/Characters/Fox/hurt_fly.png differ diff --git a/Images/Game/Characters/Fox/hurt_minor.png b/Images/Game/Characters/Fox/hurt_minor.png new file mode 100755 index 0000000..79cb500 Binary files /dev/null and b/Images/Game/Characters/Fox/hurt_minor.png differ diff --git a/Images/Game/Characters/Fox/hurt_spin.png b/Images/Game/Characters/Fox/hurt_spin.png new file mode 100755 index 0000000..f691b2f Binary files /dev/null and b/Images/Game/Characters/Fox/hurt_spin.png differ diff --git a/Images/Game/Characters/Fox/hurt_spin_up.png b/Images/Game/Characters/Fox/hurt_spin_up.png new file mode 100755 index 0000000..ff69148 Binary files /dev/null and b/Images/Game/Characters/Fox/hurt_spin_up.png differ diff --git a/Images/Game/Characters/Fox/jump.png b/Images/Game/Characters/Fox/jump.png new file mode 100755 index 0000000..820546b Binary files /dev/null and b/Images/Game/Characters/Fox/jump.png differ diff --git a/Images/Game/Characters/Fox/jump2.png b/Images/Game/Characters/Fox/jump2.png new file mode 100755 index 0000000..9d378aa Binary files /dev/null and b/Images/Game/Characters/Fox/jump2.png differ diff --git a/Images/Game/Characters/Fox/land.png b/Images/Game/Characters/Fox/land.png new file mode 100755 index 0000000..9cb36b5 Binary files /dev/null and b/Images/Game/Characters/Fox/land.png differ diff --git a/Images/Game/Characters/Fox/landmaster_boost.png b/Images/Game/Characters/Fox/landmaster_boost.png new file mode 100755 index 0000000..4691242 Binary files /dev/null and b/Images/Game/Characters/Fox/landmaster_boost.png differ diff --git a/Images/Game/Characters/Fox/landmaster_hover.png b/Images/Game/Characters/Fox/landmaster_hover.png new file mode 100755 index 0000000..f5f88e7 Binary files /dev/null and b/Images/Game/Characters/Fox/landmaster_hover.png differ diff --git a/Images/Game/Characters/Fox/landmaster_idle.png b/Images/Game/Characters/Fox/landmaster_idle.png new file mode 100755 index 0000000..5da14ef Binary files /dev/null and b/Images/Game/Characters/Fox/landmaster_idle.png differ diff --git a/Images/Game/Characters/Fox/landmaster_move.png b/Images/Game/Characters/Fox/landmaster_move.png new file mode 100755 index 0000000..3143084 Binary files /dev/null and b/Images/Game/Characters/Fox/landmaster_move.png differ diff --git a/Images/Game/Characters/Fox/landmaster_shoot.png b/Images/Game/Characters/Fox/landmaster_shoot.png new file mode 100755 index 0000000..a83f70c Binary files /dev/null and b/Images/Game/Characters/Fox/landmaster_shoot.png differ diff --git a/Images/Game/Characters/Fox/landmaster_shot.png b/Images/Game/Characters/Fox/landmaster_shot.png new file mode 100755 index 0000000..cef0c06 Binary files /dev/null and b/Images/Game/Characters/Fox/landmaster_shot.png differ diff --git a/Images/Game/Characters/Fox/lose.png b/Images/Game/Characters/Fox/lose.png new file mode 100755 index 0000000..040c5b6 Binary files /dev/null and b/Images/Game/Characters/Fox/lose.png differ diff --git a/Images/Game/Characters/Fox/melee_weapon.png b/Images/Game/Characters/Fox/melee_weapon.png new file mode 100755 index 0000000..153c1aa Binary files /dev/null and b/Images/Game/Characters/Fox/melee_weapon.png differ diff --git a/Images/Game/Characters/Fox/ray.png b/Images/Game/Characters/Fox/ray.png new file mode 100755 index 0000000..486c417 Binary files /dev/null and b/Images/Game/Characters/Fox/ray.png differ diff --git a/Images/Game/Characters/Fox/run.png b/Images/Game/Characters/Fox/run.png new file mode 100755 index 0000000..5a08a48 Binary files /dev/null and b/Images/Game/Characters/Fox/run.png differ diff --git a/Images/Game/Characters/Fox/smash_attack.png b/Images/Game/Characters/Fox/smash_attack.png new file mode 100755 index 0000000..b55d97d Binary files /dev/null and b/Images/Game/Characters/Fox/smash_attack.png differ diff --git a/Images/Game/Characters/Fox/smash_attack_down.png b/Images/Game/Characters/Fox/smash_attack_down.png new file mode 100755 index 0000000..dad1a78 Binary files /dev/null and b/Images/Game/Characters/Fox/smash_attack_down.png differ diff --git a/Images/Game/Characters/Fox/smash_attack_up.png b/Images/Game/Characters/Fox/smash_attack_up.png new file mode 100755 index 0000000..4c4cdf6 Binary files /dev/null and b/Images/Game/Characters/Fox/smash_attack_up.png differ diff --git a/Images/Game/Characters/Fox/smash_charge.png b/Images/Game/Characters/Fox/smash_charge.png new file mode 100755 index 0000000..4dd3ea6 Binary files /dev/null and b/Images/Game/Characters/Fox/smash_charge.png differ diff --git a/Images/Game/Characters/Fox/special_attack.png b/Images/Game/Characters/Fox/special_attack.png new file mode 100755 index 0000000..449f0d0 Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack.png differ diff --git a/Images/Game/Characters/Fox/special_attack_down.png b/Images/Game/Characters/Fox/special_attack_down.png new file mode 100755 index 0000000..2060981 Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_down.png differ diff --git a/Images/Game/Characters/Fox/special_attack_side.png b/Images/Game/Characters/Fox/special_attack_side.png new file mode 100755 index 0000000..945950a Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_side.png differ diff --git a/Images/Game/Characters/Fox/special_attack_up_down.png b/Images/Game/Characters/Fox/special_attack_up_down.png new file mode 100755 index 0000000..a9fe9f7 Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_up_down.png differ diff --git a/Images/Game/Characters/Fox/special_attack_up_downside.png b/Images/Game/Characters/Fox/special_attack_up_downside.png new file mode 100755 index 0000000..74c0ddd Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_up_downside.png differ diff --git a/Images/Game/Characters/Fox/special_attack_up_side.png b/Images/Game/Characters/Fox/special_attack_up_side.png new file mode 100755 index 0000000..ac5acf2 Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_up_side.png differ diff --git a/Images/Game/Characters/Fox/special_attack_up_up.png b/Images/Game/Characters/Fox/special_attack_up_up.png new file mode 100755 index 0000000..1b04d17 Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_up_up.png differ diff --git a/Images/Game/Characters/Fox/special_attack_up_upside.png b/Images/Game/Characters/Fox/special_attack_up_upside.png new file mode 100755 index 0000000..a0ff27b Binary files /dev/null and b/Images/Game/Characters/Fox/special_attack_up_upside.png differ diff --git a/Images/Game/Characters/Fox/special_charge_up.png b/Images/Game/Characters/Fox/special_charge_up.png new file mode 100755 index 0000000..41b46f2 Binary files /dev/null and b/Images/Game/Characters/Fox/special_charge_up.png differ diff --git a/Images/Game/Characters/Fox/special_finish_side.png b/Images/Game/Characters/Fox/special_finish_side.png new file mode 100755 index 0000000..b0ee3b2 Binary files /dev/null and b/Images/Game/Characters/Fox/special_finish_side.png differ diff --git a/Images/Game/Characters/Fox/special_prep_side.png b/Images/Game/Characters/Fox/special_prep_side.png new file mode 100755 index 0000000..f8e292a Binary files /dev/null and b/Images/Game/Characters/Fox/special_prep_side.png differ diff --git a/Images/Game/Characters/Fox/stand.png b/Images/Game/Characters/Fox/stand.png new file mode 100755 index 0000000..eb613d3 Binary files /dev/null and b/Images/Game/Characters/Fox/stand.png differ diff --git a/Images/Game/Characters/Fox/standard_attack.png b/Images/Game/Characters/Fox/standard_attack.png new file mode 100755 index 0000000..e3c700c Binary files /dev/null and b/Images/Game/Characters/Fox/standard_attack.png differ diff --git a/Images/Game/Characters/Fox/standard_attack2.png b/Images/Game/Characters/Fox/standard_attack2.png new file mode 100755 index 0000000..27f44d3 Binary files /dev/null and b/Images/Game/Characters/Fox/standard_attack2.png differ diff --git a/Images/Game/Characters/Fox/standard_attack3.png b/Images/Game/Characters/Fox/standard_attack3.png new file mode 100755 index 0000000..81a5964 Binary files /dev/null and b/Images/Game/Characters/Fox/standard_attack3.png differ diff --git a/Images/Game/Characters/Fox/standard_attack_down.png b/Images/Game/Characters/Fox/standard_attack_down.png new file mode 100755 index 0000000..0d62202 Binary files /dev/null and b/Images/Game/Characters/Fox/standard_attack_down.png differ diff --git a/Images/Game/Characters/Fox/standard_attack_side.png b/Images/Game/Characters/Fox/standard_attack_side.png new file mode 100755 index 0000000..f0c0c48 Binary files /dev/null and b/Images/Game/Characters/Fox/standard_attack_side.png differ diff --git a/Images/Game/Characters/Fox/standard_attack_up.png b/Images/Game/Characters/Fox/standard_attack_up.png new file mode 100755 index 0000000..f418faf Binary files /dev/null and b/Images/Game/Characters/Fox/standard_attack_up.png differ diff --git a/Images/Game/Characters/Fox/stock.png b/Images/Game/Characters/Fox/stock.png new file mode 100644 index 0000000..ed3a270 Binary files /dev/null and b/Images/Game/Characters/Fox/stock.png differ diff --git a/Images/Game/Characters/Fox/symbol.png b/Images/Game/Characters/Fox/symbol.png new file mode 100755 index 0000000..4080a00 Binary files /dev/null and b/Images/Game/Characters/Fox/symbol.png differ diff --git a/Images/Game/Characters/Fox/walk.png b/Images/Game/Characters/Fox/walk.png new file mode 100755 index 0000000..88b5e31 Binary files /dev/null and b/Images/Game/Characters/Fox/walk.png differ diff --git a/Images/Game/Characters/Fox/win.png b/Images/Game/Characters/Fox/win.png new file mode 100755 index 0000000..30878fc Binary files /dev/null and b/Images/Game/Characters/Fox/win.png differ diff --git a/Images/Game/Characters/Fox/win_hold.png b/Images/Game/Characters/Fox/win_hold.png new file mode 100755 index 0000000..78e3c97 Binary files /dev/null and b/Images/Game/Characters/Fox/win_hold.png differ diff --git a/Images/Game/Characters/Ichigo/air_attack.png b/Images/Game/Characters/Ichigo/air_attack.png new file mode 100755 index 0000000..13576fa Binary files /dev/null and b/Images/Game/Characters/Ichigo/air_attack.png differ diff --git a/Images/Game/Characters/Ichigo/air_attack_down.png b/Images/Game/Characters/Ichigo/air_attack_down.png new file mode 100755 index 0000000..388471c Binary files /dev/null and b/Images/Game/Characters/Ichigo/air_attack_down.png differ diff --git a/Images/Game/Characters/Ichigo/air_attack_side.png b/Images/Game/Characters/Ichigo/air_attack_side.png new file mode 100755 index 0000000..3beba57 Binary files /dev/null and b/Images/Game/Characters/Ichigo/air_attack_side.png differ diff --git a/Images/Game/Characters/Ichigo/air_attack_up.png b/Images/Game/Characters/Ichigo/air_attack_up.png new file mode 100755 index 0000000..87502d4 Binary files /dev/null and b/Images/Game/Characters/Ichigo/air_attack_up.png differ diff --git a/Images/Game/Characters/Ichigo/blade.png b/Images/Game/Characters/Ichigo/blade.png new file mode 100755 index 0000000..3b47f87 Binary files /dev/null and b/Images/Game/Characters/Ichigo/blade.png differ diff --git a/Images/Game/Characters/Ichigo/crouch.png b/Images/Game/Characters/Ichigo/crouch.png new file mode 100755 index 0000000..852c215 Binary files /dev/null and b/Images/Game/Characters/Ichigo/crouch.png differ diff --git a/Images/Game/Characters/Ichigo/down_blast.png b/Images/Game/Characters/Ichigo/down_blast.png new file mode 100755 index 0000000..0eb4a93 Binary files /dev/null and b/Images/Game/Characters/Ichigo/down_blast.png differ diff --git a/Images/Game/Characters/Ichigo/fall.png b/Images/Game/Characters/Ichigo/fall.png new file mode 100755 index 0000000..858f807 Binary files /dev/null and b/Images/Game/Characters/Ichigo/fall.png differ diff --git a/Images/Game/Characters/Ichigo/finalsmash_blast.png b/Images/Game/Characters/Ichigo/finalsmash_blast.png new file mode 100755 index 0000000..46a580a Binary files /dev/null and b/Images/Game/Characters/Ichigo/finalsmash_blast.png differ diff --git a/Images/Game/Characters/Ichigo/finalsmash_change.png b/Images/Game/Characters/Ichigo/finalsmash_change.png new file mode 100755 index 0000000..fb1d83e Binary files /dev/null and b/Images/Game/Characters/Ichigo/finalsmash_change.png differ diff --git a/Images/Game/Characters/Ichigo/finalsmash_run.png b/Images/Game/Characters/Ichigo/finalsmash_run.png new file mode 100755 index 0000000..58f225a Binary files /dev/null and b/Images/Game/Characters/Ichigo/finalsmash_run.png differ diff --git a/Images/Game/Characters/Ichigo/finalsmash_shoot.png b/Images/Game/Characters/Ichigo/finalsmash_shoot.png new file mode 100755 index 0000000..878dd2d Binary files /dev/null and b/Images/Game/Characters/Ichigo/finalsmash_shoot.png differ diff --git a/Images/Game/Characters/Ichigo/finalsmash_stand.png b/Images/Game/Characters/Ichigo/finalsmash_stand.png new file mode 100755 index 0000000..52e8a1b Binary files /dev/null and b/Images/Game/Characters/Ichigo/finalsmash_stand.png differ diff --git a/Images/Game/Characters/Ichigo/hang.png b/Images/Game/Characters/Ichigo/hang.png new file mode 100755 index 0000000..b06e890 Binary files /dev/null and b/Images/Game/Characters/Ichigo/hang.png differ diff --git a/Images/Game/Characters/Ichigo/hurt_flip.png b/Images/Game/Characters/Ichigo/hurt_flip.png new file mode 100755 index 0000000..3a7e243 Binary files /dev/null and b/Images/Game/Characters/Ichigo/hurt_flip.png differ diff --git a/Images/Game/Characters/Ichigo/hurt_fly.png b/Images/Game/Characters/Ichigo/hurt_fly.png new file mode 100755 index 0000000..1d9a9b5 Binary files /dev/null and b/Images/Game/Characters/Ichigo/hurt_fly.png differ diff --git a/Images/Game/Characters/Ichigo/hurt_minor.png b/Images/Game/Characters/Ichigo/hurt_minor.png new file mode 100755 index 0000000..27f9a70 Binary files /dev/null and b/Images/Game/Characters/Ichigo/hurt_minor.png differ diff --git a/Images/Game/Characters/Ichigo/hurt_spin.png b/Images/Game/Characters/Ichigo/hurt_spin.png new file mode 100755 index 0000000..3f497b4 Binary files /dev/null and b/Images/Game/Characters/Ichigo/hurt_spin.png differ diff --git a/Images/Game/Characters/Ichigo/hurt_spin_up.png b/Images/Game/Characters/Ichigo/hurt_spin_up.png new file mode 100755 index 0000000..943eb30 Binary files /dev/null and b/Images/Game/Characters/Ichigo/hurt_spin_up.png differ diff --git a/Images/Game/Characters/Ichigo/jump.png b/Images/Game/Characters/Ichigo/jump.png new file mode 100755 index 0000000..f5b72c7 Binary files /dev/null and b/Images/Game/Characters/Ichigo/jump.png differ diff --git a/Images/Game/Characters/Ichigo/jump2.png b/Images/Game/Characters/Ichigo/jump2.png new file mode 100755 index 0000000..a7b4130 Binary files /dev/null and b/Images/Game/Characters/Ichigo/jump2.png differ diff --git a/Images/Game/Characters/Ichigo/land.png b/Images/Game/Characters/Ichigo/land.png new file mode 100755 index 0000000..c5ce2b5 Binary files /dev/null and b/Images/Game/Characters/Ichigo/land.png differ diff --git a/Images/Game/Characters/Ichigo/lose.png b/Images/Game/Characters/Ichigo/lose.png new file mode 100755 index 0000000..248a9c4 Binary files /dev/null and b/Images/Game/Characters/Ichigo/lose.png differ diff --git a/Images/Game/Characters/Ichigo/melee_weapon.png b/Images/Game/Characters/Ichigo/melee_weapon.png new file mode 100755 index 0000000..11273ef Binary files /dev/null and b/Images/Game/Characters/Ichigo/melee_weapon.png differ diff --git a/Images/Game/Characters/Ichigo/projectile.png b/Images/Game/Characters/Ichigo/projectile.png new file mode 100755 index 0000000..9958179 Binary files /dev/null and b/Images/Game/Characters/Ichigo/projectile.png differ diff --git a/Images/Game/Characters/Ichigo/run.png b/Images/Game/Characters/Ichigo/run.png new file mode 100755 index 0000000..d210176 Binary files /dev/null and b/Images/Game/Characters/Ichigo/run.png differ diff --git a/Images/Game/Characters/Ichigo/smash_attack.png b/Images/Game/Characters/Ichigo/smash_attack.png new file mode 100755 index 0000000..909fb38 Binary files /dev/null and b/Images/Game/Characters/Ichigo/smash_attack.png differ diff --git a/Images/Game/Characters/Ichigo/smash_attack_down.png b/Images/Game/Characters/Ichigo/smash_attack_down.png new file mode 100755 index 0000000..58d2500 Binary files /dev/null and b/Images/Game/Characters/Ichigo/smash_attack_down.png differ diff --git a/Images/Game/Characters/Ichigo/smash_attack_up.png b/Images/Game/Characters/Ichigo/smash_attack_up.png new file mode 100755 index 0000000..4375821 Binary files /dev/null and b/Images/Game/Characters/Ichigo/smash_attack_up.png differ diff --git a/Images/Game/Characters/Ichigo/smash_charge.png b/Images/Game/Characters/Ichigo/smash_charge.png new file mode 100755 index 0000000..9e5568e Binary files /dev/null and b/Images/Game/Characters/Ichigo/smash_charge.png differ diff --git a/Images/Game/Characters/Ichigo/special_attack.png b/Images/Game/Characters/Ichigo/special_attack.png new file mode 100755 index 0000000..30ef6d2 Binary files /dev/null and b/Images/Game/Characters/Ichigo/special_attack.png differ diff --git a/Images/Game/Characters/Ichigo/special_attack_down.png b/Images/Game/Characters/Ichigo/special_attack_down.png new file mode 100755 index 0000000..3d84fc0 Binary files /dev/null and b/Images/Game/Characters/Ichigo/special_attack_down.png differ diff --git a/Images/Game/Characters/Ichigo/special_attack_side.png b/Images/Game/Characters/Ichigo/special_attack_side.png new file mode 100755 index 0000000..f3b8fed Binary files /dev/null and b/Images/Game/Characters/Ichigo/special_attack_side.png differ diff --git a/Images/Game/Characters/Ichigo/special_attack_up.png b/Images/Game/Characters/Ichigo/special_attack_up.png new file mode 100755 index 0000000..c2cec42 Binary files /dev/null and b/Images/Game/Characters/Ichigo/special_attack_up.png differ diff --git a/Images/Game/Characters/Ichigo/special_drop_down.png b/Images/Game/Characters/Ichigo/special_drop_down.png new file mode 100755 index 0000000..158188c Binary files /dev/null and b/Images/Game/Characters/Ichigo/special_drop_down.png differ diff --git a/Images/Game/Characters/Ichigo/special_prep_down.png b/Images/Game/Characters/Ichigo/special_prep_down.png new file mode 100755 index 0000000..0fc65ab Binary files /dev/null and b/Images/Game/Characters/Ichigo/special_prep_down.png differ diff --git a/Images/Game/Characters/Ichigo/stand.png b/Images/Game/Characters/Ichigo/stand.png new file mode 100755 index 0000000..6756933 Binary files /dev/null and b/Images/Game/Characters/Ichigo/stand.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack.png b/Images/Game/Characters/Ichigo/standard_attack.png new file mode 100755 index 0000000..bfcc2f6 Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack2.png b/Images/Game/Characters/Ichigo/standard_attack2.png new file mode 100755 index 0000000..3066099 Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack2.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack3.png b/Images/Game/Characters/Ichigo/standard_attack3.png new file mode 100755 index 0000000..e6d8e2e Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack3.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack_down.png b/Images/Game/Characters/Ichigo/standard_attack_down.png new file mode 100755 index 0000000..29a334d Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack_down.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack_finish.png b/Images/Game/Characters/Ichigo/standard_attack_finish.png new file mode 100755 index 0000000..c83ba3e Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack_finish.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack_side.png b/Images/Game/Characters/Ichigo/standard_attack_side.png new file mode 100755 index 0000000..ac1cca6 Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack_side.png differ diff --git a/Images/Game/Characters/Ichigo/standard_attack_up.png b/Images/Game/Characters/Ichigo/standard_attack_up.png new file mode 100755 index 0000000..fbc4ecb Binary files /dev/null and b/Images/Game/Characters/Ichigo/standard_attack_up.png differ diff --git a/Images/Game/Characters/Ichigo/stock.png b/Images/Game/Characters/Ichigo/stock.png new file mode 100755 index 0000000..de9fee8 Binary files /dev/null and b/Images/Game/Characters/Ichigo/stock.png differ diff --git a/Images/Game/Characters/Ichigo/symbol.png b/Images/Game/Characters/Ichigo/symbol.png new file mode 100755 index 0000000..161985c Binary files /dev/null and b/Images/Game/Characters/Ichigo/symbol.png differ diff --git a/Images/Game/Characters/Ichigo/walk.png b/Images/Game/Characters/Ichigo/walk.png new file mode 100755 index 0000000..a7a2931 Binary files /dev/null and b/Images/Game/Characters/Ichigo/walk.png differ diff --git a/Images/Game/Characters/Ichigo/win.png b/Images/Game/Characters/Ichigo/win.png new file mode 100755 index 0000000..4aae8d5 Binary files /dev/null and b/Images/Game/Characters/Ichigo/win.png differ diff --git a/Images/Game/Characters/Ichigo/win_hold.png b/Images/Game/Characters/Ichigo/win_hold.png new file mode 100755 index 0000000..d1d77b5 Binary files /dev/null and b/Images/Game/Characters/Ichigo/win_hold.png differ diff --git a/Images/Game/Characters/Mario/air_attack.png b/Images/Game/Characters/Mario/air_attack.png new file mode 100755 index 0000000..d239f11 Binary files /dev/null and b/Images/Game/Characters/Mario/air_attack.png differ diff --git a/Images/Game/Characters/Mario/air_attack_back.png b/Images/Game/Characters/Mario/air_attack_back.png new file mode 100755 index 0000000..2344007 Binary files /dev/null and b/Images/Game/Characters/Mario/air_attack_back.png differ diff --git a/Images/Game/Characters/Mario/air_attack_down.png b/Images/Game/Characters/Mario/air_attack_down.png new file mode 100755 index 0000000..6494ce9 Binary files /dev/null and b/Images/Game/Characters/Mario/air_attack_down.png differ diff --git a/Images/Game/Characters/Mario/air_attack_side.png b/Images/Game/Characters/Mario/air_attack_side.png new file mode 100755 index 0000000..d7c4bd2 Binary files /dev/null and b/Images/Game/Characters/Mario/air_attack_side.png differ diff --git a/Images/Game/Characters/Mario/air_attack_up.png b/Images/Game/Characters/Mario/air_attack_up.png new file mode 100755 index 0000000..ac76283 Binary files /dev/null and b/Images/Game/Characters/Mario/air_attack_up.png differ diff --git a/Images/Game/Characters/Mario/crouch.png b/Images/Game/Characters/Mario/crouch.png new file mode 100755 index 0000000..76e9ab2 Binary files /dev/null and b/Images/Game/Characters/Mario/crouch.png differ diff --git a/Images/Game/Characters/Mario/dash_attack.png b/Images/Game/Characters/Mario/dash_attack.png new file mode 100755 index 0000000..e9f3a0a Binary files /dev/null and b/Images/Game/Characters/Mario/dash_attack.png differ diff --git a/Images/Game/Characters/Mario/fall.png b/Images/Game/Characters/Mario/fall.png new file mode 100755 index 0000000..7da9a85 Binary files /dev/null and b/Images/Game/Characters/Mario/fall.png differ diff --git a/Images/Game/Characters/Mario/finalsmash_begin.png b/Images/Game/Characters/Mario/finalsmash_begin.png new file mode 100755 index 0000000..aa69eb0 Binary files /dev/null and b/Images/Game/Characters/Mario/finalsmash_begin.png differ diff --git a/Images/Game/Characters/Mario/finalsmash_end.png b/Images/Game/Characters/Mario/finalsmash_end.png new file mode 100755 index 0000000..b13e6ba Binary files /dev/null and b/Images/Game/Characters/Mario/finalsmash_end.png differ diff --git a/Images/Game/Characters/Mario/finalsmash_fire.png b/Images/Game/Characters/Mario/finalsmash_fire.png new file mode 100644 index 0000000..93ea754 Binary files /dev/null and b/Images/Game/Characters/Mario/finalsmash_fire.png differ diff --git a/Images/Game/Characters/Mario/finalsmash_hold.gif b/Images/Game/Characters/Mario/finalsmash_hold.gif new file mode 100755 index 0000000..9072cdf Binary files /dev/null and b/Images/Game/Characters/Mario/finalsmash_hold.gif differ diff --git a/Images/Game/Characters/Mario/fireball.png b/Images/Game/Characters/Mario/fireball.png new file mode 100755 index 0000000..0e940c2 Binary files /dev/null and b/Images/Game/Characters/Mario/fireball.png differ diff --git a/Images/Game/Characters/Mario/fludd_water.png b/Images/Game/Characters/Mario/fludd_water.png new file mode 100755 index 0000000..1974171 Binary files /dev/null and b/Images/Game/Characters/Mario/fludd_water.png differ diff --git a/Images/Game/Characters/Mario/grab.png b/Images/Game/Characters/Mario/grab.png new file mode 100755 index 0000000..27f7624 Binary files /dev/null and b/Images/Game/Characters/Mario/grab.png differ diff --git a/Images/Game/Characters/Mario/grabbed.png b/Images/Game/Characters/Mario/grabbed.png new file mode 100755 index 0000000..7e7bf4c Binary files /dev/null and b/Images/Game/Characters/Mario/grabbed.png differ diff --git a/Images/Game/Characters/Mario/grabbing.png b/Images/Game/Characters/Mario/grabbing.png new file mode 100755 index 0000000..9a600ea Binary files /dev/null and b/Images/Game/Characters/Mario/grabbing.png differ diff --git a/Images/Game/Characters/Mario/grabspin.png b/Images/Game/Characters/Mario/grabspin.png new file mode 100755 index 0000000..bef5244 Binary files /dev/null and b/Images/Game/Characters/Mario/grabspin.png differ diff --git a/Images/Game/Characters/Mario/hang.png b/Images/Game/Characters/Mario/hang.png new file mode 100755 index 0000000..faf1c04 Binary files /dev/null and b/Images/Game/Characters/Mario/hang.png differ diff --git a/Images/Game/Characters/Mario/hurt_dead.png b/Images/Game/Characters/Mario/hurt_dead.png new file mode 100755 index 0000000..ec528f3 Binary files /dev/null and b/Images/Game/Characters/Mario/hurt_dead.png differ diff --git a/Images/Game/Characters/Mario/hurt_flip.png b/Images/Game/Characters/Mario/hurt_flip.png new file mode 100755 index 0000000..2e13953 Binary files /dev/null and b/Images/Game/Characters/Mario/hurt_flip.png differ diff --git a/Images/Game/Characters/Mario/hurt_fly.png b/Images/Game/Characters/Mario/hurt_fly.png new file mode 100755 index 0000000..35126a6 Binary files /dev/null and b/Images/Game/Characters/Mario/hurt_fly.png differ diff --git a/Images/Game/Characters/Mario/hurt_minor.png b/Images/Game/Characters/Mario/hurt_minor.png new file mode 100755 index 0000000..d70a658 Binary files /dev/null and b/Images/Game/Characters/Mario/hurt_minor.png differ diff --git a/Images/Game/Characters/Mario/hurt_spin.png b/Images/Game/Characters/Mario/hurt_spin.png new file mode 100755 index 0000000..7ec840b Binary files /dev/null and b/Images/Game/Characters/Mario/hurt_spin.png differ diff --git a/Images/Game/Characters/Mario/hurt_spin_up.png b/Images/Game/Characters/Mario/hurt_spin_up.png new file mode 100755 index 0000000..dbf4c24 Binary files /dev/null and b/Images/Game/Characters/Mario/hurt_spin_up.png differ diff --git a/Images/Game/Characters/Mario/jump.png b/Images/Game/Characters/Mario/jump.png new file mode 100755 index 0000000..58706ea Binary files /dev/null and b/Images/Game/Characters/Mario/jump.png differ diff --git a/Images/Game/Characters/Mario/jump2.png b/Images/Game/Characters/Mario/jump2.png new file mode 100755 index 0000000..1c504f3 Binary files /dev/null and b/Images/Game/Characters/Mario/jump2.png differ diff --git a/Images/Game/Characters/Mario/land.png b/Images/Game/Characters/Mario/land.png new file mode 100755 index 0000000..ce1bb6a Binary files /dev/null and b/Images/Game/Characters/Mario/land.png differ diff --git a/Images/Game/Characters/Mario/lose.png b/Images/Game/Characters/Mario/lose.png new file mode 100755 index 0000000..a0feb69 Binary files /dev/null and b/Images/Game/Characters/Mario/lose.png differ diff --git a/Images/Game/Characters/Mario/melee_weapon.png b/Images/Game/Characters/Mario/melee_weapon.png new file mode 100755 index 0000000..4094c7f Binary files /dev/null and b/Images/Game/Characters/Mario/melee_weapon.png differ diff --git a/Images/Game/Characters/Mario/run.png b/Images/Game/Characters/Mario/run.png new file mode 100755 index 0000000..1330048 Binary files /dev/null and b/Images/Game/Characters/Mario/run.png differ diff --git a/Images/Game/Characters/Mario/smash_attack.png b/Images/Game/Characters/Mario/smash_attack.png new file mode 100755 index 0000000..1e4a975 Binary files /dev/null and b/Images/Game/Characters/Mario/smash_attack.png differ diff --git a/Images/Game/Characters/Mario/smash_attack_down.png b/Images/Game/Characters/Mario/smash_attack_down.png new file mode 100755 index 0000000..be01e71 Binary files /dev/null and b/Images/Game/Characters/Mario/smash_attack_down.png differ diff --git a/Images/Game/Characters/Mario/smash_attack_up.png b/Images/Game/Characters/Mario/smash_attack_up.png new file mode 100755 index 0000000..34d8f2f Binary files /dev/null and b/Images/Game/Characters/Mario/smash_attack_up.png differ diff --git a/Images/Game/Characters/Mario/smash_charge.png b/Images/Game/Characters/Mario/smash_charge.png new file mode 100755 index 0000000..9a600ea Binary files /dev/null and b/Images/Game/Characters/Mario/smash_charge.png differ diff --git a/Images/Game/Characters/Mario/special_attack.png b/Images/Game/Characters/Mario/special_attack.png new file mode 100755 index 0000000..0484c92 Binary files /dev/null and b/Images/Game/Characters/Mario/special_attack.png differ diff --git a/Images/Game/Characters/Mario/special_attack_down.png b/Images/Game/Characters/Mario/special_attack_down.png new file mode 100755 index 0000000..9df36be Binary files /dev/null and b/Images/Game/Characters/Mario/special_attack_down.png differ diff --git a/Images/Game/Characters/Mario/special_attack_hold_up.png b/Images/Game/Characters/Mario/special_attack_hold_up.png new file mode 100755 index 0000000..dfbbc67 Binary files /dev/null and b/Images/Game/Characters/Mario/special_attack_hold_up.png differ diff --git a/Images/Game/Characters/Mario/special_attack_side.png b/Images/Game/Characters/Mario/special_attack_side.png new file mode 100755 index 0000000..9a3e179 Binary files /dev/null and b/Images/Game/Characters/Mario/special_attack_side.png differ diff --git a/Images/Game/Characters/Mario/special_attack_up.png b/Images/Game/Characters/Mario/special_attack_up.png new file mode 100755 index 0000000..d09df0a Binary files /dev/null and b/Images/Game/Characters/Mario/special_attack_up.png differ diff --git a/Images/Game/Characters/Mario/special_charge_down.png b/Images/Game/Characters/Mario/special_charge_down.png new file mode 100755 index 0000000..0519228 Binary files /dev/null and b/Images/Game/Characters/Mario/special_charge_down.png differ diff --git a/Images/Game/Characters/Mario/stand.png b/Images/Game/Characters/Mario/stand.png new file mode 100755 index 0000000..6255d71 Binary files /dev/null and b/Images/Game/Characters/Mario/stand.png differ diff --git a/Images/Game/Characters/Mario/standard_attack.png b/Images/Game/Characters/Mario/standard_attack.png new file mode 100755 index 0000000..d906196 Binary files /dev/null and b/Images/Game/Characters/Mario/standard_attack.png differ diff --git a/Images/Game/Characters/Mario/standard_attack2.png b/Images/Game/Characters/Mario/standard_attack2.png new file mode 100755 index 0000000..6656946 Binary files /dev/null and b/Images/Game/Characters/Mario/standard_attack2.png differ diff --git a/Images/Game/Characters/Mario/standard_attack3.png b/Images/Game/Characters/Mario/standard_attack3.png new file mode 100755 index 0000000..1123305 Binary files /dev/null and b/Images/Game/Characters/Mario/standard_attack3.png differ diff --git a/Images/Game/Characters/Mario/standard_attack_down.png b/Images/Game/Characters/Mario/standard_attack_down.png new file mode 100755 index 0000000..6526ebe Binary files /dev/null and b/Images/Game/Characters/Mario/standard_attack_down.png differ diff --git a/Images/Game/Characters/Mario/standard_attack_side.png b/Images/Game/Characters/Mario/standard_attack_side.png new file mode 100755 index 0000000..e02647d Binary files /dev/null and b/Images/Game/Characters/Mario/standard_attack_side.png differ diff --git a/Images/Game/Characters/Mario/standard_attack_up.png b/Images/Game/Characters/Mario/standard_attack_up.png new file mode 100755 index 0000000..4866139 Binary files /dev/null and b/Images/Game/Characters/Mario/standard_attack_up.png differ diff --git a/Images/Game/Characters/Mario/stock.png b/Images/Game/Characters/Mario/stock.png new file mode 100755 index 0000000..94f87a8 Binary files /dev/null and b/Images/Game/Characters/Mario/stock.png differ diff --git a/Images/Game/Characters/Mario/symbol.png b/Images/Game/Characters/Mario/symbol.png new file mode 100755 index 0000000..d3cd7ba Binary files /dev/null and b/Images/Game/Characters/Mario/symbol.png differ diff --git a/Images/Game/Characters/Mario/throw_up.png b/Images/Game/Characters/Mario/throw_up.png new file mode 100755 index 0000000..d5e3f39 Binary files /dev/null and b/Images/Game/Characters/Mario/throw_up.png differ diff --git a/Images/Game/Characters/Mario/walk.png b/Images/Game/Characters/Mario/walk.png new file mode 100755 index 0000000..575ab5c Binary files /dev/null and b/Images/Game/Characters/Mario/walk.png differ diff --git a/Images/Game/Characters/Mario/win.png b/Images/Game/Characters/Mario/win.png new file mode 100755 index 0000000..dd2f7ba Binary files /dev/null and b/Images/Game/Characters/Mario/win.png differ diff --git a/Images/Game/Characters/Mario/win_hold.png b/Images/Game/Characters/Mario/win_hold.png new file mode 100755 index 0000000..f9cbeed Binary files /dev/null and b/Images/Game/Characters/Mario/win_hold.png differ diff --git a/Images/Game/Characters/Sonic/air_attack.png b/Images/Game/Characters/Sonic/air_attack.png new file mode 100755 index 0000000..dc7b9f6 Binary files /dev/null and b/Images/Game/Characters/Sonic/air_attack.png differ diff --git a/Images/Game/Characters/Sonic/air_attack_down.png b/Images/Game/Characters/Sonic/air_attack_down.png new file mode 100755 index 0000000..ba0e3b6 Binary files /dev/null and b/Images/Game/Characters/Sonic/air_attack_down.png differ diff --git a/Images/Game/Characters/Sonic/air_attack_side.png b/Images/Game/Characters/Sonic/air_attack_side.png new file mode 100755 index 0000000..cf31a54 Binary files /dev/null and b/Images/Game/Characters/Sonic/air_attack_side.png differ diff --git a/Images/Game/Characters/Sonic/air_attack_up.png b/Images/Game/Characters/Sonic/air_attack_up.png new file mode 100755 index 0000000..9045fd3 Binary files /dev/null and b/Images/Game/Characters/Sonic/air_attack_up.png differ diff --git a/Images/Game/Characters/Sonic/air_land_down.png b/Images/Game/Characters/Sonic/air_land_down.png new file mode 100755 index 0000000..85b7685 Binary files /dev/null and b/Images/Game/Characters/Sonic/air_land_down.png differ diff --git a/Images/Game/Characters/Sonic/air_prep_down.png b/Images/Game/Characters/Sonic/air_prep_down.png new file mode 100755 index 0000000..75df594 Binary files /dev/null and b/Images/Game/Characters/Sonic/air_prep_down.png differ diff --git a/Images/Game/Characters/Sonic/crouch.png b/Images/Game/Characters/Sonic/crouch.png new file mode 100755 index 0000000..b9f274a Binary files /dev/null and b/Images/Game/Characters/Sonic/crouch.png differ diff --git a/Images/Game/Characters/Sonic/dash_attack.png b/Images/Game/Characters/Sonic/dash_attack.png new file mode 100755 index 0000000..faaa890 Binary files /dev/null and b/Images/Game/Characters/Sonic/dash_attack.png differ diff --git a/Images/Game/Characters/Sonic/fall.png b/Images/Game/Characters/Sonic/fall.png new file mode 100755 index 0000000..00ca3ff Binary files /dev/null and b/Images/Game/Characters/Sonic/fall.png differ diff --git a/Images/Game/Characters/Sonic/finalsmash_emeralds.png b/Images/Game/Characters/Sonic/finalsmash_emeralds.png new file mode 100755 index 0000000..ba36c3e Binary files /dev/null and b/Images/Game/Characters/Sonic/finalsmash_emeralds.png differ diff --git a/Images/Game/Characters/Sonic/finalsmash_finish.png b/Images/Game/Characters/Sonic/finalsmash_finish.png new file mode 100755 index 0000000..804a119 Binary files /dev/null and b/Images/Game/Characters/Sonic/finalsmash_finish.png differ diff --git a/Images/Game/Characters/Sonic/finalsmash_run.png b/Images/Game/Characters/Sonic/finalsmash_run.png new file mode 100755 index 0000000..8e51df3 Binary files /dev/null and b/Images/Game/Characters/Sonic/finalsmash_run.png differ diff --git a/Images/Game/Characters/Sonic/finalsmash_stand.png b/Images/Game/Characters/Sonic/finalsmash_stand.png new file mode 100755 index 0000000..ea0bd58 Binary files /dev/null and b/Images/Game/Characters/Sonic/finalsmash_stand.png differ diff --git a/Images/Game/Characters/Sonic/finalsmash_transform.png b/Images/Game/Characters/Sonic/finalsmash_transform.png new file mode 100755 index 0000000..3313254 Binary files /dev/null and b/Images/Game/Characters/Sonic/finalsmash_transform.png differ diff --git a/Images/Game/Characters/Sonic/finalsmash_turn.png b/Images/Game/Characters/Sonic/finalsmash_turn.png new file mode 100755 index 0000000..4319630 Binary files /dev/null and b/Images/Game/Characters/Sonic/finalsmash_turn.png differ diff --git a/Images/Game/Characters/Sonic/hang.png b/Images/Game/Characters/Sonic/hang.png new file mode 100755 index 0000000..7d3112d Binary files /dev/null and b/Images/Game/Characters/Sonic/hang.png differ diff --git a/Images/Game/Characters/Sonic/hurt_flip.png b/Images/Game/Characters/Sonic/hurt_flip.png new file mode 100755 index 0000000..0eeb8df Binary files /dev/null and b/Images/Game/Characters/Sonic/hurt_flip.png differ diff --git a/Images/Game/Characters/Sonic/hurt_fly.png b/Images/Game/Characters/Sonic/hurt_fly.png new file mode 100755 index 0000000..f6c5818 Binary files /dev/null and b/Images/Game/Characters/Sonic/hurt_fly.png differ diff --git a/Images/Game/Characters/Sonic/hurt_minor.png b/Images/Game/Characters/Sonic/hurt_minor.png new file mode 100755 index 0000000..57ce839 Binary files /dev/null and b/Images/Game/Characters/Sonic/hurt_minor.png differ diff --git a/Images/Game/Characters/Sonic/hurt_spin.png b/Images/Game/Characters/Sonic/hurt_spin.png new file mode 100755 index 0000000..24786f1 Binary files /dev/null and b/Images/Game/Characters/Sonic/hurt_spin.png differ diff --git a/Images/Game/Characters/Sonic/hurt_spin_up.png b/Images/Game/Characters/Sonic/hurt_spin_up.png new file mode 100755 index 0000000..52f7b94 Binary files /dev/null and b/Images/Game/Characters/Sonic/hurt_spin_up.png differ diff --git a/Images/Game/Characters/Sonic/jump.png b/Images/Game/Characters/Sonic/jump.png new file mode 100755 index 0000000..d0e6779 Binary files /dev/null and b/Images/Game/Characters/Sonic/jump.png differ diff --git a/Images/Game/Characters/Sonic/jump2.png b/Images/Game/Characters/Sonic/jump2.png new file mode 100755 index 0000000..7cb6a78 Binary files /dev/null and b/Images/Game/Characters/Sonic/jump2.png differ diff --git a/Images/Game/Characters/Sonic/land.png b/Images/Game/Characters/Sonic/land.png new file mode 100755 index 0000000..d64eabc Binary files /dev/null and b/Images/Game/Characters/Sonic/land.png differ diff --git a/Images/Game/Characters/Sonic/lose.png b/Images/Game/Characters/Sonic/lose.png new file mode 100755 index 0000000..4163fb3 Binary files /dev/null and b/Images/Game/Characters/Sonic/lose.png differ diff --git a/Images/Game/Characters/Sonic/melee_weapon.png b/Images/Game/Characters/Sonic/melee_weapon.png new file mode 100755 index 0000000..dd3edd2 Binary files /dev/null and b/Images/Game/Characters/Sonic/melee_weapon.png differ diff --git a/Images/Game/Characters/Sonic/roll.png b/Images/Game/Characters/Sonic/roll.png new file mode 100755 index 0000000..d1a9870 Binary files /dev/null and b/Images/Game/Characters/Sonic/roll.png differ diff --git a/Images/Game/Characters/Sonic/run.png b/Images/Game/Characters/Sonic/run.png new file mode 100755 index 0000000..7850a2b Binary files /dev/null and b/Images/Game/Characters/Sonic/run.png differ diff --git a/Images/Game/Characters/Sonic/smash_attack.png b/Images/Game/Characters/Sonic/smash_attack.png new file mode 100755 index 0000000..bd9acf0 Binary files /dev/null and b/Images/Game/Characters/Sonic/smash_attack.png differ diff --git a/Images/Game/Characters/Sonic/smash_attack_down.png b/Images/Game/Characters/Sonic/smash_attack_down.png new file mode 100755 index 0000000..7067454 Binary files /dev/null and b/Images/Game/Characters/Sonic/smash_attack_down.png differ diff --git a/Images/Game/Characters/Sonic/smash_attack_up.png b/Images/Game/Characters/Sonic/smash_attack_up.png new file mode 100755 index 0000000..b24b173 Binary files /dev/null and b/Images/Game/Characters/Sonic/smash_attack_up.png differ diff --git a/Images/Game/Characters/Sonic/smash_charge.png b/Images/Game/Characters/Sonic/smash_charge.png new file mode 100755 index 0000000..88c4945 Binary files /dev/null and b/Images/Game/Characters/Sonic/smash_charge.png differ diff --git a/Images/Game/Characters/Sonic/smash_wind.png b/Images/Game/Characters/Sonic/smash_wind.png new file mode 100755 index 0000000..e82e859 Binary files /dev/null and b/Images/Game/Characters/Sonic/smash_wind.png differ diff --git a/Images/Game/Characters/Sonic/special_attack.png b/Images/Game/Characters/Sonic/special_attack.png new file mode 100755 index 0000000..7d15aca Binary files /dev/null and b/Images/Game/Characters/Sonic/special_attack.png differ diff --git a/Images/Game/Characters/Sonic/special_attack_down.png b/Images/Game/Characters/Sonic/special_attack_down.png new file mode 100755 index 0000000..d78ad57 Binary files /dev/null and b/Images/Game/Characters/Sonic/special_attack_down.png differ diff --git a/Images/Game/Characters/Sonic/special_attack_up.png b/Images/Game/Characters/Sonic/special_attack_up.png new file mode 100755 index 0000000..2dc228c Binary files /dev/null and b/Images/Game/Characters/Sonic/special_attack_up.png differ diff --git a/Images/Game/Characters/Sonic/special_charge_down.png b/Images/Game/Characters/Sonic/special_charge_down.png new file mode 100755 index 0000000..50eed8a Binary files /dev/null and b/Images/Game/Characters/Sonic/special_charge_down.png differ diff --git a/Images/Game/Characters/Sonic/special_finish.png b/Images/Game/Characters/Sonic/special_finish.png new file mode 100755 index 0000000..798f264 Binary files /dev/null and b/Images/Game/Characters/Sonic/special_finish.png differ diff --git a/Images/Game/Characters/Sonic/special_land_down.png b/Images/Game/Characters/Sonic/special_land_down.png new file mode 100755 index 0000000..f715d63 Binary files /dev/null and b/Images/Game/Characters/Sonic/special_land_down.png differ diff --git a/Images/Game/Characters/Sonic/special_prep.png b/Images/Game/Characters/Sonic/special_prep.png new file mode 100755 index 0000000..6642066 Binary files /dev/null and b/Images/Game/Characters/Sonic/special_prep.png differ diff --git a/Images/Game/Characters/Sonic/special_prep_side.png b/Images/Game/Characters/Sonic/special_prep_side.png new file mode 100755 index 0000000..7b56c47 Binary files /dev/null and b/Images/Game/Characters/Sonic/special_prep_side.png differ diff --git a/Images/Game/Characters/Sonic/spring_bounce.png b/Images/Game/Characters/Sonic/spring_bounce.png new file mode 100755 index 0000000..45842ff Binary files /dev/null and b/Images/Game/Characters/Sonic/spring_bounce.png differ diff --git a/Images/Game/Characters/Sonic/spring_normal.png b/Images/Game/Characters/Sonic/spring_normal.png new file mode 100755 index 0000000..6cc49a2 Binary files /dev/null and b/Images/Game/Characters/Sonic/spring_normal.png differ diff --git a/Images/Game/Characters/Sonic/stand.png b/Images/Game/Characters/Sonic/stand.png new file mode 100755 index 0000000..bea1c96 Binary files /dev/null and b/Images/Game/Characters/Sonic/stand.png differ diff --git a/Images/Game/Characters/Sonic/standard_attack.png b/Images/Game/Characters/Sonic/standard_attack.png new file mode 100755 index 0000000..5b34de5 Binary files /dev/null and b/Images/Game/Characters/Sonic/standard_attack.png differ diff --git a/Images/Game/Characters/Sonic/standard_attack2.png b/Images/Game/Characters/Sonic/standard_attack2.png new file mode 100755 index 0000000..410330c Binary files /dev/null and b/Images/Game/Characters/Sonic/standard_attack2.png differ diff --git a/Images/Game/Characters/Sonic/standard_attack3.png b/Images/Game/Characters/Sonic/standard_attack3.png new file mode 100755 index 0000000..653d89b Binary files /dev/null and b/Images/Game/Characters/Sonic/standard_attack3.png differ diff --git a/Images/Game/Characters/Sonic/standard_attack_down.png b/Images/Game/Characters/Sonic/standard_attack_down.png new file mode 100755 index 0000000..2cf183a Binary files /dev/null and b/Images/Game/Characters/Sonic/standard_attack_down.png differ diff --git a/Images/Game/Characters/Sonic/standard_attack_side.png b/Images/Game/Characters/Sonic/standard_attack_side.png new file mode 100755 index 0000000..a9a71f2 Binary files /dev/null and b/Images/Game/Characters/Sonic/standard_attack_side.png differ diff --git a/Images/Game/Characters/Sonic/standard_attack_up.png b/Images/Game/Characters/Sonic/standard_attack_up.png new file mode 100755 index 0000000..c53c1c6 Binary files /dev/null and b/Images/Game/Characters/Sonic/standard_attack_up.png differ diff --git a/Images/Game/Characters/Sonic/stock.png b/Images/Game/Characters/Sonic/stock.png new file mode 100755 index 0000000..6e0737d Binary files /dev/null and b/Images/Game/Characters/Sonic/stock.png differ diff --git a/Images/Game/Characters/Sonic/symbol.png b/Images/Game/Characters/Sonic/symbol.png new file mode 100755 index 0000000..92d7365 Binary files /dev/null and b/Images/Game/Characters/Sonic/symbol.png differ diff --git a/Images/Game/Characters/Sonic/walk.png b/Images/Game/Characters/Sonic/walk.png new file mode 100755 index 0000000..c7cfbc0 Binary files /dev/null and b/Images/Game/Characters/Sonic/walk.png differ diff --git a/Images/Game/Characters/Sonic/win.png b/Images/Game/Characters/Sonic/win.png new file mode 100755 index 0000000..3dc99c0 Binary files /dev/null and b/Images/Game/Characters/Sonic/win.png differ diff --git a/Images/Game/Characters/Sonic/win_hold.png b/Images/Game/Characters/Sonic/win_hold.png new file mode 100755 index 0000000..78648aa Binary files /dev/null and b/Images/Game/Characters/Sonic/win_hold.png differ diff --git a/Images/Game/Controls/arrow_down.png b/Images/Game/Controls/arrow_down.png new file mode 100755 index 0000000..a4a0e76 Binary files /dev/null and b/Images/Game/Controls/arrow_down.png differ diff --git a/Images/Game/Controls/arrow_left.png b/Images/Game/Controls/arrow_left.png new file mode 100755 index 0000000..a72b906 Binary files /dev/null and b/Images/Game/Controls/arrow_left.png differ diff --git a/Images/Game/Controls/arrow_right.png b/Images/Game/Controls/arrow_right.png new file mode 100755 index 0000000..f771c91 Binary files /dev/null and b/Images/Game/Controls/arrow_right.png differ diff --git a/Images/Game/Controls/arrow_up.png b/Images/Game/Controls/arrow_up.png new file mode 100755 index 0000000..4fe98ae Binary files /dev/null and b/Images/Game/Controls/arrow_up.png differ diff --git a/Images/Game/Controls/button_a.png b/Images/Game/Controls/button_a.png new file mode 100755 index 0000000..06c953a Binary files /dev/null and b/Images/Game/Controls/button_a.png differ diff --git a/Images/Game/Controls/button_b.png b/Images/Game/Controls/button_b.png new file mode 100755 index 0000000..955ff1f Binary files /dev/null and b/Images/Game/Controls/button_b.png differ diff --git a/Images/Game/Controls/button_start.png b/Images/Game/Controls/button_start.png new file mode 100755 index 0000000..eff68a7 Binary files /dev/null and b/Images/Game/Controls/button_start.png differ diff --git a/Images/Game/Controls/button_xy.png b/Images/Game/Controls/button_xy.png new file mode 100755 index 0000000..b8756db Binary files /dev/null and b/Images/Game/Controls/button_xy.png differ diff --git a/Images/Game/Controls/button_z.png b/Images/Game/Controls/button_z.png new file mode 100644 index 0000000..962b2aa Binary files /dev/null and b/Images/Game/Controls/button_z.png differ diff --git a/Images/Game/Controls/joystick_center.png b/Images/Game/Controls/joystick_center.png new file mode 100755 index 0000000..eb64b40 Binary files /dev/null and b/Images/Game/Controls/joystick_center.png differ diff --git a/Images/Game/Controls/joystick_down.png b/Images/Game/Controls/joystick_down.png new file mode 100755 index 0000000..43f1bd2 Binary files /dev/null and b/Images/Game/Controls/joystick_down.png differ diff --git a/Images/Game/Controls/joystick_down2.png b/Images/Game/Controls/joystick_down2.png new file mode 100755 index 0000000..346986c Binary files /dev/null and b/Images/Game/Controls/joystick_down2.png differ diff --git a/Images/Game/Controls/joystick_down_left.png b/Images/Game/Controls/joystick_down_left.png new file mode 100755 index 0000000..869461c Binary files /dev/null and b/Images/Game/Controls/joystick_down_left.png differ diff --git a/Images/Game/Controls/joystick_down_left2.png b/Images/Game/Controls/joystick_down_left2.png new file mode 100755 index 0000000..1fb6e5f Binary files /dev/null and b/Images/Game/Controls/joystick_down_left2.png differ diff --git a/Images/Game/Controls/joystick_down_right.png b/Images/Game/Controls/joystick_down_right.png new file mode 100755 index 0000000..20e0ec7 Binary files /dev/null and b/Images/Game/Controls/joystick_down_right.png differ diff --git a/Images/Game/Controls/joystick_down_right2.png b/Images/Game/Controls/joystick_down_right2.png new file mode 100755 index 0000000..70dc0de Binary files /dev/null and b/Images/Game/Controls/joystick_down_right2.png differ diff --git a/Images/Game/Controls/joystick_left.png b/Images/Game/Controls/joystick_left.png new file mode 100755 index 0000000..441e0d9 Binary files /dev/null and b/Images/Game/Controls/joystick_left.png differ diff --git a/Images/Game/Controls/joystick_left2.png b/Images/Game/Controls/joystick_left2.png new file mode 100755 index 0000000..b049539 Binary files /dev/null and b/Images/Game/Controls/joystick_left2.png differ diff --git a/Images/Game/Controls/joystick_right.png b/Images/Game/Controls/joystick_right.png new file mode 100755 index 0000000..c201b68 Binary files /dev/null and b/Images/Game/Controls/joystick_right.png differ diff --git a/Images/Game/Controls/joystick_right2.png b/Images/Game/Controls/joystick_right2.png new file mode 100755 index 0000000..fc3282c Binary files /dev/null and b/Images/Game/Controls/joystick_right2.png differ diff --git a/Images/Game/Controls/joystick_up.png b/Images/Game/Controls/joystick_up.png new file mode 100755 index 0000000..b6800aa Binary files /dev/null and b/Images/Game/Controls/joystick_up.png differ diff --git a/Images/Game/Controls/joystick_up2.png b/Images/Game/Controls/joystick_up2.png new file mode 100755 index 0000000..890b7ba Binary files /dev/null and b/Images/Game/Controls/joystick_up2.png differ diff --git a/Images/Game/Controls/joystick_up_left.png b/Images/Game/Controls/joystick_up_left.png new file mode 100755 index 0000000..a062a41 Binary files /dev/null and b/Images/Game/Controls/joystick_up_left.png differ diff --git a/Images/Game/Controls/joystick_up_left2.png b/Images/Game/Controls/joystick_up_left2.png new file mode 100755 index 0000000..44b531e Binary files /dev/null and b/Images/Game/Controls/joystick_up_left2.png differ diff --git a/Images/Game/Controls/joystick_up_right.png b/Images/Game/Controls/joystick_up_right.png new file mode 100755 index 0000000..93b5c53 Binary files /dev/null and b/Images/Game/Controls/joystick_up_right.png differ diff --git a/Images/Game/Controls/joystick_up_right2.png b/Images/Game/Controls/joystick_up_right2.png new file mode 100755 index 0000000..e28a0c8 Binary files /dev/null and b/Images/Game/Controls/joystick_up_right2.png differ diff --git a/Images/Game/HUD/ExitButton.png b/Images/Game/HUD/ExitButton.png new file mode 100644 index 0000000..9c1b7ae Binary files /dev/null and b/Images/Game/HUD/ExitButton.png differ diff --git a/Images/Game/HUD/FinishButton.png b/Images/Game/HUD/FinishButton.png new file mode 100644 index 0000000..bf6fcfb Binary files /dev/null and b/Images/Game/HUD/FinishButton.png differ diff --git a/Images/Game/HUD/Game.png b/Images/Game/HUD/Game.png new file mode 100755 index 0000000..8f2b493 Binary files /dev/null and b/Images/Game/HUD/Game.png differ diff --git a/Images/Game/HUD/Go.png b/Images/Game/HUD/Go.png new file mode 100755 index 0000000..dec06f1 Binary files /dev/null and b/Images/Game/HUD/Go.png differ diff --git a/Images/Game/HUD/PercentText/0.png b/Images/Game/HUD/PercentText/0.png new file mode 100755 index 0000000..8cd53d6 Binary files /dev/null and b/Images/Game/HUD/PercentText/0.png differ diff --git a/Images/Game/HUD/PercentText/1.png b/Images/Game/HUD/PercentText/1.png new file mode 100755 index 0000000..e4a4c2a Binary files /dev/null and b/Images/Game/HUD/PercentText/1.png differ diff --git a/Images/Game/HUD/PercentText/2.png b/Images/Game/HUD/PercentText/2.png new file mode 100755 index 0000000..0f9c321 Binary files /dev/null and b/Images/Game/HUD/PercentText/2.png differ diff --git a/Images/Game/HUD/PercentText/3.png b/Images/Game/HUD/PercentText/3.png new file mode 100755 index 0000000..0c0eb08 Binary files /dev/null and b/Images/Game/HUD/PercentText/3.png differ diff --git a/Images/Game/HUD/PercentText/4.png b/Images/Game/HUD/PercentText/4.png new file mode 100755 index 0000000..388e916 Binary files /dev/null and b/Images/Game/HUD/PercentText/4.png differ diff --git a/Images/Game/HUD/PercentText/5.png b/Images/Game/HUD/PercentText/5.png new file mode 100755 index 0000000..bac78f6 Binary files /dev/null and b/Images/Game/HUD/PercentText/5.png differ diff --git a/Images/Game/HUD/PercentText/6.png b/Images/Game/HUD/PercentText/6.png new file mode 100755 index 0000000..4bd6baf Binary files /dev/null and b/Images/Game/HUD/PercentText/6.png differ diff --git a/Images/Game/HUD/PercentText/7.png b/Images/Game/HUD/PercentText/7.png new file mode 100755 index 0000000..be4578c Binary files /dev/null and b/Images/Game/HUD/PercentText/7.png differ diff --git a/Images/Game/HUD/PercentText/8.png b/Images/Game/HUD/PercentText/8.png new file mode 100755 index 0000000..fd37c74 Binary files /dev/null and b/Images/Game/HUD/PercentText/8.png differ diff --git a/Images/Game/HUD/PercentText/9.png b/Images/Game/HUD/PercentText/9.png new file mode 100755 index 0000000..f67bc68 Binary files /dev/null and b/Images/Game/HUD/PercentText/9.png differ diff --git a/Images/Game/HUD/PercentText/percent.png b/Images/Game/HUD/PercentText/percent.png new file mode 100755 index 0000000..d8631ca Binary files /dev/null and b/Images/Game/HUD/PercentText/percent.png differ diff --git a/Images/Game/HUD/Ready.png b/Images/Game/HUD/Ready.png new file mode 100755 index 0000000..a556d2f Binary files /dev/null and b/Images/Game/HUD/Ready.png differ diff --git a/Images/Game/HUD/ResumeButton.png b/Images/Game/HUD/ResumeButton.png new file mode 100644 index 0000000..4b876e5 Binary files /dev/null and b/Images/Game/HUD/ResumeButton.png differ diff --git a/Images/Game/HUD/SuddenDeath.png b/Images/Game/HUD/SuddenDeath.png new file mode 100755 index 0000000..b18cea1 Binary files /dev/null and b/Images/Game/HUD/SuddenDeath.png differ diff --git a/Images/Game/HUD/Training/arrow.png b/Images/Game/HUD/Training/arrow.png new file mode 100755 index 0000000..81901ab Binary files /dev/null and b/Images/Game/HUD/Training/arrow.png differ diff --git a/Images/Game/HUD/Training/bg.png b/Images/Game/HUD/Training/bg.png new file mode 100755 index 0000000..b79a88c Binary files /dev/null and b/Images/Game/HUD/Training/bg.png differ diff --git a/Images/Game/HUD/Training/button_apply.png b/Images/Game/HUD/Training/button_apply.png new file mode 100755 index 0000000..818563b Binary files /dev/null and b/Images/Game/HUD/Training/button_apply.png differ diff --git a/Images/Game/HUD/Training/button_close.png b/Images/Game/HUD/Training/button_close.png new file mode 100755 index 0000000..36c3c4c Binary files /dev/null and b/Images/Game/HUD/Training/button_close.png differ diff --git a/Images/Game/HUD/Training/button_finish.png b/Images/Game/HUD/Training/button_finish.png new file mode 100755 index 0000000..1074c38 Binary files /dev/null and b/Images/Game/HUD/Training/button_finish.png differ diff --git a/Images/Game/HUD/Training/button_open.png b/Images/Game/HUD/Training/button_open.png new file mode 100755 index 0000000..1ad6d48 Binary files /dev/null and b/Images/Game/HUD/Training/button_open.png differ diff --git a/Images/Game/HUD/Training/panel_camera.png b/Images/Game/HUD/Training/panel_camera.png new file mode 100755 index 0000000..8a79b50 Binary files /dev/null and b/Images/Game/HUD/Training/panel_camera.png differ diff --git a/Images/Game/HUD/Training/panel_cpu.png b/Images/Game/HUD/Training/panel_cpu.png new file mode 100755 index 0000000..0aa86fc Binary files /dev/null and b/Images/Game/HUD/Training/panel_cpu.png differ diff --git a/Images/Game/HUD/Training/panel_cpu_damage.png b/Images/Game/HUD/Training/panel_cpu_damage.png new file mode 100755 index 0000000..7aa9c31 Binary files /dev/null and b/Images/Game/HUD/Training/panel_cpu_damage.png differ diff --git a/Images/Game/HUD/Training/panel_items.png b/Images/Game/HUD/Training/panel_items.png new file mode 100755 index 0000000..51feef8 Binary files /dev/null and b/Images/Game/HUD/Training/panel_items.png differ diff --git a/Images/Game/HUD/default_stock.png b/Images/Game/HUD/default_stock.png new file mode 100755 index 0000000..1932877 Binary files /dev/null and b/Images/Game/HUD/default_stock.png differ diff --git a/Images/Game/HUD/default_symbol.png b/Images/Game/HUD/default_symbol.png new file mode 100755 index 0000000..16b66e7 Binary files /dev/null and b/Images/Game/HUD/default_symbol.png differ diff --git a/Images/Game/HUD/header.png b/Images/Game/HUD/header.png new file mode 100644 index 0000000..70086ac Binary files /dev/null and b/Images/Game/HUD/header.png differ diff --git a/Images/Game/Indicators/p0_down.png b/Images/Game/Indicators/p0_down.png new file mode 100755 index 0000000..b72c02e Binary files /dev/null and b/Images/Game/Indicators/p0_down.png differ diff --git a/Images/Game/Indicators/p1_down.png b/Images/Game/Indicators/p1_down.png new file mode 100755 index 0000000..060089d Binary files /dev/null and b/Images/Game/Indicators/p1_down.png differ diff --git a/Images/Game/Indicators/p2_down.png b/Images/Game/Indicators/p2_down.png new file mode 100755 index 0000000..8b8863e Binary files /dev/null and b/Images/Game/Indicators/p2_down.png differ diff --git a/Images/Game/Indicators/p3_down.png b/Images/Game/Indicators/p3_down.png new file mode 100755 index 0000000..ca477b4 Binary files /dev/null and b/Images/Game/Indicators/p3_down.png differ diff --git a/Images/Game/Indicators/p4_down.png b/Images/Game/Indicators/p4_down.png new file mode 100755 index 0000000..d5ff935 Binary files /dev/null and b/Images/Game/Indicators/p4_down.png differ diff --git a/Images/Game/Items/BeamSword/beamsword.png b/Images/Game/Items/BeamSword/beamsword.png new file mode 100755 index 0000000..937cd5d Binary files /dev/null and b/Images/Game/Items/BeamSword/beamsword.png differ diff --git a/Images/Game/Items/BeamSword/beamsword_carry.png b/Images/Game/Items/BeamSword/beamsword_carry.png new file mode 100755 index 0000000..7678e84 Binary files /dev/null and b/Images/Game/Items/BeamSword/beamsword_carry.png differ diff --git a/Images/Game/Items/BeamSword/beamsword_swing.png b/Images/Game/Items/BeamSword/beamsword_swing.png new file mode 100755 index 0000000..7d98738 Binary files /dev/null and b/Images/Game/Items/BeamSword/beamsword_swing.png differ diff --git a/Images/Game/Items/BeamSword/beamsword_swing2.png b/Images/Game/Items/BeamSword/beamsword_swing2.png new file mode 100755 index 0000000..516eb28 Binary files /dev/null and b/Images/Game/Items/BeamSword/beamsword_swing2.png differ diff --git a/Images/Game/Items/HeartContainer/heart_container.png b/Images/Game/Items/HeartContainer/heart_container.png new file mode 100755 index 0000000..c5a243e Binary files /dev/null and b/Images/Game/Items/HeartContainer/heart_container.png differ diff --git a/Images/Game/Items/HeartContainer/sparkle.png b/Images/Game/Items/HeartContainer/sparkle.png new file mode 100755 index 0000000..9820380 Binary files /dev/null and b/Images/Game/Items/HeartContainer/sparkle.png differ diff --git a/Images/Game/Items/Mushroom/mushroom.png b/Images/Game/Items/Mushroom/mushroom.png new file mode 100755 index 0000000..da0476b Binary files /dev/null and b/Images/Game/Items/Mushroom/mushroom.png differ diff --git a/Images/Game/Items/Mushroom/poison_mushroom.png b/Images/Game/Items/Mushroom/poison_mushroom.png new file mode 100755 index 0000000..a6fbff5 Binary files /dev/null and b/Images/Game/Items/Mushroom/poison_mushroom.png differ diff --git a/Images/Game/Items/RayGun/ray.png b/Images/Game/Items/RayGun/ray.png new file mode 100755 index 0000000..171541b Binary files /dev/null and b/Images/Game/Items/RayGun/ray.png differ diff --git a/Images/Game/Items/RayGun/raygun.png b/Images/Game/Items/RayGun/raygun.png new file mode 100755 index 0000000..771d39a Binary files /dev/null and b/Images/Game/Items/RayGun/raygun.png differ diff --git a/Images/Game/Items/RayGun/raygun_down.png b/Images/Game/Items/RayGun/raygun_down.png new file mode 100755 index 0000000..230b18c Binary files /dev/null and b/Images/Game/Items/RayGun/raygun_down.png differ diff --git a/Images/Game/Items/SmashBall/finalsmash_fire.png b/Images/Game/Items/SmashBall/finalsmash_fire.png new file mode 100755 index 0000000..5ce011c Binary files /dev/null and b/Images/Game/Items/SmashBall/finalsmash_fire.png differ diff --git a/Images/Game/Items/SmashBall/smashball.png b/Images/Game/Items/SmashBall/smashball.png new file mode 100755 index 0000000..873b85c Binary files /dev/null and b/Images/Game/Items/SmashBall/smashball.png differ diff --git a/Images/Game/Items/SmashBall/smashball_hit.png b/Images/Game/Items/SmashBall/smashball_hit.png new file mode 100755 index 0000000..ab6beb6 Binary files /dev/null and b/Images/Game/Items/SmashBall/smashball_hit.png differ diff --git a/Images/Game/Misc/offscreen_explode.png b/Images/Game/Misc/offscreen_explode.png new file mode 100755 index 0000000..fd6c451 Binary files /dev/null and b/Images/Game/Misc/offscreen_explode.png differ diff --git a/Images/Game/Misc/placeholder.gif b/Images/Game/Misc/placeholder.gif new file mode 100755 index 0000000..583c13e Binary files /dev/null and b/Images/Game/Misc/placeholder.gif differ diff --git a/Images/Game/Stages/BattlefieldBrawl/bg.jpg b/Images/Game/Stages/BattlefieldBrawl/bg.jpg new file mode 100755 index 0000000..1014eca Binary files /dev/null and b/Images/Game/Stages/BattlefieldBrawl/bg.jpg differ diff --git a/Images/Game/Stages/BattlefieldBrawl/main_plat.png b/Images/Game/Stages/BattlefieldBrawl/main_plat.png new file mode 100755 index 0000000..c20f071 Binary files /dev/null and b/Images/Game/Stages/BattlefieldBrawl/main_plat.png differ diff --git a/Images/Game/Stages/BattlefieldBrawl/mainstage.png b/Images/Game/Stages/BattlefieldBrawl/mainstage.png new file mode 100755 index 0000000..1b1badf Binary files /dev/null and b/Images/Game/Stages/BattlefieldBrawl/mainstage.png differ diff --git a/Images/Game/Stages/BattlefieldBrawl/plat_middle.png b/Images/Game/Stages/BattlefieldBrawl/plat_middle.png new file mode 100755 index 0000000..d62e330 Binary files /dev/null and b/Images/Game/Stages/BattlefieldBrawl/plat_middle.png differ diff --git a/Images/Game/Stages/BattlefieldBrawl/plat_side.png b/Images/Game/Stages/BattlefieldBrawl/plat_side.png new file mode 100755 index 0000000..d439828 Binary files /dev/null and b/Images/Game/Stages/BattlefieldBrawl/plat_side.png differ diff --git a/Images/Game/Stages/FinalDestinationBrawl/bg.png b/Images/Game/Stages/FinalDestinationBrawl/bg.png new file mode 100755 index 0000000..5efa55e Binary files /dev/null and b/Images/Game/Stages/FinalDestinationBrawl/bg.png differ diff --git a/Images/Game/Stages/FinalDestinationBrawl/foreground_left.png b/Images/Game/Stages/FinalDestinationBrawl/foreground_left.png new file mode 100755 index 0000000..d77ef99 Binary files /dev/null and b/Images/Game/Stages/FinalDestinationBrawl/foreground_left.png differ diff --git a/Images/Game/Stages/FinalDestinationBrawl/foreground_right.png b/Images/Game/Stages/FinalDestinationBrawl/foreground_right.png new file mode 100755 index 0000000..e9fbd24 Binary files /dev/null and b/Images/Game/Stages/FinalDestinationBrawl/foreground_right.png differ diff --git a/Images/Game/Stages/FinalDestinationBrawl/mainstage.png b/Images/Game/Stages/FinalDestinationBrawl/mainstage.png new file mode 100755 index 0000000..8fd3537 Binary files /dev/null and b/Images/Game/Stages/FinalDestinationBrawl/mainstage.png differ diff --git a/Images/Game/Stages/HillsideBattleground/bg.png b/Images/Game/Stages/HillsideBattleground/bg.png new file mode 100755 index 0000000..2a5a5ca Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/bg.png differ diff --git a/Images/Game/Stages/HillsideBattleground/bg2.png b/Images/Game/Stages/HillsideBattleground/bg2.png new file mode 100755 index 0000000..438819d Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/bg2.png differ diff --git a/Images/Game/Stages/HillsideBattleground/fplat1.png b/Images/Game/Stages/HillsideBattleground/fplat1.png new file mode 100755 index 0000000..6ff3989 Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/fplat1.png differ diff --git a/Images/Game/Stages/HillsideBattleground/fplat2.png b/Images/Game/Stages/HillsideBattleground/fplat2.png new file mode 100755 index 0000000..d6775d0 Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/fplat2.png differ diff --git a/Images/Game/Stages/HillsideBattleground/ground.png b/Images/Game/Stages/HillsideBattleground/ground.png new file mode 100755 index 0000000..b8d564c Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/ground.png differ diff --git a/Images/Game/Stages/HillsideBattleground/mainstage.png b/Images/Game/Stages/HillsideBattleground/mainstage.png new file mode 100755 index 0000000..2a69c57 Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/mainstage.png differ diff --git a/Images/Game/Stages/HillsideBattleground/plat.png b/Images/Game/Stages/HillsideBattleground/plat.png new file mode 100755 index 0000000..0f959a3 Binary files /dev/null and b/Images/Game/Stages/HillsideBattleground/plat.png differ diff --git a/Images/Game/Stages/HyruleTemple/bg.png b/Images/Game/Stages/HyruleTemple/bg.png new file mode 100755 index 0000000..fb7037e Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/bg.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat1.png b/Images/Game/Stages/HyruleTemple/float_plat1.png new file mode 100755 index 0000000..f7cc99f Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat1.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat2.png b/Images/Game/Stages/HyruleTemple/float_plat2.png new file mode 100755 index 0000000..5c29501 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat2.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat3.png b/Images/Game/Stages/HyruleTemple/float_plat3.png new file mode 100755 index 0000000..bf5fd67 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat3.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat4.png b/Images/Game/Stages/HyruleTemple/float_plat4.png new file mode 100755 index 0000000..bde7546 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat4.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat5.png b/Images/Game/Stages/HyruleTemple/float_plat5.png new file mode 100755 index 0000000..bc3fb97 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat5.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat6.png b/Images/Game/Stages/HyruleTemple/float_plat6.png new file mode 100755 index 0000000..136900e Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat6.png differ diff --git a/Images/Game/Stages/HyruleTemple/float_plat7.png b/Images/Game/Stages/HyruleTemple/float_plat7.png new file mode 100755 index 0000000..6103ca0 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/float_plat7.png differ diff --git a/Images/Game/Stages/HyruleTemple/foreground1.png b/Images/Game/Stages/HyruleTemple/foreground1.png new file mode 100755 index 0000000..d63a2cf Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/foreground1.png differ diff --git a/Images/Game/Stages/HyruleTemple/foreground2.png b/Images/Game/Stages/HyruleTemple/foreground2.png new file mode 100755 index 0000000..2cb14cd Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/foreground2.png differ diff --git a/Images/Game/Stages/HyruleTemple/foreground3.png b/Images/Game/Stages/HyruleTemple/foreground3.png new file mode 100755 index 0000000..4a13256 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/foreground3.png differ diff --git a/Images/Game/Stages/HyruleTemple/foreground4.png b/Images/Game/Stages/HyruleTemple/foreground4.png new file mode 100755 index 0000000..2ecd95b Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/foreground4.png differ diff --git a/Images/Game/Stages/HyruleTemple/foreground5.png b/Images/Game/Stages/HyruleTemple/foreground5.png new file mode 100755 index 0000000..d0934a0 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/foreground5.png differ diff --git a/Images/Game/Stages/HyruleTemple/ground1.png b/Images/Game/Stages/HyruleTemple/ground1.png new file mode 100755 index 0000000..ea62462 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/ground1.png differ diff --git a/Images/Game/Stages/HyruleTemple/ground2.png b/Images/Game/Stages/HyruleTemple/ground2.png new file mode 100755 index 0000000..b855304 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/ground2.png differ diff --git a/Images/Game/Stages/HyruleTemple/ground3.png b/Images/Game/Stages/HyruleTemple/ground3.png new file mode 100755 index 0000000..e643367 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/ground3.png differ diff --git a/Images/Game/Stages/HyruleTemple/ground4.png b/Images/Game/Stages/HyruleTemple/ground4.png new file mode 100755 index 0000000..2e08718 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/ground4.png differ diff --git a/Images/Game/Stages/HyruleTemple/mainstage.png b/Images/Game/Stages/HyruleTemple/mainstage.png new file mode 100755 index 0000000..5a2d8e2 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/mainstage.png differ diff --git a/Images/Game/Stages/HyruleTemple/plat1.png b/Images/Game/Stages/HyruleTemple/plat1.png new file mode 100755 index 0000000..40774f3 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/plat1.png differ diff --git a/Images/Game/Stages/HyruleTemple/plat2.png b/Images/Game/Stages/HyruleTemple/plat2.png new file mode 100755 index 0000000..042e97f Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/plat2.png differ diff --git a/Images/Game/Stages/HyruleTemple/plat3.png b/Images/Game/Stages/HyruleTemple/plat3.png new file mode 100755 index 0000000..fded25a Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/plat3.png differ diff --git a/Images/Game/Stages/HyruleTemple/plat4.png b/Images/Game/Stages/HyruleTemple/plat4.png new file mode 100755 index 0000000..0a2d1e8 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/plat4.png differ diff --git a/Images/Game/Stages/HyruleTemple/plat5.png b/Images/Game/Stages/HyruleTemple/plat5.png new file mode 100755 index 0000000..5f8e359 Binary files /dev/null and b/Images/Game/Stages/HyruleTemple/plat5.png differ diff --git a/Images/Game/Stages/TestStage/bg.png b/Images/Game/Stages/TestStage/bg.png new file mode 100755 index 0000000..f5b27c8 Binary files /dev/null and b/Images/Game/Stages/TestStage/bg.png differ diff --git a/Images/Game/Stages/TestStage/circle.png b/Images/Game/Stages/TestStage/circle.png new file mode 100755 index 0000000..7df2abd Binary files /dev/null and b/Images/Game/Stages/TestStage/circle.png differ diff --git a/Images/Game/Stages/TestStage/fractal.png b/Images/Game/Stages/TestStage/fractal.png new file mode 100755 index 0000000..150be0d Binary files /dev/null and b/Images/Game/Stages/TestStage/fractal.png differ diff --git a/Images/Game/Stages/TestStage/gothrough_plat1.png b/Images/Game/Stages/TestStage/gothrough_plat1.png new file mode 100755 index 0000000..f1de496 Binary files /dev/null and b/Images/Game/Stages/TestStage/gothrough_plat1.png differ diff --git a/Images/Game/Stages/TestStage/nic_cage.png b/Images/Game/Stages/TestStage/nic_cage.png new file mode 100755 index 0000000..f7246da Binary files /dev/null and b/Images/Game/Stages/TestStage/nic_cage.png differ diff --git a/Images/Game/Stages/TestStage/nyan_cat.png b/Images/Game/Stages/TestStage/nyan_cat.png new file mode 100755 index 0000000..17b8ed6 Binary files /dev/null and b/Images/Game/Stages/TestStage/nyan_cat.png differ diff --git a/Images/Game/Stages/TestStage/platform1.png b/Images/Game/Stages/TestStage/platform1.png new file mode 100755 index 0000000..d418df6 Binary files /dev/null and b/Images/Game/Stages/TestStage/platform1.png differ diff --git a/Images/Game/Stages/TestStage/roflsaurus.png b/Images/Game/Stages/TestStage/roflsaurus.png new file mode 100755 index 0000000..fa0c350 Binary files /dev/null and b/Images/Game/Stages/TestStage/roflsaurus.png differ diff --git a/Images/Game/Stages/TestStage/swirl.png b/Images/Game/Stages/TestStage/swirl.png new file mode 100755 index 0000000..3d4ac3a Binary files /dev/null and b/Images/Game/Stages/TestStage/swirl.png differ diff --git a/Images/Game/WinnerScreen/bg.png b/Images/Game/WinnerScreen/bg.png new file mode 100755 index 0000000..263bb5f Binary files /dev/null and b/Images/Game/WinnerScreen/bg.png differ diff --git a/Images/Game/WinnerScreen/continue.png b/Images/Game/WinnerScreen/continue.png new file mode 100755 index 0000000..3851a04 Binary files /dev/null and b/Images/Game/WinnerScreen/continue.png differ diff --git a/Images/Game/WinnerScreen/continue_selected.png b/Images/Game/WinnerScreen/continue_selected.png new file mode 100755 index 0000000..355a465 Binary files /dev/null and b/Images/Game/WinnerScreen/continue_selected.png differ diff --git a/Images/Menus/Backgrounds/bg1.png b/Images/Menus/Backgrounds/bg1.png new file mode 100755 index 0000000..0fa2705 Binary files /dev/null and b/Images/Menus/Backgrounds/bg1.png differ diff --git a/Images/Menus/Backgrounds/bg2.png b/Images/Menus/Backgrounds/bg2.png new file mode 100755 index 0000000..3106c77 Binary files /dev/null and b/Images/Menus/Backgrounds/bg2.png differ diff --git a/Images/Menus/Buttons/Bluetooth/Bluetooth.png b/Images/Menus/Buttons/Bluetooth/Bluetooth.png new file mode 100644 index 0000000..cc0fe56 Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/Bluetooth.png differ diff --git a/Images/Menus/Buttons/Bluetooth/Bluetooth_selected.png b/Images/Menus/Buttons/Bluetooth/Bluetooth_selected.png new file mode 100644 index 0000000..774e530 Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/Bluetooth_selected.png differ diff --git a/Images/Menus/Buttons/Bluetooth/Brawl.png b/Images/Menus/Buttons/Bluetooth/Brawl.png new file mode 100644 index 0000000..9ff6dcd Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/Brawl.png differ diff --git a/Images/Menus/Buttons/Bluetooth/Brawl_disabled.png b/Images/Menus/Buttons/Bluetooth/Brawl_disabled.png new file mode 100644 index 0000000..03e30c8 Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/Brawl_disabled.png differ diff --git a/Images/Menus/Buttons/Bluetooth/Brawl_selected.png b/Images/Menus/Buttons/Bluetooth/Brawl_selected.png new file mode 100644 index 0000000..04ed385 Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/Brawl_selected.png differ diff --git a/Images/Menus/Buttons/Bluetooth/iPhone.png b/Images/Menus/Buttons/Bluetooth/iPhone.png new file mode 100644 index 0000000..5810e2e Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/iPhone.png differ diff --git a/Images/Menus/Buttons/Bluetooth/iPod_Touch.png b/Images/Menus/Buttons/Bluetooth/iPod_Touch.png new file mode 100644 index 0000000..e8a584a Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/iPod_Touch.png differ diff --git a/Images/Menus/Buttons/Bluetooth/no_peer.png b/Images/Menus/Buttons/Bluetooth/no_peer.png new file mode 100644 index 0000000..c347eba Binary files /dev/null and b/Images/Menus/Buttons/Bluetooth/no_peer.png differ diff --git a/Images/Menus/Buttons/Generic/arrow.png b/Images/Menus/Buttons/Generic/arrow.png new file mode 100755 index 0000000..485633d Binary files /dev/null and b/Images/Menus/Buttons/Generic/arrow.png differ diff --git a/Images/Menus/Buttons/Generic/arrow_down.png b/Images/Menus/Buttons/Generic/arrow_down.png new file mode 100755 index 0000000..96eec58 Binary files /dev/null and b/Images/Menus/Buttons/Generic/arrow_down.png differ diff --git a/Images/Menus/Buttons/Generic/arrow_down_selected.png b/Images/Menus/Buttons/Generic/arrow_down_selected.png new file mode 100755 index 0000000..8b953b9 Binary files /dev/null and b/Images/Menus/Buttons/Generic/arrow_down_selected.png differ diff --git a/Images/Menus/Buttons/Generic/arrow_selected.png b/Images/Menus/Buttons/Generic/arrow_selected.png new file mode 100755 index 0000000..779bbb3 Binary files /dev/null and b/Images/Menus/Buttons/Generic/arrow_selected.png differ diff --git a/Images/Menus/Buttons/Generic/arrow_up.png b/Images/Menus/Buttons/Generic/arrow_up.png new file mode 100755 index 0000000..8b469e5 Binary files /dev/null and b/Images/Menus/Buttons/Generic/arrow_up.png differ diff --git a/Images/Menus/Buttons/Generic/arrow_up_selected.png b/Images/Menus/Buttons/Generic/arrow_up_selected.png new file mode 100755 index 0000000..54564d6 Binary files /dev/null and b/Images/Menus/Buttons/Generic/arrow_up_selected.png differ diff --git a/Images/Menus/Buttons/Generic/back.png b/Images/Menus/Buttons/Generic/back.png new file mode 100755 index 0000000..02100f1 Binary files /dev/null and b/Images/Menus/Buttons/Generic/back.png differ diff --git a/Images/Menus/Buttons/Generic/back_selected.png b/Images/Menus/Buttons/Generic/back_selected.png new file mode 100755 index 0000000..e5ad543 Binary files /dev/null and b/Images/Menus/Buttons/Generic/back_selected.png differ diff --git a/Images/Menus/Buttons/Generic/options_bar.png b/Images/Menus/Buttons/Generic/options_bar.png new file mode 100755 index 0000000..371e033 Binary files /dev/null and b/Images/Menus/Buttons/Generic/options_bar.png differ diff --git a/Images/Menus/Buttons/Generic/options_bar_small.png b/Images/Menus/Buttons/Generic/options_bar_small.png new file mode 100755 index 0000000..d810a4e Binary files /dev/null and b/Images/Menus/Buttons/Generic/options_bar_small.png differ diff --git a/Images/Menus/Buttons/Generic/options_bar_small_selected.png b/Images/Menus/Buttons/Generic/options_bar_small_selected.png new file mode 100755 index 0000000..d9caa78 Binary files /dev/null and b/Images/Menus/Buttons/Generic/options_bar_small_selected.png differ diff --git a/Images/Menus/Buttons/Generic/options_tab_small.png b/Images/Menus/Buttons/Generic/options_tab_small.png new file mode 100755 index 0000000..3477cf2 Binary files /dev/null and b/Images/Menus/Buttons/Generic/options_tab_small.png differ diff --git a/Images/Menus/Buttons/Generic/options_tab_small_selected.png b/Images/Menus/Buttons/Generic/options_tab_small_selected.png new file mode 100755 index 0000000..90c0ed7 Binary files /dev/null and b/Images/Menus/Buttons/Generic/options_tab_small_selected.png differ diff --git a/Images/Menus/Buttons/Generic/readytofight.png b/Images/Menus/Buttons/Generic/readytofight.png new file mode 100755 index 0000000..cf32a86 Binary files /dev/null and b/Images/Menus/Buttons/Generic/readytofight.png differ diff --git a/Images/Menus/Buttons/Generic/readytofight_selected.png b/Images/Menus/Buttons/Generic/readytofight_selected.png new file mode 100755 index 0000000..edf3e5b Binary files /dev/null and b/Images/Menus/Buttons/Generic/readytofight_selected.png differ diff --git a/Images/Menus/Buttons/Generic/rules_bar.png b/Images/Menus/Buttons/Generic/rules_bar.png new file mode 100755 index 0000000..b990a9f Binary files /dev/null and b/Images/Menus/Buttons/Generic/rules_bar.png differ diff --git a/Images/Menus/Buttons/Generic/rules_bar_selected.png b/Images/Menus/Buttons/Generic/rules_bar_selected.png new file mode 100755 index 0000000..98b3150 Binary files /dev/null and b/Images/Menus/Buttons/Generic/rules_bar_selected.png differ diff --git a/Images/Menus/Buttons/Generic/toggle_off.png b/Images/Menus/Buttons/Generic/toggle_off.png new file mode 100755 index 0000000..bdb5045 Binary files /dev/null and b/Images/Menus/Buttons/Generic/toggle_off.png differ diff --git a/Images/Menus/Buttons/Generic/toggle_on.png b/Images/Menus/Buttons/Generic/toggle_on.png new file mode 100755 index 0000000..21cddb1 Binary files /dev/null and b/Images/Menus/Buttons/Generic/toggle_on.png differ diff --git a/Images/Menus/Buttons/Group/brawl.png b/Images/Menus/Buttons/Group/brawl.png new file mode 100755 index 0000000..3f9b9a3 Binary files /dev/null and b/Images/Menus/Buttons/Group/brawl.png differ diff --git a/Images/Menus/Buttons/Group/brawl_selected.png b/Images/Menus/Buttons/Group/brawl_selected.png new file mode 100755 index 0000000..ad1822d Binary files /dev/null and b/Images/Menus/Buttons/Group/brawl_selected.png differ diff --git a/Images/Menus/Buttons/Group/freeforall.png b/Images/Menus/Buttons/Group/freeforall.png new file mode 100755 index 0000000..38faaad Binary files /dev/null and b/Images/Menus/Buttons/Group/freeforall.png differ diff --git a/Images/Menus/Buttons/Group/freeforall_selected.png b/Images/Menus/Buttons/Group/freeforall_selected.png new file mode 100755 index 0000000..d1de22b Binary files /dev/null and b/Images/Menus/Buttons/Group/freeforall_selected.png differ diff --git a/Images/Menus/Buttons/Group/group.png b/Images/Menus/Buttons/Group/group.png new file mode 100755 index 0000000..742caa8 Binary files /dev/null and b/Images/Menus/Buttons/Group/group.png differ diff --git a/Images/Menus/Buttons/Group/group_selected.png b/Images/Menus/Buttons/Group/group_selected.png new file mode 100755 index 0000000..4a860d3 Binary files /dev/null and b/Images/Menus/Buttons/Group/group_selected.png differ diff --git a/Images/Menus/Buttons/Group/rules.png b/Images/Menus/Buttons/Group/rules.png new file mode 100755 index 0000000..3fbfcd1 Binary files /dev/null and b/Images/Menus/Buttons/Group/rules.png differ diff --git a/Images/Menus/Buttons/Group/rules_selected.png b/Images/Menus/Buttons/Group/rules_selected.png new file mode 100644 index 0000000..724b7d4 Binary files /dev/null and b/Images/Menus/Buttons/Group/rules_selected.png differ diff --git a/Images/Menus/Buttons/Group/teambattle.png b/Images/Menus/Buttons/Group/teambattle.png new file mode 100755 index 0000000..b4798a9 Binary files /dev/null and b/Images/Menus/Buttons/Group/teambattle.png differ diff --git a/Images/Menus/Buttons/Group/teambattle_selected.png b/Images/Menus/Buttons/Group/teambattle_selected.png new file mode 100755 index 0000000..44e00e4 Binary files /dev/null and b/Images/Menus/Buttons/Group/teambattle_selected.png differ diff --git a/Images/Menus/Buttons/Keys/key_large.png b/Images/Menus/Buttons/Keys/key_large.png new file mode 100755 index 0000000..ad636e6 Binary files /dev/null and b/Images/Menus/Buttons/Keys/key_large.png differ diff --git a/Images/Menus/Buttons/Keys/key_small.png b/Images/Menus/Buttons/Keys/key_small.png new file mode 100755 index 0000000..d36c54f Binary files /dev/null and b/Images/Menus/Buttons/Keys/key_small.png differ diff --git a/Images/Menus/Buttons/Options/controls.png b/Images/Menus/Buttons/Options/controls.png new file mode 100755 index 0000000..79a18e1 Binary files /dev/null and b/Images/Menus/Buttons/Options/controls.png differ diff --git a/Images/Menus/Buttons/Options/controls_selected.png b/Images/Menus/Buttons/Options/controls_selected.png new file mode 100755 index 0000000..ea8aed6 Binary files /dev/null and b/Images/Menus/Buttons/Options/controls_selected.png differ diff --git a/Images/Menus/Buttons/Options/display.png b/Images/Menus/Buttons/Options/display.png new file mode 100755 index 0000000..db5608b Binary files /dev/null and b/Images/Menus/Buttons/Options/display.png differ diff --git a/Images/Menus/Buttons/Options/display_selected.png b/Images/Menus/Buttons/Options/display_selected.png new file mode 100755 index 0000000..015ec24 Binary files /dev/null and b/Images/Menus/Buttons/Options/display_selected.png differ diff --git a/Images/Menus/Buttons/Options/options.png b/Images/Menus/Buttons/Options/options.png new file mode 100755 index 0000000..4f93422 Binary files /dev/null and b/Images/Menus/Buttons/Options/options.png differ diff --git a/Images/Menus/Buttons/Options/options_selected.png b/Images/Menus/Buttons/Options/options_selected.png new file mode 100755 index 0000000..36fa2b6 Binary files /dev/null and b/Images/Menus/Buttons/Options/options_selected.png differ diff --git a/Images/Menus/Buttons/Options/other.png b/Images/Menus/Buttons/Options/other.png new file mode 100755 index 0000000..20673af Binary files /dev/null and b/Images/Menus/Buttons/Options/other.png differ diff --git a/Images/Menus/Buttons/Options/other_selected.png b/Images/Menus/Buttons/Options/other_selected.png new file mode 100755 index 0000000..bf31d1c Binary files /dev/null and b/Images/Menus/Buttons/Options/other_selected.png differ diff --git a/Images/Menus/Buttons/Options/sound.png b/Images/Menus/Buttons/Options/sound.png new file mode 100755 index 0000000..c7a05b3 Binary files /dev/null and b/Images/Menus/Buttons/Options/sound.png differ diff --git a/Images/Menus/Buttons/Options/sound_selected.png b/Images/Menus/Buttons/Options/sound_selected.png new file mode 100755 index 0000000..183e312 Binary files /dev/null and b/Images/Menus/Buttons/Options/sound_selected.png differ diff --git a/Images/Menus/Buttons/Solo/solo.png b/Images/Menus/Buttons/Solo/solo.png new file mode 100755 index 0000000..0f67903 Binary files /dev/null and b/Images/Menus/Buttons/Solo/solo.png differ diff --git a/Images/Menus/Buttons/Solo/solo_selected.png b/Images/Menus/Buttons/Solo/solo_selected.png new file mode 100755 index 0000000..5fa812c Binary files /dev/null and b/Images/Menus/Buttons/Solo/solo_selected.png differ diff --git a/Images/Menus/Buttons/Solo/training.png b/Images/Menus/Buttons/Solo/training.png new file mode 100755 index 0000000..0c6b4cf Binary files /dev/null and b/Images/Menus/Buttons/Solo/training.png differ diff --git a/Images/Menus/Buttons/Solo/training_mode.png b/Images/Menus/Buttons/Solo/training_mode.png new file mode 100755 index 0000000..76034e3 Binary files /dev/null and b/Images/Menus/Buttons/Solo/training_mode.png differ diff --git a/Images/Menus/Buttons/Solo/training_selected.png b/Images/Menus/Buttons/Solo/training_selected.png new file mode 100755 index 0000000..5f45b97 Binary files /dev/null and b/Images/Menus/Buttons/Solo/training_selected.png differ diff --git a/Images/Menus/CharacterSelect/cards/cpu.png b/Images/Menus/CharacterSelect/cards/cpu.png new file mode 100755 index 0000000..34ed6d7 Binary files /dev/null and b/Images/Menus/CharacterSelect/cards/cpu.png differ diff --git a/Images/Menus/CharacterSelect/cards/na.png b/Images/Menus/CharacterSelect/cards/na.png new file mode 100755 index 0000000..74657aa Binary files /dev/null and b/Images/Menus/CharacterSelect/cards/na.png differ diff --git a/Images/Menus/CharacterSelect/cards/p1_red.png b/Images/Menus/CharacterSelect/cards/p1_red.png new file mode 100755 index 0000000..49bdd50 Binary files /dev/null and b/Images/Menus/CharacterSelect/cards/p1_red.png differ diff --git a/Images/Menus/CharacterSelect/cards/p2_blue.png b/Images/Menus/CharacterSelect/cards/p2_blue.png new file mode 100755 index 0000000..fce9f65 Binary files /dev/null and b/Images/Menus/CharacterSelect/cards/p2_blue.png differ diff --git a/Images/Menus/CharacterSelect/cards/p3_yellow.png b/Images/Menus/CharacterSelect/cards/p3_yellow.png new file mode 100755 index 0000000..4a67a49 Binary files /dev/null and b/Images/Menus/CharacterSelect/cards/p3_yellow.png differ diff --git a/Images/Menus/CharacterSelect/cards/p4_green.png b/Images/Menus/CharacterSelect/cards/p4_green.png new file mode 100755 index 0000000..a740967 Binary files /dev/null and b/Images/Menus/CharacterSelect/cards/p4_green.png differ diff --git a/Images/Menus/CharacterSelect/coins/coin.png b/Images/Menus/CharacterSelect/coins/coin.png new file mode 100755 index 0000000..4acd893 Binary files /dev/null and b/Images/Menus/CharacterSelect/coins/coin.png differ diff --git a/Images/Menus/CharacterSelect/coins/coin1.png b/Images/Menus/CharacterSelect/coins/coin1.png new file mode 100755 index 0000000..609504d Binary files /dev/null and b/Images/Menus/CharacterSelect/coins/coin1.png differ diff --git a/Images/Menus/CharacterSelect/coins/coin2.png b/Images/Menus/CharacterSelect/coins/coin2.png new file mode 100755 index 0000000..9b67ee5 Binary files /dev/null and b/Images/Menus/CharacterSelect/coins/coin2.png differ diff --git a/Images/Menus/CharacterSelect/coins/coin3.png b/Images/Menus/CharacterSelect/coins/coin3.png new file mode 100755 index 0000000..92cd9eb Binary files /dev/null and b/Images/Menus/CharacterSelect/coins/coin3.png differ diff --git a/Images/Menus/CharacterSelect/coins/coin4.png b/Images/Menus/CharacterSelect/coins/coin4.png new file mode 100755 index 0000000..f877c37 Binary files /dev/null and b/Images/Menus/CharacterSelect/coins/coin4.png differ diff --git a/Images/Menus/CharacterSelect/coins/coin5.png b/Images/Menus/CharacterSelect/coins/coin5.png new file mode 100755 index 0000000..61cf900 Binary files /dev/null and b/Images/Menus/CharacterSelect/coins/coin5.png differ diff --git a/Images/Menus/CharacterSelect/flags/blue.png b/Images/Menus/CharacterSelect/flags/blue.png new file mode 100755 index 0000000..e7d8219 Binary files /dev/null and b/Images/Menus/CharacterSelect/flags/blue.png differ diff --git a/Images/Menus/CharacterSelect/flags/green.png b/Images/Menus/CharacterSelect/flags/green.png new file mode 100755 index 0000000..4fc8ac7 Binary files /dev/null and b/Images/Menus/CharacterSelect/flags/green.png differ diff --git a/Images/Menus/CharacterSelect/flags/red.png b/Images/Menus/CharacterSelect/flags/red.png new file mode 100755 index 0000000..0378266 Binary files /dev/null and b/Images/Menus/CharacterSelect/flags/red.png differ diff --git a/Images/Menus/CharacterSelect/icons/bowser.png b/Images/Menus/CharacterSelect/icons/bowser.png new file mode 100755 index 0000000..722a5a0 Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/bowser.png differ diff --git a/Images/Menus/CharacterSelect/icons/fox.png b/Images/Menus/CharacterSelect/icons/fox.png new file mode 100755 index 0000000..1bd9487 Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/fox.png differ diff --git a/Images/Menus/CharacterSelect/icons/ichigo.png b/Images/Menus/CharacterSelect/icons/ichigo.png new file mode 100755 index 0000000..38c730f Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/ichigo.png differ diff --git a/Images/Menus/CharacterSelect/icons/mario.png b/Images/Menus/CharacterSelect/icons/mario.png new file mode 100755 index 0000000..1f56b70 Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/mario.png differ diff --git a/Images/Menus/CharacterSelect/icons/pikachu.png b/Images/Menus/CharacterSelect/icons/pikachu.png new file mode 100755 index 0000000..d875ccf Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/pikachu.png differ diff --git a/Images/Menus/CharacterSelect/icons/random.png b/Images/Menus/CharacterSelect/icons/random.png new file mode 100755 index 0000000..8923215 Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/random.png differ diff --git a/Images/Menus/CharacterSelect/icons/sonic.png b/Images/Menus/CharacterSelect/icons/sonic.png new file mode 100755 index 0000000..179f33f Binary files /dev/null and b/Images/Menus/CharacterSelect/icons/sonic.png differ diff --git a/Images/Menus/CharacterSelect/previews/fox.png b/Images/Menus/CharacterSelect/previews/fox.png new file mode 100755 index 0000000..2a3996d Binary files /dev/null and b/Images/Menus/CharacterSelect/previews/fox.png differ diff --git a/Images/Menus/CharacterSelect/previews/ichigo.png b/Images/Menus/CharacterSelect/previews/ichigo.png new file mode 100755 index 0000000..9ef6383 Binary files /dev/null and b/Images/Menus/CharacterSelect/previews/ichigo.png differ diff --git a/Images/Menus/CharacterSelect/previews/mario.png b/Images/Menus/CharacterSelect/previews/mario.png new file mode 100755 index 0000000..2ffc50c Binary files /dev/null and b/Images/Menus/CharacterSelect/previews/mario.png differ diff --git a/Images/Menus/CharacterSelect/previews/pikachu.png b/Images/Menus/CharacterSelect/previews/pikachu.png new file mode 100755 index 0000000..6d27777 Binary files /dev/null and b/Images/Menus/CharacterSelect/previews/pikachu.png differ diff --git a/Images/Menus/CharacterSelect/previews/random.png b/Images/Menus/CharacterSelect/previews/random.png new file mode 100755 index 0000000..0fe940e Binary files /dev/null and b/Images/Menus/CharacterSelect/previews/random.png differ diff --git a/Images/Menus/CharacterSelect/previews/sonic.png b/Images/Menus/CharacterSelect/previews/sonic.png new file mode 100755 index 0000000..78fac38 Binary files /dev/null and b/Images/Menus/CharacterSelect/previews/sonic.png differ diff --git a/Images/Menus/Rules/Items/beamsword.png b/Images/Menus/Rules/Items/beamsword.png new file mode 100755 index 0000000..4d4de4c Binary files /dev/null and b/Images/Menus/Rules/Items/beamsword.png differ diff --git a/Images/Menus/Rules/Items/heart_container.png b/Images/Menus/Rules/Items/heart_container.png new file mode 100755 index 0000000..805de49 Binary files /dev/null and b/Images/Menus/Rules/Items/heart_container.png differ diff --git a/Images/Menus/Rules/Items/mushroom.png b/Images/Menus/Rules/Items/mushroom.png new file mode 100755 index 0000000..da0476b Binary files /dev/null and b/Images/Menus/Rules/Items/mushroom.png differ diff --git a/Images/Menus/Rules/Items/poison_mushroom.png b/Images/Menus/Rules/Items/poison_mushroom.png new file mode 100755 index 0000000..a6fbff5 Binary files /dev/null and b/Images/Menus/Rules/Items/poison_mushroom.png differ diff --git a/Images/Menus/Rules/Items/raygun.png b/Images/Menus/Rules/Items/raygun.png new file mode 100755 index 0000000..d1407aa Binary files /dev/null and b/Images/Menus/Rules/Items/raygun.png differ diff --git a/Images/Menus/Rules/Items/smashball.png b/Images/Menus/Rules/Items/smashball.png new file mode 100755 index 0000000..6dd6a8a Binary files /dev/null and b/Images/Menus/Rules/Items/smashball.png differ diff --git a/Images/Menus/Rules/Items/toggle_off.png b/Images/Menus/Rules/Items/toggle_off.png new file mode 100755 index 0000000..0f07d77 Binary files /dev/null and b/Images/Menus/Rules/Items/toggle_off.png differ diff --git a/Images/Menus/Rules/Items/toggle_on.png b/Images/Menus/Rules/Items/toggle_on.png new file mode 100755 index 0000000..f493bd7 Binary files /dev/null and b/Images/Menus/Rules/Items/toggle_on.png differ diff --git a/Images/Menus/StageSelect/battlefield.png b/Images/Menus/StageSelect/battlefield.png new file mode 100755 index 0000000..1bc994f Binary files /dev/null and b/Images/Menus/StageSelect/battlefield.png differ diff --git a/Images/Menus/StageSelect/final_destination.png b/Images/Menus/StageSelect/final_destination.png new file mode 100755 index 0000000..6eadb8a Binary files /dev/null and b/Images/Menus/StageSelect/final_destination.png differ diff --git a/Images/Menus/StageSelect/greatbay.png b/Images/Menus/StageSelect/greatbay.png new file mode 100755 index 0000000..9fb9a10 Binary files /dev/null and b/Images/Menus/StageSelect/greatbay.png differ diff --git a/Images/Menus/StageSelect/hillside_battleground.png b/Images/Menus/StageSelect/hillside_battleground.png new file mode 100755 index 0000000..aed1fe5 Binary files /dev/null and b/Images/Menus/StageSelect/hillside_battleground.png differ diff --git a/Images/Menus/StageSelect/hyruletemple.png b/Images/Menus/StageSelect/hyruletemple.png new file mode 100755 index 0000000..e0e6cd3 Binary files /dev/null and b/Images/Menus/StageSelect/hyruletemple.png differ diff --git a/Images/Menus/StageSelect/test.png b/Images/Menus/StageSelect/test.png new file mode 100755 index 0000000..d900e75 Binary files /dev/null and b/Images/Menus/StageSelect/test.png differ diff --git a/Images/Menus/titlescreen.png b/Images/Menus/titlescreen.png new file mode 100755 index 0000000..ce072c2 Binary files /dev/null and b/Images/Menus/titlescreen.png differ diff --git a/Images/icon.png b/Images/icon.png new file mode 100755 index 0000000..71b7245 Binary files /dev/null and b/Images/icon.png differ diff --git a/Images/icon_15x15.png b/Images/icon_15x15.png new file mode 100755 index 0000000..cf57604 Binary files /dev/null and b/Images/icon_15x15.png differ diff --git a/Images/icon_large.png b/Images/icon_large.png new file mode 100755 index 0000000..4d0490e Binary files /dev/null and b/Images/icon_large.png differ diff --git a/Images/loading.png b/Images/loading.png new file mode 100755 index 0000000..d72a57b Binary files /dev/null and b/Images/loading.png differ diff --git a/Images/splash.png b/Images/splash.png new file mode 100755 index 0000000..7ea3c5c Binary files /dev/null and b/Images/splash.png differ diff --git a/Info.plist b/Info.plist new file mode 100644 index 0000000..b8089dc --- /dev/null +++ b/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + Icon + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + + diff --git a/Music/Legend of Zelda/Main Theme Remix.ogg b/Music/Legend of Zelda/Main Theme Remix.ogg new file mode 100644 index 0000000..8776933 Binary files /dev/null and b/Music/Legend of Zelda/Main Theme Remix.ogg differ diff --git a/Music/Legend of Zelda/Main Theme.ogg b/Music/Legend of Zelda/Main Theme.ogg new file mode 100644 index 0000000..63caf04 Binary files /dev/null and b/Music/Legend of Zelda/Main Theme.ogg differ diff --git a/Music/Smash Bros Brawl/Battlefield v2.ogg b/Music/Smash Bros Brawl/Battlefield v2.ogg new file mode 100644 index 0000000..069858a Binary files /dev/null and b/Music/Smash Bros Brawl/Battlefield v2.ogg differ diff --git a/Music/Smash Bros Brawl/Final Destination.ogg b/Music/Smash Bros Brawl/Final Destination.ogg new file mode 100644 index 0000000..54c18d5 Binary files /dev/null and b/Music/Smash Bros Brawl/Final Destination.ogg differ diff --git a/Music/Smash Bros Brawl/Main Theme Remix.ogg b/Music/Smash Bros Brawl/Main Theme Remix.ogg new file mode 100644 index 0000000..00ebad1 Binary files /dev/null and b/Music/Smash Bros Brawl/Main Theme Remix.ogg differ diff --git a/Music/Smash Bros Brawl/Main Theme.ogg b/Music/Smash Bros Brawl/Main Theme.ogg new file mode 100644 index 0000000..97908bd Binary files /dev/null and b/Music/Smash Bros Brawl/Main Theme.ogg differ diff --git a/Music/Smash Bros Brawl/Menu Theme.ogg b/Music/Smash Bros Brawl/Menu Theme.ogg new file mode 100644 index 0000000..7bbe77f Binary files /dev/null and b/Music/Smash Bros Brawl/Menu Theme.ogg differ diff --git a/SDL/include/SDL.h b/SDL/include/SDL.h new file mode 100644 index 0000000..c0c067c --- /dev/null +++ b/SDL/include/SDL.h @@ -0,0 +1,163 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL.h + * + * Main include header for the SDL library + */ + +/** + * \mainpage Simple DirectMedia Layer (SDL) + * + * http://www.libsdl.org/ + * + * \section intro_sec Introduction + * + * Simple DirectMedia Layer is a cross-platform development library designed + * to provide low level access to audio, keyboard, mouse, joystick, and + * graphics hardware via OpenGL and Direct3D. It is used by video playback + * software, emulators, and popular games including Valve's award winning + * catalog and many Humble Bundle games. + * + * SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. + * Support for other platforms may be found in the source code. + * + * SDL is written in C, works natively with C++, and there are bindings + * available for several other languages, including C# and Python. + * + * This library is distributed under the zlib license, which can be found + * in the file "COPYING.txt". + * + * The best way to learn how to use SDL is to check out the header files in + * the "include" subdirectory and the programs in the "test" subdirectory. + * The header files and test programs are well commented and always up to date. + * More documentation and FAQs are available online at: + * http://wiki.libsdl.org/ + * + * If you need help with the library, or just want to discuss SDL related + * issues, you can join the developers mailing list: + * http://www.libsdl.org/mailing-list.php + * + * Enjoy! + * Sam Lantinga (slouken@libsdl.org) + */ + +#ifndef _SDL_H +#define _SDL_H + +#include "SDL_main.h" +#include "SDL_stdinc.h" +#include "SDL_assert.h" +#include "SDL_atomic.h" +#include "SDL_audio.h" +#include "SDL_clipboard.h" +#include "SDL_cpuinfo.h" +#include "SDL_endian.h" +#include "SDL_error.h" +#include "SDL_events.h" +#include "SDL_filesystem.h" +#include "SDL_joystick.h" +#include "SDL_gamecontroller.h" +#include "SDL_haptic.h" +#include "SDL_hints.h" +#include "SDL_loadso.h" +#include "SDL_log.h" +#include "SDL_messagebox.h" +#include "SDL_mutex.h" +#include "SDL_power.h" +#include "SDL_render.h" +#include "SDL_rwops.h" +#include "SDL_system.h" +#include "SDL_thread.h" +#include "SDL_timer.h" +#include "SDL_version.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* As of version 0.5, SDL is loaded dynamically into the application */ + +/** + * \name SDL_INIT_* + * + * These are the flags which may be passed to SDL_Init(). You should + * specify the subsystems which you will be using in your application. + */ +/* @{ */ +#define SDL_INIT_TIMER 0x00000001 +#define SDL_INIT_AUDIO 0x00000010 +#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ +#define SDL_INIT_JOYSTICK 0x00000200 /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ +#define SDL_INIT_HAPTIC 0x00001000 +#define SDL_INIT_GAMECONTROLLER 0x00002000 /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ +#define SDL_INIT_EVENTS 0x00004000 +#define SDL_INIT_NOPARACHUTE 0x00100000 /**< Don't catch fatal signals */ +#define SDL_INIT_EVERYTHING ( \ + SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ + SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \ + ) +/* @} */ + +/** + * This function initializes the subsystems specified by \c flags + * Unless the ::SDL_INIT_NOPARACHUTE flag is set, it will install cleanup + * signal handlers for some commonly ignored fatal signals (like SIGSEGV). + */ +extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); + +/** + * This function initializes specific SDL subsystems + */ +extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); + +/** + * This function cleans up specific SDL subsystems + */ +extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); + +/** + * This function returns a mask of the specified subsystems which have + * previously been initialized. + * + * If \c flags is 0, it returns a mask of all initialized subsystems. + */ +extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); + +/** + * This function cleans up all initialized subsystems. You should + * call it upon all exit conditions. + */ +extern DECLSPEC void SDLCALL SDL_Quit(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_H */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_assert.h b/SDL/include/SDL_assert.h new file mode 100644 index 0000000..4329434 --- /dev/null +++ b/SDL/include/SDL_assert.h @@ -0,0 +1,246 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_assert_h +#define _SDL_assert_h + +#include "SDL_config.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef SDL_ASSERT_LEVEL +#ifdef SDL_DEFAULT_ASSERT_LEVEL +#define SDL_ASSERT_LEVEL SDL_DEFAULT_ASSERT_LEVEL +#elif defined(_DEBUG) || defined(DEBUG) || \ + (defined(__GNUC__) && !defined(__OPTIMIZE__)) +#define SDL_ASSERT_LEVEL 2 +#else +#define SDL_ASSERT_LEVEL 1 +#endif +#endif /* SDL_ASSERT_LEVEL */ + +/* +These are macros and not first class functions so that the debugger breaks +on the assertion line and not in some random guts of SDL, and so each +assert can have unique static variables associated with it. +*/ + +#if defined(_MSC_VER) +/* Don't include intrin.h here because it contains C++ code */ + extern void __cdecl __debugbreak(void); + #define SDL_TriggerBreakpoint() __debugbreak() +#elif (defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))) + #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" ) +#elif defined(HAVE_SIGNAL_H) + #include + #define SDL_TriggerBreakpoint() raise(SIGTRAP) +#else + /* How do we trigger breakpoints on this platform? */ + #define SDL_TriggerBreakpoint() +#endif + +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 supports __func__ as a standard. */ +# define SDL_FUNCTION __func__ +#elif ((__GNUC__ >= 2) || defined(_MSC_VER)) +# define SDL_FUNCTION __FUNCTION__ +#else +# define SDL_FUNCTION "???" +#endif +#define SDL_FILE __FILE__ +#define SDL_LINE __LINE__ + +/* +sizeof (x) makes the compiler still parse the expression even without +assertions enabled, so the code is always checked at compile time, but +doesn't actually generate code for it, so there are no side effects or +expensive checks at run time, just the constant size of what x WOULD be, +which presumably gets optimized out as unused. +This also solves the problem of... + + int somevalue = blah(); + SDL_assert(somevalue == 1); + +...which would cause compiles to complain that somevalue is unused if we +disable assertions. +*/ + +#ifdef _MSC_VER /* stupid /W4 warnings. */ +#define SDL_NULL_WHILE_LOOP_CONDITION (-1 == __LINE__) +#else +#define SDL_NULL_WHILE_LOOP_CONDITION (0) +#endif + +#define SDL_disabled_assert(condition) \ + do { (void) sizeof ((condition)); } while (SDL_NULL_WHILE_LOOP_CONDITION) + +typedef enum +{ + SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */ + SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */ + SDL_ASSERTION_ABORT, /**< Terminate the program. */ + SDL_ASSERTION_IGNORE, /**< Ignore the assert. */ + SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */ +} SDL_assert_state; + +typedef struct SDL_assert_data +{ + int always_ignore; + unsigned int trigger_count; + const char *condition; + const char *filename; + int linenum; + const char *function; + const struct SDL_assert_data *next; +} SDL_assert_data; + +#if (SDL_ASSERT_LEVEL > 0) + +/* Never call this directly. Use the SDL_assert* macros. */ +extern DECLSPEC SDL_assert_state SDLCALL SDL_ReportAssertion(SDL_assert_data *, + const char *, + const char *, int); + +/* the do {} while(0) avoids dangling else problems: + if (x) SDL_assert(y); else blah(); + ... without the do/while, the "else" could attach to this macro's "if". + We try to handle just the minimum we need here in a macro...the loop, + the static vars, and break points. The heavy lifting is handled in + SDL_ReportAssertion(), in SDL_assert.c. +*/ +#define SDL_enabled_assert(condition) \ + do { \ + while ( !(condition) ) { \ + static struct SDL_assert_data assert_data = { \ + 0, 0, #condition, 0, 0, 0, 0 \ + }; \ + const SDL_assert_state state = SDL_ReportAssertion(&assert_data, \ + SDL_FUNCTION, \ + SDL_FILE, \ + SDL_LINE); \ + if (state == SDL_ASSERTION_RETRY) { \ + continue; /* go again. */ \ + } else if (state == SDL_ASSERTION_BREAK) { \ + SDL_TriggerBreakpoint(); \ + } \ + break; /* not retrying. */ \ + } \ + } while (SDL_NULL_WHILE_LOOP_CONDITION) + +#endif /* enabled assertions support code */ + +/* Enable various levels of assertions. */ +#if SDL_ASSERT_LEVEL == 0 /* assertions disabled */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_disabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 1 /* release settings. */ +# define SDL_assert(condition) SDL_disabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 2 /* normal settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_disabled_assert(condition) +#elif SDL_ASSERT_LEVEL == 3 /* paranoid settings. */ +# define SDL_assert(condition) SDL_enabled_assert(condition) +# define SDL_assert_release(condition) SDL_enabled_assert(condition) +# define SDL_assert_paranoid(condition) SDL_enabled_assert(condition) +#else +# error Unknown assertion level. +#endif + +/* this assertion is never disabled at any level. */ +#define SDL_assert_always(condition) SDL_enabled_assert(condition) + + +typedef SDL_assert_state (SDLCALL *SDL_AssertionHandler)( + const SDL_assert_data* data, void* userdata); + +/** + * \brief Set an application-defined assertion handler. + * + * This allows an app to show its own assertion UI and/or force the + * response to an assertion failure. If the app doesn't provide this, SDL + * will try to do the right thing, popping up a system-specific GUI dialog, + * and probably minimizing any fullscreen windows. + * + * This callback may fire from any thread, but it runs wrapped in a mutex, so + * it will only fire from one thread at a time. + * + * Setting the callback to NULL restores SDL's original internal handler. + * + * This callback is NOT reset to SDL's internal handler upon SDL_Quit()! + * + * \return SDL_assert_state value of how to handle the assertion failure. + * + * \param handler Callback function, called when an assertion fails. + * \param userdata A pointer passed to the callback as-is. + */ +extern DECLSPEC void SDLCALL SDL_SetAssertionHandler( + SDL_AssertionHandler handler, + void *userdata); + +/** + * \brief Get a list of all assertion failures. + * + * Get all assertions triggered since last call to SDL_ResetAssertionReport(), + * or the start of the program. + * + * The proper way to examine this data looks something like this: + * + * + * const SDL_assert_data *item = SDL_GetAssertionReport(); + * while (item) { + * printf("'%s', %s (%s:%d), triggered %u times, always ignore: %s.\n", + * item->condition, item->function, item->filename, + * item->linenum, item->trigger_count, + * item->always_ignore ? "yes" : "no"); + * item = item->next; + * } + * + * + * \return List of all assertions. + * \sa SDL_ResetAssertionReport + */ +extern DECLSPEC const SDL_assert_data * SDLCALL SDL_GetAssertionReport(void); + +/** + * \brief Reset the list of all assertion failures. + * + * Reset list of all assertions triggered. + * + * \sa SDL_GetAssertionReport + */ +extern DECLSPEC void SDLCALL SDL_ResetAssertionReport(void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_assert_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_atomic.h b/SDL/include/SDL_atomic.h new file mode 100644 index 0000000..48b0053 --- /dev/null +++ b/SDL/include/SDL_atomic.h @@ -0,0 +1,359 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_atomic.h + * + * Atomic operations. + * + * IMPORTANT: + * If you are not an expert in concurrent lockless programming, you should + * only be using the atomic lock and reference counting functions in this + * file. In all other cases you should be protecting your data structures + * with full mutexes. + * + * The list of "safe" functions to use are: + * SDL_AtomicLock() + * SDL_AtomicUnlock() + * SDL_AtomicIncRef() + * SDL_AtomicDecRef() + * + * Seriously, here be dragons! + * ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + * + * You can find out a little more about lockless programming and the + * subtle issues that can arise here: + * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx + * + * There's also lots of good information here: + * http://www.1024cores.net/home/lock-free-algorithms + * http://preshing.com/ + * + * These operations may or may not actually be implemented using + * processor specific atomic operations. When possible they are + * implemented as true processor specific atomic operations. When that + * is not possible the are implemented using locks that *do* use the + * available atomic operations. + * + * All of the atomic operations that modify memory are full memory barriers. + */ + +#ifndef _SDL_atomic_h_ +#define _SDL_atomic_h_ + +#include "SDL_stdinc.h" +#include "SDL_platform.h" + +#include "begin_code.h" + +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) +#include +#define HAVE_MSC_ATOMICS 1 +#endif + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name SDL AtomicLock + * + * The atomic locks are efficient spinlocks using CPU instructions, + * but are vulnerable to starvation and can spin forever if a thread + * holding a lock has been terminated. For this reason you should + * minimize the code executed inside an atomic lock and never do + * expensive things like API or system calls while holding them. + * + * The atomic locks are not safe to lock recursively. + * + * Porting Note: + * The spin lock functions and type are required and can not be + * emulated because they are used in the atomic emulation code. + */ +/* @{ */ + +typedef int SDL_SpinLock; + +/** + * \brief Try to lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + * + * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock); + +/** + * \brief Lock a spin lock by setting it to a non-zero value. + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock); + +/** + * \brief Unlock a spin lock by setting it to 0. Always returns immediately + * + * \param lock Points to the lock. + */ +extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock); + +/* @} *//* SDL AtomicLock */ + + +/** + * The compiler barrier prevents the compiler from reordering + * reads and writes to globally visible variables across the call. + */ +#if defined(_MSC_VER) && (_MSC_VER > 1200) +void _ReadWriteBarrier(void); +#pragma intrinsic(_ReadWriteBarrier) +#define SDL_CompilerBarrier() _ReadWriteBarrier() +#elif defined(__GNUC__) +#define SDL_CompilerBarrier() __asm__ __volatile__ ("" : : : "memory") +#else +#define SDL_CompilerBarrier() \ +{ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); } +#endif + +/** + * Memory barriers are designed to prevent reads and writes from being + * reordered by the compiler and being seen out of order on multi-core CPUs. + * + * A typical pattern would be for thread A to write some data and a flag, + * and for thread B to read the flag and get the data. In this case you + * would insert a release barrier between writing the data and the flag, + * guaranteeing that the data write completes no later than the flag is + * written, and you would insert an acquire barrier between reading the + * flag and reading the data, to ensure that all the reads associated + * with the flag have completed. + * + * In this pattern you should always see a release barrier paired with + * an acquire barrier and you should gate the data reads/writes with a + * single flag variable. + * + * For more information on these semantics, take a look at the blog post: + * http://preshing.com/20120913/acquire-and-release-semantics + */ +#if defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("lwsync" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("lwsync" : : : "memory") +#elif defined(__GNUC__) && defined(__arm__) +#if defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("dmb ish" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("dmb ish" : : : "memory") +#elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6T2__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) +#ifdef __thumb__ +/* The mcr instruction isn't available in thumb mode, use real functions */ +extern DECLSPEC void SDLCALL SDL_MemoryBarrierRelease(); +extern DECLSPEC void SDLCALL SDL_MemoryBarrierAcquire(); +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("mcr p15, 0, %0, c7, c10, 5" : : "r"(0) : "memory") +#endif /* __thumb__ */ +#else +#define SDL_MemoryBarrierRelease() __asm__ __volatile__ ("" : : : "memory") +#define SDL_MemoryBarrierAcquire() __asm__ __volatile__ ("" : : : "memory") +#endif /* __GNUC__ && __arm__ */ +#else +/* This is correct for the x86 and x64 CPUs, and we'll expand this over time. */ +#define SDL_MemoryBarrierRelease() SDL_CompilerBarrier() +#define SDL_MemoryBarrierAcquire() SDL_CompilerBarrier() +#endif + + +/* Platform specific optimized versions of the atomic functions, + * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE + */ +#if defined(SDL_ATOMIC_DISABLED) && SDL_ATOMIC_DISABLED +#define SDL_DISABLE_ATOMIC_INLINE +#endif +#ifndef SDL_DISABLE_ATOMIC_INLINE + +#ifdef HAVE_MSC_ATOMICS + +#define SDL_AtomicSet(a, v) _InterlockedExchange((long*)&(a)->value, (v)) +#define SDL_AtomicAdd(a, v) _InterlockedExchangeAdd((long*)&(a)->value, (v)) +#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval)) +#define SDL_AtomicSetPtr(a, v) _InterlockedExchangePointer((a), (v)) +#if _M_IX86 +#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval)) +#else +#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchangePointer((a), (newval), (oldval)) == (oldval)) +#endif + +#elif defined(__MACOSX__) +#include + +#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value) +#ifdef __LP64__ +#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a)) +#else +#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a)) +#endif + +#elif defined(HAVE_GCC_ATOMICS) + +#define SDL_AtomicSet(a, v) __sync_lock_test_and_set(&(a)->value, v) +#define SDL_AtomicAdd(a, v) __sync_fetch_and_add(&(a)->value, v) +#define SDL_AtomicSetPtr(a, v) __sync_lock_test_and_set(a, v) +#define SDL_AtomicCAS(a, oldval, newval) __sync_bool_compare_and_swap(&(a)->value, oldval, newval) +#define SDL_AtomicCASPtr(a, oldval, newval) __sync_bool_compare_and_swap(a, oldval, newval) + +#endif + +#endif /* !SDL_DISABLE_ATOMIC_INLINE */ + + +/** + * \brief A type representing an atomic integer value. It is a struct + * so people don't accidentally use numeric operations on it. + */ +#ifndef SDL_atomic_t_defined +typedef struct { int value; } SDL_atomic_t; +#endif + +/** + * \brief Set an atomic variable to a new value if it is currently an old value. + * + * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +#ifndef SDL_AtomicCAS +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval); +#endif + +/** + * \brief Set an atomic variable to a value. + * + * \return The previous value of the atomic variable. + */ +#ifndef SDL_AtomicSet +SDL_FORCE_INLINE int SDL_AtomicSet(SDL_atomic_t *a, int v) +{ + int value; + do { + value = a->value; + } while (!SDL_AtomicCAS(a, value, v)); + return value; +} +#endif + +/** + * \brief Get the value of an atomic variable + */ +#ifndef SDL_AtomicGet +SDL_FORCE_INLINE int SDL_AtomicGet(SDL_atomic_t *a) +{ + int value = a->value; + SDL_CompilerBarrier(); + return value; +} +#endif + +/** + * \brief Add to an atomic variable. + * + * \return The previous value of the atomic variable. + * + * \note This same style can be used for any number operation + */ +#ifndef SDL_AtomicAdd +SDL_FORCE_INLINE int SDL_AtomicAdd(SDL_atomic_t *a, int v) +{ + int value; + do { + value = a->value; + } while (!SDL_AtomicCAS(a, value, (value + v))); + return value; +} +#endif + +/** + * \brief Increment an atomic variable used as a reference count. + */ +#ifndef SDL_AtomicIncRef +#define SDL_AtomicIncRef(a) SDL_AtomicAdd(a, 1) +#endif + +/** + * \brief Decrement an atomic variable used as a reference count. + * + * \return SDL_TRUE if the variable reached zero after decrementing, + * SDL_FALSE otherwise + */ +#ifndef SDL_AtomicDecRef +#define SDL_AtomicDecRef(a) (SDL_AtomicAdd(a, -1) == 1) +#endif + +/** + * \brief Set a pointer to a new value if it is currently an old value. + * + * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise. + * + * \note If you don't know what this function is for, you shouldn't use it! +*/ +#ifndef SDL_AtomicCASPtr +extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr(void* *a, void *oldval, void *newval); +#endif + +/** + * \brief Set a pointer to a value atomically. + * + * \return The previous value of the pointer. + */ +#ifndef SDL_AtomicSetPtr +SDL_FORCE_INLINE void* SDL_AtomicSetPtr(void* *a, void* v) +{ + void* value; + do { + value = *a; + } while (!SDL_AtomicCASPtr(a, value, v)); + return value; +} +#endif + +/** + * \brief Get the value of a pointer atomically. + */ +#ifndef SDL_AtomicGetPtr +SDL_FORCE_INLINE void* SDL_AtomicGetPtr(void* *a) +{ + void* value = *a; + SDL_CompilerBarrier(); + return value; +} +#endif + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif + +#include "close_code.h" + +#endif /* _SDL_atomic_h_ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_audio.h b/SDL/include/SDL_audio.h new file mode 100644 index 0000000..b9da236 --- /dev/null +++ b/SDL/include/SDL_audio.h @@ -0,0 +1,506 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_audio.h + * + * Access to the raw audio mixing buffer for the SDL library. + */ + +#ifndef _SDL_audio_h +#define _SDL_audio_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_endian.h" +#include "SDL_mutex.h" +#include "SDL_thread.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Audio format flags. + * + * These are what the 16 bits in SDL_AudioFormat currently mean... + * (Unspecified bits are always zero). + * + * \verbatim + ++-----------------------sample is signed if set + || + || ++-----------sample is bigendian if set + || || + || || ++---sample is float if set + || || || + || || || +---sample bit size---+ + || || || | | + 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 + \endverbatim + * + * There are macros in SDL 2.0 and later to query these bits. + */ +typedef Uint16 SDL_AudioFormat; + +/** + * \name Audio flags + */ +/* @{ */ + +#define SDL_AUDIO_MASK_BITSIZE (0xFF) +#define SDL_AUDIO_MASK_DATATYPE (1<<8) +#define SDL_AUDIO_MASK_ENDIAN (1<<12) +#define SDL_AUDIO_MASK_SIGNED (1<<15) +#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE) +#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE) +#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN) +#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED) +#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x)) +#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x)) +#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x)) + +/** + * \name Audio format flags + * + * Defaults to LSB byte order. + */ +/* @{ */ +#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */ +#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */ +#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */ +#define AUDIO_S16LSB 0x8010 /**< Signed 16-bit samples */ +#define AUDIO_U16MSB 0x1010 /**< As above, but big-endian byte order */ +#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */ +#define AUDIO_U16 AUDIO_U16LSB +#define AUDIO_S16 AUDIO_S16LSB +/* @} */ + +/** + * \name int32 support + */ +/* @{ */ +#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */ +#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */ +#define AUDIO_S32 AUDIO_S32LSB +/* @} */ + +/** + * \name float32 support + */ +/* @{ */ +#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */ +#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */ +#define AUDIO_F32 AUDIO_F32LSB +/* @} */ + +/** + * \name Native audio byte ordering + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define AUDIO_U16SYS AUDIO_U16LSB +#define AUDIO_S16SYS AUDIO_S16LSB +#define AUDIO_S32SYS AUDIO_S32LSB +#define AUDIO_F32SYS AUDIO_F32LSB +#else +#define AUDIO_U16SYS AUDIO_U16MSB +#define AUDIO_S16SYS AUDIO_S16MSB +#define AUDIO_S32SYS AUDIO_S32MSB +#define AUDIO_F32SYS AUDIO_F32MSB +#endif +/* @} */ + +/** + * \name Allow change flags + * + * Which audio format changes are allowed when opening a device. + */ +/* @{ */ +#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001 +#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002 +#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004 +#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE) +/* @} */ + +/* @} *//* Audio flags */ + +/** + * This function is called when the audio device needs more data. + * + * \param userdata An application-specific parameter saved in + * the SDL_AudioSpec structure + * \param stream A pointer to the audio data buffer. + * \param len The length of that buffer in bytes. + * + * Once the callback returns, the buffer will no longer be valid. + * Stereo samples are stored in a LRLRLR ordering. + */ +typedef void (SDLCALL * SDL_AudioCallback) (void *userdata, Uint8 * stream, + int len); + +/** + * The calculated values in this structure are calculated by SDL_OpenAudio(). + */ +typedef struct SDL_AudioSpec +{ + int freq; /**< DSP frequency -- samples per second */ + SDL_AudioFormat format; /**< Audio data format */ + Uint8 channels; /**< Number of channels: 1 mono, 2 stereo */ + Uint8 silence; /**< Audio buffer silence value (calculated) */ + Uint16 samples; /**< Audio buffer size in samples (power of 2) */ + Uint16 padding; /**< Necessary for some compile environments */ + Uint32 size; /**< Audio buffer size in bytes (calculated) */ + SDL_AudioCallback callback; + void *userdata; +} SDL_AudioSpec; + + +struct SDL_AudioCVT; +typedef void (SDLCALL * SDL_AudioFilter) (struct SDL_AudioCVT * cvt, + SDL_AudioFormat format); + +/** + * A structure to hold a set of audio conversion filters and buffers. + */ +#ifdef __GNUC__ +/* This structure is 84 bytes on 32-bit architectures, make sure GCC doesn't + pad it out to 88 bytes to guarantee ABI compatibility between compilers. + vvv + The next time we rev the ABI, make sure to size the ints and add padding. +*/ +#define SDL_AUDIOCVT_PACKED __attribute__((packed)) +#else +#define SDL_AUDIOCVT_PACKED +#endif +/* */ +typedef struct SDL_AudioCVT +{ + int needed; /**< Set to 1 if conversion possible */ + SDL_AudioFormat src_format; /**< Source audio format */ + SDL_AudioFormat dst_format; /**< Target audio format */ + double rate_incr; /**< Rate conversion increment */ + Uint8 *buf; /**< Buffer to hold entire audio data */ + int len; /**< Length of original audio buffer */ + int len_cvt; /**< Length of converted audio buffer */ + int len_mult; /**< buffer must be len*len_mult big */ + double len_ratio; /**< Given len, final size is len*len_ratio */ + SDL_AudioFilter filters[10]; /**< Filter list */ + int filter_index; /**< Current audio conversion function */ +} SDL_AUDIOCVT_PACKED SDL_AudioCVT; + + +/* Function prototypes */ + +/** + * \name Driver discovery functions + * + * These functions return the list of built in audio drivers, in the + * order that they are normally initialized by default. + */ +/* @{ */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); +extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +/* @} */ + +/** + * \name Initialization and cleanup + * + * \internal These functions are used internally, and should not be used unless + * you have a specific need to specify the audio driver you want to + * use. You should normally use SDL_Init() or SDL_InitSubSystem(). + */ +/* @{ */ +extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name); +extern DECLSPEC void SDLCALL SDL_AudioQuit(void); +/* @} */ + +/** + * This function returns the name of the current audio driver, or NULL + * if no driver has been initialized. + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); + +/** + * This function opens the audio device with the desired parameters, and + * returns 0 if successful, placing the actual hardware parameters in the + * structure pointed to by \c obtained. If \c obtained is NULL, the audio + * data passed to the callback function will be guaranteed to be in the + * requested format, and will be automatically converted to the hardware + * audio format if necessary. This function returns -1 if it failed + * to open the audio device, or couldn't set up the audio thread. + * + * When filling in the desired audio spec structure, + * - \c desired->freq should be the desired audio frequency in samples-per- + * second. + * - \c desired->format should be the desired audio format. + * - \c desired->samples is the desired size of the audio buffer, in + * samples. This number should be a power of two, and may be adjusted by + * the audio driver to a value more suitable for the hardware. Good values + * seem to range between 512 and 8096 inclusive, depending on the + * application and CPU speed. Smaller values yield faster response time, + * but can lead to underflow if the application is doing heavy processing + * and cannot fill the audio buffer in time. A stereo sample consists of + * both right and left channels in LR ordering. + * Note that the number of samples is directly related to time by the + * following formula: \code ms = (samples*1000)/freq \endcode + * - \c desired->size is the size in bytes of the audio buffer, and is + * calculated by SDL_OpenAudio(). + * - \c desired->silence is the value used to set the buffer to silence, + * and is calculated by SDL_OpenAudio(). + * - \c desired->callback should be set to a function that will be called + * when the audio device is ready for more data. It is passed a pointer + * to the audio buffer, and the length in bytes of the audio buffer. + * This function usually runs in a separate thread, and so you should + * protect data structures that it accesses by calling SDL_LockAudio() + * and SDL_UnlockAudio() in your code. + * - \c desired->userdata is passed as the first parameter to your callback + * function. + * + * The audio device starts out playing silence when it's opened, and should + * be enabled for playing by calling \c SDL_PauseAudio(0) when you are ready + * for your audio callback function to be called. Since the audio driver + * may modify the requested size of the audio buffer, you should allocate + * any local mixing buffers after you open the audio device. + */ +extern DECLSPEC int SDLCALL SDL_OpenAudio(SDL_AudioSpec * desired, + SDL_AudioSpec * obtained); + +/** + * SDL Audio Device IDs. + * + * A successful call to SDL_OpenAudio() is always device id 1, and legacy + * SDL audio APIs assume you want this device ID. SDL_OpenAudioDevice() calls + * always returns devices >= 2 on success. The legacy calls are good both + * for backwards compatibility and when you don't care about multiple, + * specific, or capture devices. + */ +typedef Uint32 SDL_AudioDeviceID; + +/** + * Get the number of available devices exposed by the current driver. + * Only valid after a successfully initializing the audio subsystem. + * Returns -1 if an explicit list of devices can't be determined; this is + * not an error. For example, if SDL is set up to talk to a remote audio + * server, it can't list every one available on the Internet, but it will + * still allow a specific host to be specified to SDL_OpenAudioDevice(). + * + * In many common cases, when this function returns a value <= 0, it can still + * successfully open the default device (NULL for first argument of + * SDL_OpenAudioDevice()). + */ +extern DECLSPEC int SDLCALL SDL_GetNumAudioDevices(int iscapture); + +/** + * Get the human-readable name of a specific audio device. + * Must be a value between 0 and (number of audio devices-1). + * Only valid after a successfully initializing the audio subsystem. + * The values returned by this function reflect the latest call to + * SDL_GetNumAudioDevices(); recall that function to redetect available + * hardware. + * + * The string returned by this function is UTF-8 encoded, read-only, and + * managed internally. You are not to free it. If you need to keep the + * string for any length of time, you should make your own copy of it, as it + * will be invalid next time any of several other SDL functions is called. + */ +extern DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(int index, + int iscapture); + + +/** + * Open a specific audio device. Passing in a device name of NULL requests + * the most reasonable default (and is equivalent to calling SDL_OpenAudio()). + * + * The device name is a UTF-8 string reported by SDL_GetAudioDeviceName(), but + * some drivers allow arbitrary and driver-specific strings, such as a + * hostname/IP address for a remote audio server, or a filename in the + * diskaudio driver. + * + * \return 0 on error, a valid device ID that is >= 2 on success. + * + * SDL_OpenAudio(), unlike this function, always acts on device ID 1. + */ +extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char + *device, + int iscapture, + const + SDL_AudioSpec * + desired, + SDL_AudioSpec * + obtained, + int + allowed_changes); + + + +/** + * \name Audio state + * + * Get the current audio state. + */ +/* @{ */ +typedef enum +{ + SDL_AUDIO_STOPPED = 0, + SDL_AUDIO_PLAYING, + SDL_AUDIO_PAUSED +} SDL_AudioStatus; +extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void); + +extern DECLSPEC SDL_AudioStatus SDLCALL +SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev); +/* @} *//* Audio State */ + +/** + * \name Pause audio functions + * + * These functions pause and unpause the audio callback processing. + * They should be called with a parameter of 0 after opening the audio + * device to start playing sound. This is so you can safely initialize + * data for your callback function after opening the audio device. + * Silence will be written to the audio device during the pause. + */ +/* @{ */ +extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on); +extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev, + int pause_on); +/* @} *//* Pause audio functions */ + +/** + * This function loads a WAVE from the data source, automatically freeing + * that source if \c freesrc is non-zero. For example, to load a WAVE file, + * you could do: + * \code + * SDL_LoadWAV_RW(SDL_RWFromFile("sample.wav", "rb"), 1, ...); + * \endcode + * + * If this function succeeds, it returns the given SDL_AudioSpec, + * filled with the audio data format of the wave data, and sets + * \c *audio_buf to a malloc()'d buffer containing the audio data, + * and sets \c *audio_len to the length of that audio buffer, in bytes. + * You need to free the audio buffer with SDL_FreeWAV() when you are + * done with it. + * + * This function returns NULL and sets the SDL error message if the + * wave file cannot be opened, uses an unknown data format, or is + * corrupt. Currently raw and MS-ADPCM WAVE files are supported. + */ +extern DECLSPEC SDL_AudioSpec *SDLCALL SDL_LoadWAV_RW(SDL_RWops * src, + int freesrc, + SDL_AudioSpec * spec, + Uint8 ** audio_buf, + Uint32 * audio_len); + +/** + * Loads a WAV from a file. + * Compatibility convenience function. + */ +#define SDL_LoadWAV(file, spec, audio_buf, audio_len) \ + SDL_LoadWAV_RW(SDL_RWFromFile(file, "rb"),1, spec,audio_buf,audio_len) + +/** + * This function frees data previously allocated with SDL_LoadWAV_RW() + */ +extern DECLSPEC void SDLCALL SDL_FreeWAV(Uint8 * audio_buf); + +/** + * This function takes a source format and rate and a destination format + * and rate, and initializes the \c cvt structure with information needed + * by SDL_ConvertAudio() to convert a buffer of audio data from one format + * to the other. + * + * \return -1 if the format conversion is not supported, 0 if there's + * no conversion needed, or 1 if the audio filter is set up. + */ +extern DECLSPEC int SDLCALL SDL_BuildAudioCVT(SDL_AudioCVT * cvt, + SDL_AudioFormat src_format, + Uint8 src_channels, + int src_rate, + SDL_AudioFormat dst_format, + Uint8 dst_channels, + int dst_rate); + +/** + * Once you have initialized the \c cvt structure using SDL_BuildAudioCVT(), + * created an audio buffer \c cvt->buf, and filled it with \c cvt->len bytes of + * audio data in the source format, this function will convert it in-place + * to the desired format. + * + * The data conversion may expand the size of the audio data, so the buffer + * \c cvt->buf should be allocated after the \c cvt structure is initialized by + * SDL_BuildAudioCVT(), and should be \c cvt->len*cvt->len_mult bytes long. + */ +extern DECLSPEC int SDLCALL SDL_ConvertAudio(SDL_AudioCVT * cvt); + +#define SDL_MIX_MAXVOLUME 128 +/** + * This takes two audio buffers of the playing audio format and mixes + * them, performing addition, volume adjustment, and overflow clipping. + * The volume ranges from 0 - 128, and should be set to ::SDL_MIX_MAXVOLUME + * for full audio volume. Note this does not change hardware volume. + * This is provided for convenience -- you can mix your own audio data. + */ +extern DECLSPEC void SDLCALL SDL_MixAudio(Uint8 * dst, const Uint8 * src, + Uint32 len, int volume); + +/** + * This works like SDL_MixAudio(), but you specify the audio format instead of + * using the format of audio device 1. Thus it can be used when no audio + * device is open at all. + */ +extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst, + const Uint8 * src, + SDL_AudioFormat format, + Uint32 len, int volume); + +/** + * \name Audio lock functions + * + * The lock manipulated by these functions protects the callback function. + * During a SDL_LockAudio()/SDL_UnlockAudio() pair, you can be guaranteed that + * the callback function is not running. Do not call these from the callback + * function or you will cause deadlock. + */ +/* @{ */ +extern DECLSPEC void SDLCALL SDL_LockAudio(void); +extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev); +extern DECLSPEC void SDLCALL SDL_UnlockAudio(void); +extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev); +/* @} *//* Audio lock functions */ + +/** + * This function shuts down audio processing and closes the audio device. + */ +extern DECLSPEC void SDLCALL SDL_CloseAudio(void); +extern DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID dev); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_audio_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_bits.h b/SDL/include/SDL_bits.h new file mode 100644 index 0000000..b1ed20b --- /dev/null +++ b/SDL/include/SDL_bits.h @@ -0,0 +1,97 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_bits.h + * + * Functions for fiddling with bits and bitmasks. + */ + +#ifndef _SDL_bits_h +#define _SDL_bits_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_bits.h + */ + +/** + * Get the index of the most significant bit. Result is undefined when called + * with 0. This operation can also be stated as "count leading zeroes" and + * "log base 2". + * + * \return Index of the most significant bit, or -1 if the value is 0. + */ +SDL_FORCE_INLINE int +SDL_MostSignificantBitIndex32(Uint32 x) +{ +#if defined(__GNUC__) && __GNUC__ >= 4 + /* Count Leading Zeroes builtin in GCC. + * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html + */ + if (x == 0) { + return -1; + } + return 31 - __builtin_clz(x); +#else + /* Based off of Bit Twiddling Hacks by Sean Eron Anderson + * , released in the public domain. + * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog + */ + const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; + const int S[] = {1, 2, 4, 8, 16}; + + int msbIndex = 0; + int i; + + if (x == 0) { + return -1; + } + + for (i = 4; i >= 0; i--) + { + if (x & b[i]) + { + x >>= S[i]; + msbIndex |= S[i]; + } + } + + return msbIndex; +#endif +} + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_bits_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_blendmode.h b/SDL/include/SDL_blendmode.h new file mode 100644 index 0000000..85aa474 --- /dev/null +++ b/SDL/include/SDL_blendmode.h @@ -0,0 +1,63 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_blendmode.h + * + * Header file declaring the SDL_BlendMode enumeration + */ + +#ifndef _SDL_blendmode_h +#define _SDL_blendmode_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< no blending + dstRGBA = srcRGBA */ + SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) */ + SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending + dstRGB = (srcRGB * srcA) + dstRGB + dstA = dstA */ + SDL_BLENDMODE_MOD = 0x00000004 /**< color modulate + dstRGB = srcRGB * dstRGB + dstA = dstA */ +} SDL_BlendMode; + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_clipboard.h b/SDL/include/SDL_clipboard.h new file mode 100644 index 0000000..1f5742d --- /dev/null +++ b/SDL/include/SDL_clipboard.h @@ -0,0 +1,71 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_clipboard.h + * + * Include file for SDL clipboard handling + */ + +#ifndef _SDL_clipboard_h +#define _SDL_clipboard_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Put UTF-8 text into the clipboard + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); + +/** + * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() + * + * \sa SDL_SetClipboardText() + */ +extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); + +/** + * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty + * + * \sa SDL_GetClipboardText() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_clipboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_config.h b/SDL/include/SDL_config.h new file mode 100644 index 0000000..7440940 --- /dev/null +++ b/SDL/include/SDL_config.h @@ -0,0 +1,51 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +#include "SDL_platform.h" + +/** + * \file SDL_config.h + */ + +/* Add any platform that doesn't build using the configure system. */ +#if defined(__WIN32__) +#include "SDL_config_windows.h" +#elif defined(__MACOSX__) +#include "SDL_config_macosx.h" +#elif defined(__IPHONEOS__) +#include "SDL_config_iphoneos.h" +#elif defined(__ANDROID__) +#include "SDL_config_android.h" +#elif defined(__PSP__) +#include "SDL_config_psp.h" +#else +/* This is a minimal configuration just to get SDL running on new platforms */ +#include "SDL_config_minimal.h" +#endif /* platform config */ + +#ifdef USING_GENERATED_CONFIG_H +#error Wrong SDL_config.h, check your include path? +#endif + +#endif /* _SDL_config_h */ diff --git a/SDL/include/SDL_config.h.cmake b/SDL/include/SDL_config.h.cmake new file mode 100644 index 0000000..12c14fa --- /dev/null +++ b/SDL/include/SDL_config.h.cmake @@ -0,0 +1,369 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* C language features */ +#cmakedefine const @HAVE_CONST@ +#cmakedefine inline @HAVE_INLINE@ +#cmakedefine volatile @HAVE_VOLATILE@ + +/* C datatypes */ +/* Define SIZEOF_VOIDP for 64/32 architectures */ +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#cmakedefine HAVE_GCC_ATOMICS @HAVE_GCC_ATOMICS@ +#cmakedefine HAVE_GCC_SYNC_LOCK_TEST_AND_SET @HAVE_GCC_SYNC_LOCK_TEST_AND_SET@ +#cmakedefine HAVE_PTHREAD_SPINLOCK @HAVE_PTHREAD_SPINLOCK@ + +/* Comment this if you want to build without any C library requirements */ +#cmakedefine HAVE_LIBC 1 +#if HAVE_LIBC + +/* Useful headers */ +#cmakedefine HAVE_ALLOCA_H 1 +#cmakedefine HAVE_SYS_TYPES_H 1 +#cmakedefine HAVE_STDIO_H 1 +#cmakedefine STDC_HEADERS 1 +#cmakedefine HAVE_STDLIB_H 1 +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_MALLOC_H 1 +#cmakedefine HAVE_MEMORY_H 1 +#cmakedefine HAVE_STRING_H 1 +#cmakedefine HAVE_STRINGS_H 1 +#cmakedefine HAVE_INTTYPES_H 1 +#cmakedefine HAVE_STDINT_H 1 +#cmakedefine HAVE_CTYPE_H 1 +#cmakedefine HAVE_MATH_H 1 +#cmakedefine HAVE_ICONV_H 1 +#cmakedefine HAVE_SIGNAL_H 1 +#cmakedefine HAVE_ALTIVEC_H 1 +#cmakedefine HAVE_PTHREAD_NP_H 1 +#cmakedefine HAVE_LIBUDEV_H 1 +#cmakedefine HAVE_DBUS_DBUS_H 1 + +/* C library functions */ +#cmakedefine HAVE_MALLOC 1 +#cmakedefine HAVE_CALLOC 1 +#cmakedefine HAVE_REALLOC 1 +#cmakedefine HAVE_FREE 1 +#cmakedefine HAVE_ALLOCA 1 +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#cmakedefine HAVE_GETENV 1 +#cmakedefine HAVE_SETENV 1 +#cmakedefine HAVE_PUTENV 1 +#cmakedefine HAVE_UNSETENV 1 +#endif +#cmakedefine HAVE_QSORT 1 +#cmakedefine HAVE_ABS 1 +#cmakedefine HAVE_BCOPY 1 +#cmakedefine HAVE_MEMSET 1 +#cmakedefine HAVE_MEMCPY 1 +#cmakedefine HAVE_MEMMOVE 1 +#cmakedefine HAVE_MEMCMP 1 +#cmakedefine HAVE_STRLEN 1 +#cmakedefine HAVE_STRLCPY 1 +#cmakedefine HAVE_STRLCAT 1 +#cmakedefine HAVE_STRDUP 1 +#cmakedefine HAVE__STRREV 1 +#cmakedefine HAVE__STRUPR 1 +#cmakedefine HAVE__STRLWR 1 +#cmakedefine HAVE_INDEX 1 +#cmakedefine HAVE_RINDEX 1 +#cmakedefine HAVE_STRCHR 1 +#cmakedefine HAVE_STRRCHR 1 +#cmakedefine HAVE_STRSTR 1 +#cmakedefine HAVE_ITOA 1 +#cmakedefine HAVE__LTOA 1 +#cmakedefine HAVE__UITOA 1 +#cmakedefine HAVE__ULTOA 1 +#cmakedefine HAVE_STRTOL 1 +#cmakedefine HAVE_STRTOUL 1 +#cmakedefine HAVE__I64TOA 1 +#cmakedefine HAVE__UI64TOA 1 +#cmakedefine HAVE_STRTOLL 1 +#cmakedefine HAVE_STRTOULL 1 +#cmakedefine HAVE_STRTOD 1 +#cmakedefine HAVE_ATOI 1 +#cmakedefine HAVE_ATOF 1 +#cmakedefine HAVE_STRCMP 1 +#cmakedefine HAVE_STRNCMP 1 +#cmakedefine HAVE__STRICMP 1 +#cmakedefine HAVE_STRCASECMP 1 +#cmakedefine HAVE__STRNICMP 1 +#cmakedefine HAVE_STRNCASECMP 1 +#cmakedefine HAVE_SSCANF 1 +#cmakedefine HAVE_SNPRINTF 1 +#cmakedefine HAVE_VSNPRINTF 1 +#cmakedefine HAVE_M_PI 1 +#cmakedefine HAVE_ATAN 1 +#cmakedefine HAVE_ATAN2 1 +#cmakedefine HAVE_CEIL 1 +#cmakedefine HAVE_COPYSIGN 1 +#cmakedefine HAVE_COS 1 +#cmakedefine HAVE_COSF 1 +#cmakedefine HAVE_FABS 1 +#cmakedefine HAVE_FLOOR 1 +#cmakedefine HAVE_LOG 1 +#cmakedefine HAVE_POW 1 +#cmakedefine HAVE_SCALBN 1 +#cmakedefine HAVE_SIN 1 +#cmakedefine HAVE_SINF 1 +#cmakedefine HAVE_SQRT 1 +#cmakedefine HAVE_FSEEKO 1 +#cmakedefine HAVE_FSEEKO64 1 +#cmakedefine HAVE_SIGACTION 1 +#cmakedefine HAVE_SA_SIGACTION 1 +#cmakedefine HAVE_SETJMP 1 +#cmakedefine HAVE_NANOSLEEP 1 +#cmakedefine HAVE_SYSCONF 1 +#cmakedefine HAVE_SYSCTLBYNAME 1 +#cmakedefine HAVE_CLOCK_GETTIME 1 +#cmakedefine HAVE_GETPAGESIZE 1 +#cmakedefine HAVE_MPROTECT 1 +#cmakedefine HAVE_ICONV 1 +#cmakedefine HAVE_PTHREAD_SETNAME_NP 1 +#cmakedefine HAVE_PTHREAD_SET_NAME_NP 1 +#cmakedefine HAVE_SEM_TIMEDWAIT 1 +#elif __WIN32__ +#cmakedefine HAVE_STDARG_H 1 +#cmakedefine HAVE_STDDEF_H 1 +#else +/* We may need some replacement for stdarg.h here */ +#include +#endif /* HAVE_LIBC */ + +/* SDL internal assertion support */ +#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@ + +/* Allow disabling of core subsystems */ +#cmakedefine SDL_ATOMIC_DISABLED @SDL_ATOMIC_DISABLED@ +#cmakedefine SDL_AUDIO_DISABLED @SDL_AUDIO_DISABLED@ +#cmakedefine SDL_CPUINFO_DISABLED @SDL_CPUINFO_DISABLED@ +#cmakedefine SDL_EVENTS_DISABLED @SDL_EVENTS_DISABLED@ +#cmakedefine SDL_FILE_DISABLED @SDL_FILE_DISABLED@ +#cmakedefine SDL_JOYSTICK_DISABLED @SDL_JOYSTICK_DISABLED@ +#cmakedefine SDL_HAPTIC_DISABLED @SDL_HAPTIC_DISABLED@ +#cmakedefine SDL_LOADSO_DISABLED @SDL_LOADSO_DISABLED@ +#cmakedefine SDL_RENDER_DISABLED @SDL_RENDER_DISABLED@ +#cmakedefine SDL_THREADS_DISABLED @SDL_THREADS_DISABLED@ +#cmakedefine SDL_TIMERS_DISABLED @SDL_TIMERS_DISABLED@ +#cmakedefine SDL_VIDEO_DISABLED @SDL_VIDEO_DISABLED@ +#cmakedefine SDL_POWER_DISABLED @SDL_POWER_DISABLED@ + +/* Enable various audio drivers */ +#cmakedefine SDL_AUDIO_DRIVER_ALSA @SDL_AUDIO_DRIVER_ALSA@ +#cmakedefine SDL_AUDIO_DRIVER_ALSA_DYNAMIC @SDL_AUDIO_DRIVER_ALSA_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS @SDL_AUDIO_DRIVER_ARTS@ +#cmakedefine SDL_AUDIO_DRIVER_ARTS_DYNAMIC @SDL_AUDIO_DRIVER_ARTS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO @SDL_AUDIO_DRIVER_PULSEAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC @SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_BEOSAUDIO @SDL_AUDIO_DRIVER_BEOSAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_BSD @SDL_AUDIO_DRIVER_BSD@ +#cmakedefine SDL_AUDIO_DRIVER_COREAUDIO @SDL_AUDIO_DRIVER_COREAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_DISK @SDL_AUDIO_DRIVER_DISK@ +#cmakedefine SDL_AUDIO_DRIVER_DUMMY @SDL_AUDIO_DRIVER_DUMMY@ +#cmakedefine SDL_AUDIO_DRIVER_XAUDIO2 @SDL_AUDIO_DRIVER_XAUDIO2@ +#cmakedefine SDL_AUDIO_DRIVER_DSOUND @SDL_AUDIO_DRIVER_DSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_ESD @SDL_AUDIO_DRIVER_ESD@ +#cmakedefine SDL_AUDIO_DRIVER_ESD_DYNAMIC @SDL_AUDIO_DRIVER_ESD_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_NAS @SDL_AUDIO_DRIVER_NAS@ +#cmakedefine SDL_AUDIO_DRIVER_NAS_DYNAMIC @SDL_AUDIO_DRIVER_NAS_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO @SDL_AUDIO_DRIVER_SNDIO@ +#cmakedefine SDL_AUDIO_DRIVER_SNDIO_DYNAMIC @SDL_AUDIO_DRIVER_SNDIO_DYNAMIC@ +#cmakedefine SDL_AUDIO_DRIVER_OSS @SDL_AUDIO_DRIVER_OSS@ +#cmakedefine SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H @SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H@ +#cmakedefine SDL_AUDIO_DRIVER_PAUDIO @SDL_AUDIO_DRIVER_PAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_QSA @SDL_AUDIO_DRIVER_QSA@ +#cmakedefine SDL_AUDIO_DRIVER_SUNAUDIO @SDL_AUDIO_DRIVER_SUNAUDIO@ +#cmakedefine SDL_AUDIO_DRIVER_WINMM @SDL_AUDIO_DRIVER_WINMM@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND @SDL_AUDIO_DRIVER_FUSIONSOUND@ +#cmakedefine SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC @SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC@ + +/* Enable various input drivers */ +#cmakedefine SDL_INPUT_LINUXEV @SDL_INPUT_LINUXEV@ +#cmakedefine SDL_INPUT_TSLIB @SDL_INPUT_TSLIB@ +#cmakedefine SDL_JOYSTICK_BEOS @SDL_JOYSTICK_BEOS@ +#cmakedefine SDL_JOYSTICK_DINPUT @SDL_JOYSTICK_DINPUT@ +#cmakedefine SDL_JOYSTICK_DUMMY @SDL_JOYSTICK_DUMMY@ +#cmakedefine SDL_JOYSTICK_IOKIT @SDL_JOYSTICK_IOKIT@ +#cmakedefine SDL_JOYSTICK_LINUX @SDL_JOYSTICK_LINUX@ +#cmakedefine SDL_JOYSTICK_WINMM @SDL_JOYSTICK_WINMM@ +#cmakedefine SDL_JOYSTICK_USBHID @SDL_JOYSTICK_USBHID@ +#cmakedefine SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H @SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H@ +#cmakedefine SDL_HAPTIC_DUMMY @SDL_HAPTIC_DUMMY@ +#cmakedefine SDL_HAPTIC_LINUX @SDL_HAPTIC_LINUX@ +#cmakedefine SDL_HAPTIC_IOKIT @SDL_HAPTIC_IOKIT@ +#cmakedefine SDL_HAPTIC_DINPUT @SDL_HAPTIC_DINPUT@ + +/* Enable various shared object loading systems */ +#cmakedefine SDL_LOADSO_BEOS @SDL_LOADSO_BEOS@ +#cmakedefine SDL_LOADSO_DLOPEN @SDL_LOADSO_DLOPEN@ +#cmakedefine SDL_LOADSO_DUMMY @SDL_LOADSO_DUMMY@ +#cmakedefine SDL_LOADSO_LDG @SDL_LOADSO_LDG@ +#cmakedefine SDL_LOADSO_WINDOWS @SDL_LOADSO_WINDOWS@ + +/* Enable various threading systems */ +#cmakedefine SDL_THREAD_BEOS @SDL_THREAD_BEOS@ +#cmakedefine SDL_THREAD_PTHREAD @SDL_THREAD_PTHREAD@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX@ +#cmakedefine SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP @SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP@ +#cmakedefine SDL_THREAD_WINDOWS @SDL_THREAD_WINDOWS@ + +/* Enable various timer systems */ +#cmakedefine SDL_TIMER_BEOS @SDL_TIMER_BEOS@ +#cmakedefine SDL_TIMER_DUMMY @SDL_TIMER_DUMMY@ +#cmakedefine SDL_TIMER_UNIX @SDL_TIMER_UNIX@ +#cmakedefine SDL_TIMER_WINDOWS @SDL_TIMER_WINDOWS@ +#cmakedefine SDL_TIMER_WINCE @SDL_TIMER_WINCE@ + +/* Enable various video drivers */ +#cmakedefine SDL_VIDEO_DRIVER_BWINDOW @SDL_VIDEO_DRIVER_BWINDOW@ +#cmakedefine SDL_VIDEO_DRIVER_COCOA @SDL_VIDEO_DRIVER_COCOA@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB @SDL_VIDEO_DRIVER_DIRECTFB@ +#cmakedefine SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC @SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_DUMMY @SDL_VIDEO_DRIVER_DUMMY@ +#cmakedefine SDL_VIDEO_DRIVER_WINDOWS @SDL_VIDEO_DRIVER_WINDOWS@ +#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT @SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE @SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINERAMA @SDL_VIDEO_DRIVER_X11_XINERAMA@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2 @SDL_VIDEO_DRIVER_X11_XINPUT2@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH @SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XRANDR @SDL_VIDEO_DRIVER_X11_XRANDR@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSCRNSAVER @SDL_VIDEO_DRIVER_X11_XSCRNSAVER@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XSHAPE @SDL_VIDEO_DRIVER_X11_XSHAPE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_XVIDMODE @SDL_VIDEO_DRIVER_X11_XVIDMODE@ +#cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ +#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32@ +#cmakedefine SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY @SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY@ +#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ + +#cmakedefine SDL_VIDEO_RENDER_D3D @SDL_VIDEO_RENDER_D3D@ +#cmakedefine SDL_VIDEO_RENDER_OGL @SDL_VIDEO_RENDER_OGL@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES @SDL_VIDEO_RENDER_OGL_ES@ +#cmakedefine SDL_VIDEO_RENDER_OGL_ES2 @SDL_VIDEO_RENDER_OGL_ES2@ +#cmakedefine SDL_VIDEO_RENDER_DIRECTFB @SDL_VIDEO_RENDER_DIRECTFB@ + +/* Enable OpenGL support */ +#cmakedefine SDL_VIDEO_OPENGL @SDL_VIDEO_OPENGL@ +#cmakedefine SDL_VIDEO_OPENGL_ES @SDL_VIDEO_OPENGL_ES@ +#cmakedefine SDL_VIDEO_OPENGL_BGL @SDL_VIDEO_OPENGL_BGL@ +#cmakedefine SDL_VIDEO_OPENGL_CGL @SDL_VIDEO_OPENGL_CGL@ +#cmakedefine SDL_VIDEO_OPENGL_GLX @SDL_VIDEO_OPENGL_GLX@ +#cmakedefine SDL_VIDEO_OPENGL_WGL @SDL_VIDEO_OPENGL_WGL@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA @SDL_VIDEO_OPENGL_OSMESA@ +#cmakedefine SDL_VIDEO_OPENGL_OSMESA_DYNAMIC @SDL_VIDEO_OPENGL_OSMESA_DYNAMIC@ + +/* Enable system power support */ +#cmakedefine SDL_POWER_LINUX @SDL_POWER_LINUX@ +#cmakedefine SDL_POWER_WINDOWS @SDL_POWER_WINDOWS@ +#cmakedefine SDL_POWER_MACOSX @SDL_POWER_MACOSX@ +#cmakedefine SDL_POWER_BEOS @SDL_POWER_BEOS@ +#cmakedefine SDL_POWER_HARDWIRED @SDL_POWER_HARDWIRED@ + +/* Enable assembly routines */ +#cmakedefine SDL_ASSEMBLY_ROUTINES @SDL_ASSEMBLY_ROUTINES@ +#cmakedefine SDL_ALTIVEC_BLITTERS @SDL_ALTIVEC_BLITTERS@ + + +/* Platform specific definitions */ +#if !defined(__WIN32__) +# if !defined(_STDINT_H_) && !defined(_STDINT_H) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +typedef unsigned int size_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +# endif /* if (stdint.h isn't available) */ +#else /* __WIN32__ */ +# if !defined(_STDINT_H_) && !defined(HAVE_STDINT_H) && !defined(_HAVE_STDINT_H) +# if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +# elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +# ifndef _UINTPTR_T_DEFINED +# ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +# else +typedef unsigned int uintptr_t; +# endif +#define _UINTPTR_T_DEFINED +# endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +# if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +# endif +# if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +# endif +# else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +# ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +# endif +typedef unsigned int uintptr_t; +# endif /* __GNUC__ || _MSC_VER */ +# endif /* !_STDINT_H_ && !HAVE_STDINT_H */ +#endif /* __WIN32__ */ + +#endif /* _SDL_config_h */ diff --git a/SDL/include/SDL_config.h.in b/SDL/include/SDL_config.h.in new file mode 100644 index 0000000..04ee110 --- /dev/null +++ b/SDL/include/SDL_config.h.in @@ -0,0 +1,309 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/** + * \file SDL_config.h.in + * + * This is a set of defines to configure the SDL features + */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +/* Make sure that this isn't included by Visual C++ */ +#ifdef _MSC_VER +#error You should run hg revert SDL_config.h +#endif + +/* C language features */ +#undef const +#undef inline +#undef volatile + +/* C datatypes */ +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif +#undef HAVE_GCC_ATOMICS +#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET +#undef HAVE_PTHREAD_SPINLOCK + +/* Comment this if you want to build without any C library requirements */ +#undef HAVE_LIBC +#if HAVE_LIBC + +/* Useful headers */ +#undef HAVE_ALLOCA_H +#undef HAVE_SYS_TYPES_H +#undef HAVE_STDIO_H +#undef STDC_HEADERS +#undef HAVE_STDLIB_H +#undef HAVE_STDARG_H +#undef HAVE_MALLOC_H +#undef HAVE_MEMORY_H +#undef HAVE_STRING_H +#undef HAVE_STRINGS_H +#undef HAVE_INTTYPES_H +#undef HAVE_STDINT_H +#undef HAVE_CTYPE_H +#undef HAVE_MATH_H +#undef HAVE_ICONV_H +#undef HAVE_SIGNAL_H +#undef HAVE_ALTIVEC_H +#undef HAVE_PTHREAD_NP_H +#undef HAVE_LIBUDEV_H +#undef HAVE_DBUS_DBUS_H + +/* C library functions */ +#undef HAVE_MALLOC +#undef HAVE_CALLOC +#undef HAVE_REALLOC +#undef HAVE_FREE +#undef HAVE_ALLOCA +#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */ +#undef HAVE_GETENV +#undef HAVE_SETENV +#undef HAVE_PUTENV +#undef HAVE_UNSETENV +#endif +#undef HAVE_QSORT +#undef HAVE_ABS +#undef HAVE_BCOPY +#undef HAVE_MEMSET +#undef HAVE_MEMCPY +#undef HAVE_MEMMOVE +#undef HAVE_MEMCMP +#undef HAVE_STRLEN +#undef HAVE_STRLCPY +#undef HAVE_STRLCAT +#undef HAVE_STRDUP +#undef HAVE__STRREV +#undef HAVE__STRUPR +#undef HAVE__STRLWR +#undef HAVE_INDEX +#undef HAVE_RINDEX +#undef HAVE_STRCHR +#undef HAVE_STRRCHR +#undef HAVE_STRSTR +#undef HAVE_ITOA +#undef HAVE__LTOA +#undef HAVE__UITOA +#undef HAVE__ULTOA +#undef HAVE_STRTOL +#undef HAVE_STRTOUL +#undef HAVE__I64TOA +#undef HAVE__UI64TOA +#undef HAVE_STRTOLL +#undef HAVE_STRTOULL +#undef HAVE_STRTOD +#undef HAVE_ATOI +#undef HAVE_ATOF +#undef HAVE_STRCMP +#undef HAVE_STRNCMP +#undef HAVE__STRICMP +#undef HAVE_STRCASECMP +#undef HAVE__STRNICMP +#undef HAVE_STRNCASECMP +#undef HAVE_SSCANF +#undef HAVE_SNPRINTF +#undef HAVE_VSNPRINTF +#undef HAVE_M_PI +#undef HAVE_ATAN +#undef HAVE_ATAN2 +#undef HAVE_CEIL +#undef HAVE_COPYSIGN +#undef HAVE_COS +#undef HAVE_COSF +#undef HAVE_FABS +#undef HAVE_FLOOR +#undef HAVE_LOG +#undef HAVE_POW +#undef HAVE_SCALBN +#undef HAVE_SIN +#undef HAVE_SINF +#undef HAVE_SQRT +#undef HAVE_FSEEKO +#undef HAVE_FSEEKO64 +#undef HAVE_SIGACTION +#undef HAVE_SA_SIGACTION +#undef HAVE_SETJMP +#undef HAVE_NANOSLEEP +#undef HAVE_SYSCONF +#undef HAVE_SYSCTLBYNAME +#undef HAVE_CLOCK_GETTIME +#undef HAVE_GETPAGESIZE +#undef HAVE_MPROTECT +#undef HAVE_ICONV +#undef HAVE_PTHREAD_SETNAME_NP +#undef HAVE_PTHREAD_SET_NAME_NP +#undef HAVE_SEM_TIMEDWAIT + +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#define HAVE_STDINT_H 1 +#endif /* HAVE_LIBC */ + +/* SDL internal assertion support */ +#undef SDL_DEFAULT_ASSERT_LEVEL + +/* Allow disabling of core subsystems */ +#undef SDL_ATOMIC_DISABLED +#undef SDL_AUDIO_DISABLED +#undef SDL_CPUINFO_DISABLED +#undef SDL_EVENTS_DISABLED +#undef SDL_FILE_DISABLED +#undef SDL_JOYSTICK_DISABLED +#undef SDL_HAPTIC_DISABLED +#undef SDL_LOADSO_DISABLED +#undef SDL_RENDER_DISABLED +#undef SDL_THREADS_DISABLED +#undef SDL_TIMERS_DISABLED +#undef SDL_VIDEO_DISABLED +#undef SDL_POWER_DISABLED + +/* Enable various audio drivers */ +#undef SDL_AUDIO_DRIVER_ALSA +#undef SDL_AUDIO_DRIVER_ALSA_DYNAMIC +#undef SDL_AUDIO_DRIVER_ARTS +#undef SDL_AUDIO_DRIVER_ARTS_DYNAMIC +#undef SDL_AUDIO_DRIVER_PULSEAUDIO +#undef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_BEOSAUDIO +#undef SDL_AUDIO_DRIVER_BSD +#undef SDL_AUDIO_DRIVER_COREAUDIO +#undef SDL_AUDIO_DRIVER_DISK +#undef SDL_AUDIO_DRIVER_DUMMY +#undef SDL_AUDIO_DRIVER_XAUDIO2 +#undef SDL_AUDIO_DRIVER_DSOUND +#undef SDL_AUDIO_DRIVER_ESD +#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC +#undef SDL_AUDIO_DRIVER_NAS +#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC +#undef SDL_AUDIO_DRIVER_SNDIO +#undef SDL_AUDIO_DRIVER_SNDIO_DYNAMIC +#undef SDL_AUDIO_DRIVER_OSS +#undef SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H +#undef SDL_AUDIO_DRIVER_PAUDIO +#undef SDL_AUDIO_DRIVER_QSA +#undef SDL_AUDIO_DRIVER_SUNAUDIO +#undef SDL_AUDIO_DRIVER_WINMM +#undef SDL_AUDIO_DRIVER_FUSIONSOUND +#undef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC + +/* Enable various input drivers */ +#undef SDL_INPUT_LINUXEV +#undef SDL_INPUT_TSLIB +#undef SDL_JOYSTICK_BEOS +#undef SDL_JOYSTICK_DINPUT +#undef SDL_JOYSTICK_DUMMY +#undef SDL_JOYSTICK_IOKIT +#undef SDL_JOYSTICK_LINUX +#undef SDL_JOYSTICK_WINMM +#undef SDL_JOYSTICK_USBHID +#undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H +#undef SDL_HAPTIC_DUMMY +#undef SDL_HAPTIC_LINUX +#undef SDL_HAPTIC_IOKIT +#undef SDL_HAPTIC_DINPUT + +/* Enable various shared object loading systems */ +#undef SDL_LOADSO_BEOS +#undef SDL_LOADSO_DLOPEN +#undef SDL_LOADSO_DUMMY +#undef SDL_LOADSO_LDG +#undef SDL_LOADSO_WINDOWS + +/* Enable various threading systems */ +#undef SDL_THREAD_BEOS +#undef SDL_THREAD_PTHREAD +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX +#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP +#undef SDL_THREAD_WINDOWS + +/* Enable various timer systems */ +#undef SDL_TIMER_BEOS +#undef SDL_TIMER_DUMMY +#undef SDL_TIMER_UNIX +#undef SDL_TIMER_WINDOWS + +/* Enable various video drivers */ +#undef SDL_VIDEO_DRIVER_BWINDOW +#undef SDL_VIDEO_DRIVER_COCOA +#undef SDL_VIDEO_DRIVER_DIRECTFB +#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC +#undef SDL_VIDEO_DRIVER_DUMMY +#undef SDL_VIDEO_DRIVER_WINDOWS +#undef SDL_VIDEO_DRIVER_X11 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS +#undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE +#undef SDL_VIDEO_DRIVER_X11_XCURSOR +#undef SDL_VIDEO_DRIVER_X11_XINERAMA +#undef SDL_VIDEO_DRIVER_X11_XINPUT2 +#undef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH +#undef SDL_VIDEO_DRIVER_X11_XRANDR +#undef SDL_VIDEO_DRIVER_X11_XSCRNSAVER +#undef SDL_VIDEO_DRIVER_X11_XSHAPE +#undef SDL_VIDEO_DRIVER_X11_XVIDMODE +#undef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS +#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XDATA32 +#undef SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY +#undef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM + +#undef SDL_VIDEO_RENDER_D3D +#undef SDL_VIDEO_RENDER_OGL +#undef SDL_VIDEO_RENDER_OGL_ES +#undef SDL_VIDEO_RENDER_OGL_ES2 +#undef SDL_VIDEO_RENDER_DIRECTFB + +/* Enable OpenGL support */ +#undef SDL_VIDEO_OPENGL +#undef SDL_VIDEO_OPENGL_ES +#undef SDL_VIDEO_OPENGL_BGL +#undef SDL_VIDEO_OPENGL_CGL +#undef SDL_VIDEO_OPENGL_GLX +#undef SDL_VIDEO_OPENGL_WGL +#undef SDL_VIDEO_OPENGL_OSMESA +#undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC + +/* Enable system power support */ +#undef SDL_POWER_LINUX +#undef SDL_POWER_WINDOWS +#undef SDL_POWER_MACOSX +#undef SDL_POWER_BEOS +#undef SDL_POWER_HARDWIRED + +/* Enable assembly routines */ +#undef SDL_ASSEMBLY_ROUTINES +#undef SDL_ALTIVEC_BLITTERS + +#endif /* _SDL_config_h */ diff --git a/SDL/include/SDL_config_android.h b/SDL/include/SDL_config_android.h new file mode 100644 index 0000000..0826415 --- /dev/null +++ b/SDL/include/SDL_config_android.h @@ -0,0 +1,142 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_android_h +#define _SDL_config_android_h + +#include "SDL_platform.h" + +/** + * \file SDL_config_android.h + * + * This is a configuration that can be used to build SDL for Android + */ + +#include + +#define HAVE_GCC_ATOMICS 1 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 + +#define SIZEOF_VOIDP 4 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_ANDROID 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_ANDROID 1 +#define SDL_HAPTIC_DUMMY 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_ANDROID 1 + +/* Enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_OPENGL_EGL 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable system power support */ +#define SDL_POWER_ANDROID 1 + +/* !!! FIXME: what does Android do for filesystem stuff? */ +#define SDL_FILESYSTEM_DUMMY 1 + +#endif /* _SDL_config_android_h */ diff --git a/SDL/include/SDL_config_iphoneos.h b/SDL/include/SDL_config_iphoneos.h new file mode 100644 index 0000000..ade2966 --- /dev/null +++ b/SDL/include/SDL_config_iphoneos.h @@ -0,0 +1,154 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_iphoneos_h +#define _SDL_config_iphoneos_h + +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 + +/* enable iPhone version of Core Audio driver */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable Unix style SO loading */ +/* Technically this works, but it violates the iPhone developer agreement */ +/* #define SDL_LOADSO_DLOPEN 1 */ + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Supported video drivers */ +#define SDL_VIDEO_DRIVER_UIKIT 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* enable OpenGL ES */ +#define SDL_VIDEO_OPENGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_RENDER_OGL_ES2 1 + +/* Enable system power support */ +#define SDL_POWER_UIKIT 1 + +/* enable iPhone keyboard support */ +#define SDL_IPHONE_KEYBOARD 1 + +/* enable joystick subsystem */ +#define SDL_JOYSTICK_DISABLED 0 + +/* Set max recognized G-force from accelerometer + See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed + */ +#define SDL_IPHONE_MAX_GFORCE 5.0 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +#endif /* _SDL_config_iphoneos_h */ diff --git a/SDL/include/SDL_config_macosx.h b/SDL/include/SDL_config_macosx.h new file mode 100644 index 0000000..9f2f76e --- /dev/null +++ b/SDL/include/SDL_config_macosx.h @@ -0,0 +1,183 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_macosx_h +#define _SDL_config_macosx_h + +#include "SDL_platform.h" + +/* This gets us MAC_OS_X_VERSION_MIN_REQUIRED... */ +#include + +/* This is a set of defines to configure the SDL features */ + +#ifdef __LP64__ + #define SIZEOF_VOIDP 8 +#else + #define SIZEOF_VOIDP 4 +#endif + +/* Useful headers */ +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_SYSCONF 1 +#define HAVE_SYSCTLBYNAME 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_COREAUDIO 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_IOKIT 1 +#define SDL_HAPTIC_IOKIT 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_DLOPEN 1 + +/* Enable various threading systems */ +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 + +/* Enable various timer systems */ +#define SDL_TIMER_UNIX 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_COCOA 1 +#define SDL_VIDEO_DRIVER_DUMMY 1 +#undef SDL_VIDEO_DRIVER_X11 +#define SDL_VIDEO_DRIVER_X11_DYNAMIC "/usr/X11R6/lib/libX11.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "/usr/X11R6/lib/libXext.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINERAMA "/usr/X11R6/lib/libXinerama.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 "/usr/X11R6/lib/libXi.6.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "/usr/X11R6/lib/libXrandr.2.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS "/usr/X11R6/lib/libXss.1.dylib" +#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XVIDMODE "/usr/X11R6/lib/libXxf86vm.1.dylib" +#define SDL_VIDEO_DRIVER_X11_XINERAMA 1 +#define SDL_VIDEO_DRIVER_X11_XRANDR 1 +#define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 +#define SDL_VIDEO_DRIVER_X11_XSHAPE 1 +#define SDL_VIDEO_DRIVER_X11_XVIDMODE 1 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 + +#ifdef MAC_OS_X_VERSION_10_8 +/* + * No matter the versions targeted, this is the 10.8 or later SDK, so you have + * to use the external Xquartz, which is a more modern Xlib. Previous SDKs + * used an older Xlib. + */ +#define SDL_VIDEO_DRIVER_X11_XINPUT2 1 +#define SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1 +#define SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY 1 +#endif + +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_CGL +#define SDL_VIDEO_OPENGL_CGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_GLX +#define SDL_VIDEO_OPENGL_GLX 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_MACOSX 1 + +/* enable filesystem support */ +#define SDL_FILESYSTEM_COCOA 1 + +/* Enable assembly routines */ +#define SDL_ASSEMBLY_ROUTINES 1 +#ifdef __ppc__ +#define SDL_ALTIVEC_BLITTERS 1 +#endif + +#endif /* _SDL_config_macosx_h */ diff --git a/SDL/include/SDL_config_minimal.h b/SDL/include/SDL_config_minimal.h new file mode 100644 index 0000000..3248bdd --- /dev/null +++ b/SDL/include/SDL_config_minimal.h @@ -0,0 +1,81 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_minimal_h +#define _SDL_config_minimal_h + +#include "SDL_platform.h" + +/** + * \file SDL_config_minimal.h + * + * This is the minimal configuration that can be used to build SDL. + */ + +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 + +/* Most everything except Visual Studio 2008 and earlier has stdint.h now */ +#if defined(_MSC_VER) && (_MSC_VER < 1600) +/* Here are some reasonable defaults */ +typedef unsigned int size_t; +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +typedef unsigned long uintptr_t; +#else +#define HAVE_STDINT_H 1 +#endif /* Visual Studio 2008 */ + +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif + +/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ +#define SDL_JOYSTICK_DISABLED 1 + +/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + +/* Enable the stub thread support (src/thread/generic/\*.c) */ +#define SDL_THREADS_DISABLED 1 + +/* Enable the stub timer support (src/timer/dummy/\*.c) */ +#define SDL_TIMERS_DISABLED 1 + +/* Enable the dummy video driver (src/video/dummy/\*.c) */ +#define SDL_VIDEO_DRIVER_DUMMY 1 + +/* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ +#define SDL_FILESYSTEM_DUMMY 1 + +#endif /* _SDL_config_minimal_h */ diff --git a/SDL/include/SDL_config_pandora.h b/SDL/include/SDL_config_pandora.h new file mode 100644 index 0000000..4bfad48 --- /dev/null +++ b/SDL/include/SDL_config_pandora.h @@ -0,0 +1,125 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#ifdef __LP64__ +#define SIZEOF_VOIDP 8 +#else +#define SIZEOF_VOIDP 4 +#endif + +#define SDL_BYTEORDER 1234 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 + +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_INPUT_TSLIB 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 +#define SDL_FILESYSTEM_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_X11 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* _SDL_config_h */ diff --git a/SDL/include/SDL_config_psp.h b/SDL/include/SDL_config_psp.h new file mode 100644 index 0000000..31ac2b2 --- /dev/null +++ b/SDL/include/SDL_config_psp.h @@ -0,0 +1,139 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_psp_h +#define _SDL_config_psp_h + +#include "SDL_platform.h" + + + +#ifdef __GNUC__ +#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 +#endif + +#define HAVE_GCC_ATOMICS 1 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_SETENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE_STRLCPY 1 +#define HAVE_STRLCAT 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +/* #define HAVE_SYSCONF 1 */ +/* #define HAVE_SIGACTION 1 */ + + +/* PSP isn't that sophisticated */ +#define LACKS_SYS_MMAN_H 1 + +/* Enable the stub thread support (src/thread/psp/\*.c) */ +#define SDL_THREAD_PSP 1 + +/* Enable the stub timer support (src/timer/psp/\*.c) */ +#define SDL_TIMERS_PSP 1 + +/* Enable the stub joystick driver (src/joystick/psp/\*.c) */ +#define SDL_JOYSTICK_PSP 1 + +/* Enable the stub audio driver (src/audio/psp/\*.c) */ +#define SDL_AUDIO_DRIVER_PSP 1 + +/* PSP video dirver */ +#define SDL_VIDEO_DRIVER_PSP 1 + +/* PSP render dirver */ +#define SDL_VIDEO_RENDER_PSP 1 + +#define SDL_POWER_PSP 1 + +/* !!! FIXME: what does PSP do for filesystem stuff? */ +#define SDL_FILESYSTEM_DUMMY 1 + +/* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ +#define SDL_HAPTIC_DISABLED 1 + +/* PSP can't load shared object (src/loadso/dummy/\*.c) */ +#define SDL_LOADSO_DISABLED 1 + + +#endif /* _SDL_config_psp_h */ diff --git a/SDL/include/SDL_config_windows.h b/SDL/include/SDL_config_windows.h new file mode 100644 index 0000000..4d5c7c2 --- /dev/null +++ b/SDL/include/SDL_config_windows.h @@ -0,0 +1,195 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_windows_h +#define _SDL_config_windows_h + +#include "SDL_platform.h" + +/* This is a set of defines to configure the SDL features */ + +#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H) +#if defined(__GNUC__) || defined(__DMC__) || defined(__WATCOMC__) +#define HAVE_STDINT_H 1 +#elif defined(_MSC_VER) +typedef signed __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef signed __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef signed __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef signed __int64 int64_t; +typedef unsigned __int64 uint64_t; +#ifndef _UINTPTR_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 uintptr_t; +#else +typedef unsigned int uintptr_t; +#endif +#define _UINTPTR_T_DEFINED +#endif +/* Older Visual C++ headers don't have the Win64-compatible typedefs... */ +#if ((_MSC_VER <= 1200) && (!defined(DWORD_PTR))) +#define DWORD_PTR DWORD +#endif +#if ((_MSC_VER <= 1200) && (!defined(LONG_PTR))) +#define LONG_PTR LONG +#endif +#else /* !__GNUC__ && !_MSC_VER */ +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef signed short int16_t; +typedef unsigned short uint16_t; +typedef signed int int32_t; +typedef unsigned int uint32_t; +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#ifndef _SIZE_T_DEFINED_ +#define _SIZE_T_DEFINED_ +typedef unsigned int size_t; +#endif +typedef unsigned int uintptr_t; +#endif /* __GNUC__ || _MSC_VER */ +#endif /* !_STDINT_H_ && !HAVE_STDINT_H */ + +#ifdef _WIN64 +# define SIZEOF_VOIDP 8 +#else +# define SIZEOF_VOIDP 4 +#endif + +/* This is disabled by default to avoid C runtime dependencies and manifest requirements */ +#ifdef HAVE_LIBC +/* Useful headers */ +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STRING_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_SIGNAL_H 1 + +/* C library functions */ +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_MEMCMP 1 +#define HAVE_STRLEN 1 +#define HAVE__STRREV 1 +#define HAVE__STRUPR 1 +#define HAVE__STRLWR 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE__LTOA 1 +#define HAVE__ULTOA 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOD 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE__STRICMP 1 +#define HAVE__STRNICMP 1 +#define HAVE_ATAN 1 +#define HAVE_ATAN2 1 +#define HAVE_CEIL 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_POW 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#if _MSC_VER >= 1800 +#define HAVE_STRTOLL 1 +#define HAVE_SSCANF 1 +#define HAVE_COPYSIGN 1 +#define HAVE_SCALBN 1 +#endif +#if !defined(_MSC_VER) || defined(_USE_MATH_DEFINES) +#define HAVE_M_PI 1 +#endif +#else +#define HAVE_STDARG_H 1 +#define HAVE_STDDEF_H 1 +#endif + +/* Enable various audio drivers */ +#define SDL_AUDIO_DRIVER_DSOUND 1 +#define SDL_AUDIO_DRIVER_XAUDIO2 1 +#define SDL_AUDIO_DRIVER_WINMM 1 +#define SDL_AUDIO_DRIVER_DISK 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 + +/* Enable various input drivers */ +#define SDL_JOYSTICK_DINPUT 1 +#define SDL_HAPTIC_DINPUT 1 + +/* Enable various shared object loading systems */ +#define SDL_LOADSO_WINDOWS 1 + +/* Enable various threading systems */ +#define SDL_THREAD_WINDOWS 1 + +/* Enable various timer systems */ +#define SDL_TIMER_WINDOWS 1 + +/* Enable various video drivers */ +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_WINDOWS 1 + +#ifndef SDL_VIDEO_RENDER_D3D +#define SDL_VIDEO_RENDER_D3D 1 +#endif + +/* Enable OpenGL support */ +#ifndef SDL_VIDEO_OPENGL +#define SDL_VIDEO_OPENGL 1 +#endif +#ifndef SDL_VIDEO_OPENGL_WGL +#define SDL_VIDEO_OPENGL_WGL 1 +#endif +#ifndef SDL_VIDEO_RENDER_OGL +#define SDL_VIDEO_RENDER_OGL 1 +#endif + +/* Enable system power support */ +#define SDL_POWER_WINDOWS 1 + +/* Enable filesystem support */ +#define SDL_FILESYSTEM_WINDOWS 1 + +/* Enable assembly routines (Win64 doesn't have inline asm) */ +#ifndef _WIN64 +#define SDL_ASSEMBLY_ROUTINES 1 +#endif + +#endif /* _SDL_config_windows_h */ diff --git a/SDL/include/SDL_config_wiz.h b/SDL/include/SDL_config_wiz.h new file mode 100644 index 0000000..9be04d9 --- /dev/null +++ b/SDL/include/SDL_config_wiz.h @@ -0,0 +1,119 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_config_h +#define _SDL_config_h + +/* This is a set of defines to configure the SDL features */ + +/* General platform specific identifiers */ +#include "SDL_platform.h" + +#define SDL_BYTEORDER 1234 + +#define HAVE_ALLOCA_H 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDIO_H 1 +#define STDC_HEADERS 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_MALLOC_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRING_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_CTYPE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_ICONV_H 1 +#define HAVE_SIGNAL_H 1 +#define HAVE_MALLOC 1 +#define HAVE_CALLOC 1 +#define HAVE_REALLOC 1 +#define HAVE_FREE 1 +#define HAVE_ALLOCA 1 +#define HAVE_GETENV 1 +#define HAVE_SETENV 1 +#define HAVE_PUTENV 1 +#define HAVE_UNSETENV 1 +#define HAVE_QSORT 1 +#define HAVE_ABS 1 +#define HAVE_BCOPY 1 +#define HAVE_MEMSET 1 +#define HAVE_MEMCPY 1 +#define HAVE_MEMMOVE 1 +#define HAVE_STRLEN 1 +#define HAVE_STRDUP 1 +#define HAVE_STRCHR 1 +#define HAVE_STRRCHR 1 +#define HAVE_STRSTR 1 +#define HAVE_STRTOL 1 +#define HAVE_STRTOUL 1 +#define HAVE_STRTOLL 1 +#define HAVE_STRTOULL 1 +#define HAVE_ATOI 1 +#define HAVE_ATOF 1 +#define HAVE_STRCMP 1 +#define HAVE_STRNCMP 1 +#define HAVE_STRCASECMP 1 +#define HAVE_STRNCASECMP 1 +#define HAVE_SSCANF 1 +#define HAVE_SNPRINTF 1 +#define HAVE_VSNPRINTF 1 +#define HAVE_M_PI 1 +#define HAVE_CEIL 1 +#define HAVE_COPYSIGN 1 +#define HAVE_COS 1 +#define HAVE_COSF 1 +#define HAVE_FABS 1 +#define HAVE_FLOOR 1 +#define HAVE_LOG 1 +#define HAVE_SCALBN 1 +#define HAVE_SIN 1 +#define HAVE_SINF 1 +#define HAVE_SQRT 1 +#define HAVE_SIGACTION 1 +#define HAVE_SETJMP 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_POW 1 + +#define SDL_CDROM_DISABLED 1 +#define SDL_AUDIO_DRIVER_DUMMY 1 +#define SDL_AUDIO_DRIVER_OSS 1 + +#define SDL_INPUT_LINUXEV 1 +#define SDL_INPUT_TSLIB 1 +#define SDL_JOYSTICK_LINUX 1 +#define SDL_HAPTIC_LINUX 1 + +#define SDL_LOADSO_DLOPEN 1 + +#define SDL_THREAD_PTHREAD 1 +#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 + +#define SDL_TIMER_UNIX 1 + +#define SDL_VIDEO_DRIVER_DUMMY 1 +#define SDL_VIDEO_DRIVER_PANDORA 1 +#define SDL_VIDEO_RENDER_OGL_ES 1 +#define SDL_VIDEO_OPENGL_ES 1 + +#endif /* _SDL_config_h */ diff --git a/SDL/include/SDL_copying.h b/SDL/include/SDL_copying.h new file mode 100644 index 0000000..3a8fb75 --- /dev/null +++ b/SDL/include/SDL_copying.h @@ -0,0 +1,20 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ diff --git a/SDL/include/SDL_cpuinfo.h b/SDL/include/SDL_cpuinfo.h new file mode 100644 index 0000000..6d72bbb --- /dev/null +++ b/SDL/include/SDL_cpuinfo.h @@ -0,0 +1,151 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_cpuinfo.h + * + * CPU feature detection for SDL. + */ + +#ifndef _SDL_cpuinfo_h +#define _SDL_cpuinfo_h + +#include "SDL_stdinc.h" + +/* Need to do this here because intrin.h has C++ code in it */ +/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */ +#if defined(_MSC_VER) && (_MSC_VER >= 1500) +#include +#ifndef _WIN64 +#define __MMX__ +#define __3dNOW__ +#endif +#define __SSE__ +#define __SSE2__ +#elif defined(__MINGW64_VERSION_MAJOR) +#include +#else +#ifdef __ALTIVEC__ +#if HAVE_ALTIVEC_H && !defined(__APPLE_ALTIVEC__) +#include +#undef pixel +#endif +#endif +#ifdef __MMX__ +#include +#endif +#ifdef __3dNOW__ +#include +#endif +#ifdef __SSE__ +#include +#endif +#ifdef __SSE2__ +#include +#endif +#endif + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* This is a guess for the cacheline size used for padding. + * Most x86 processors have a 64 byte cache line. + * The 64-bit PowerPC processors have a 128 byte cache line. + * We'll use the larger value to be generally safe. + */ +#define SDL_CACHELINE_SIZE 128 + +/** + * This function returns the number of CPU cores available. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCount(void); + +/** + * This function returns the L1 cache line size of the CPU + * + * This is useful for determining multi-threaded structure padding + * or SIMD prefetch sizes. + */ +extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void); + +/** + * This function returns true if the CPU has the RDTSC instruction. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void); + +/** + * This function returns true if the CPU has AltiVec features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void); + +/** + * This function returns true if the CPU has MMX features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void); + +/** + * This function returns true if the CPU has 3DNow! features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void); + +/** + * This function returns true if the CPU has SSE features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void); + +/** + * This function returns true if the CPU has SSE2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void); + +/** + * This function returns true if the CPU has SSE3 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void); + +/** + * This function returns true if the CPU has SSE4.1 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void); + +/** + * This function returns true if the CPU has SSE4.2 features. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void); + +/** + * This function returns the amount of RAM configured in the system, in MB. + */ +extern DECLSPEC int SDLCALL SDL_GetSystemRAM(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_cpuinfo_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_endian.h b/SDL/include/SDL_endian.h new file mode 100644 index 0000000..3450316 --- /dev/null +++ b/SDL/include/SDL_endian.h @@ -0,0 +1,239 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_endian.h + * + * Functions for reading and writing endian-specific values + */ + +#ifndef _SDL_endian_h +#define _SDL_endian_h + +#include "SDL_stdinc.h" + +/** + * \name The two types of endianness + */ +/* @{ */ +#define SDL_LIL_ENDIAN 1234 +#define SDL_BIG_ENDIAN 4321 +/* @} */ + +#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */ +#ifdef __linux__ +#include +#define SDL_BYTEORDER __BYTE_ORDER +#else /* __linux __ */ +#if defined(__hppa__) || \ + defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ + (defined(__MIPS__) && defined(__MISPEB__)) || \ + defined(__ppc__) || defined(__POWERPC__) || defined(_M_PPC) || \ + defined(__sparc__) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#endif +#endif /* __linux __ */ +#endif /* !SDL_BYTEORDER */ + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_endian.h + */ +#if defined(__GNUC__) && defined(__i386__) && \ + !(__GNUC__ == 2 && __GNUC_MINOR__ == 95 /* broken gcc version */) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("xchgb %b0,%h0": "=Q"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + int result; + + __asm__("rlwimi %0,%2,8,16,23": "=&r"(result):"0"(x >> 8), "r"(x)); + return (Uint16)result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + __asm__("rorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#else +SDL_FORCE_INLINE Uint16 +SDL_Swap16(Uint16 x) +{ + return SDL_static_cast(Uint16, ((x << 8) | (x >> 8))); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswap %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("bswapl %0": "=r"(x):"0"(x)); + return x; +} +#elif defined(__GNUC__) && (defined(__powerpc__) || defined(__ppc__)) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + Uint32 result; + + __asm__("rlwimi %0,%2,24,16,23": "=&r"(result):"0"(x >> 24), "r"(x)); + __asm__("rlwimi %0,%2,8,8,15": "=&r"(result):"0"(result), "r"(x)); + __asm__("rlwimi %0,%2,24,0,7": "=&r"(result):"0"(result), "r"(x)); + return result; +} +#elif defined(__GNUC__) && (defined(__M68000__) || defined(__M68020__)) && !defined(__mcoldfire__) +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + __asm__("rorw #8,%0\n\tswap %0\n\trorw #8,%0": "=d"(x): "0"(x):"cc"); + return x; +} +#else +SDL_FORCE_INLINE Uint32 +SDL_Swap32(Uint32 x) +{ + return SDL_static_cast(Uint32, ((x << 24) | ((x << 8) & 0x00FF0000) | + ((x >> 8) & 0x0000FF00) | (x >> 24))); +} +#endif + +#if defined(__GNUC__) && defined(__i386__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + union + { + struct + { + Uint32 a, b; + } s; + Uint64 u; + } v; + v.u = x; + __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a), + "1"(v.s. + b)); + return v.u; +} +#elif defined(__GNUC__) && defined(__x86_64__) +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + __asm__("bswapq %0": "=r"(x):"0"(x)); + return x; +} +#else +SDL_FORCE_INLINE Uint64 +SDL_Swap64(Uint64 x) +{ + Uint32 hi, lo; + + /* Separate into high and low 32-bit values and swap them */ + lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x >>= 32; + hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); + x = SDL_Swap32(lo); + x <<= 32; + x |= SDL_Swap32(hi); + return (x); +} +#endif + + +SDL_FORCE_INLINE float +SDL_SwapFloat(float x) +{ + union + { + float f; + Uint32 ui32; + } swapper; + swapper.f = x; + swapper.ui32 = SDL_Swap32(swapper.ui32); + return swapper.f; +} + + +/** + * \name Swap to native + * Byteswap item from the specified endianness to the native endianness. + */ +/* @{ */ +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define SDL_SwapLE16(X) (X) +#define SDL_SwapLE32(X) (X) +#define SDL_SwapLE64(X) (X) +#define SDL_SwapFloatLE(X) (X) +#define SDL_SwapBE16(X) SDL_Swap16(X) +#define SDL_SwapBE32(X) SDL_Swap32(X) +#define SDL_SwapBE64(X) SDL_Swap64(X) +#define SDL_SwapFloatBE(X) SDL_SwapFloat(X) +#else +#define SDL_SwapLE16(X) SDL_Swap16(X) +#define SDL_SwapLE32(X) SDL_Swap32(X) +#define SDL_SwapLE64(X) SDL_Swap64(X) +#define SDL_SwapFloatLE(X) SDL_SwapFloat(X) +#define SDL_SwapBE16(X) (X) +#define SDL_SwapBE32(X) (X) +#define SDL_SwapBE64(X) (X) +#define SDL_SwapFloatBE(X) (X) +#endif +/* @} *//* Swap to native */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_endian_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_error.h b/SDL/include/SDL_error.h new file mode 100644 index 0000000..2b8bb41 --- /dev/null +++ b/SDL/include/SDL_error.h @@ -0,0 +1,76 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_error.h + * + * Simple error message routines for SDL. + */ + +#ifndef _SDL_error_h +#define _SDL_error_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Public functions */ +/* SDL_SetError() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...); +extern DECLSPEC const char *SDLCALL SDL_GetError(void); +extern DECLSPEC void SDLCALL SDL_ClearError(void); + +/** + * \name Internal error functions + * + * \internal + * Private error reporting function - used internally. + */ +/* @{ */ +#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) +#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) +#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) +typedef enum +{ + SDL_ENOMEM, + SDL_EFREAD, + SDL_EFWRITE, + SDL_EFSEEK, + SDL_UNSUPPORTED, + SDL_LASTERROR +} SDL_errorcode; +/* SDL_Error() unconditionally returns -1. */ +extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); +/* @} *//* Internal error functions */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_error_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_events.h b/SDL/include/SDL_events.h new file mode 100644 index 0000000..c089030 --- /dev/null +++ b/SDL/include/SDL_events.h @@ -0,0 +1,720 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_events.h + * + * Include file for SDL event handling. + */ + +#ifndef _SDL_events_h +#define _SDL_events_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_joystick.h" +#include "SDL_gamecontroller.h" +#include "SDL_quit.h" +#include "SDL_gesture.h" +#include "SDL_touch.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* General keyboard/mouse state definitions */ +#define SDL_RELEASED 0 +#define SDL_PRESSED 1 + +/** + * \brief The types of events that can be delivered. + */ +typedef enum +{ + SDL_FIRSTEVENT = 0, /**< Unused (do not remove) */ + + /* Application events */ + SDL_QUIT = 0x100, /**< User-requested quit */ + + /* These application events have special meaning on iOS, see README-ios.txt for details */ + SDL_APP_TERMINATING, /**< The application is being terminated by the OS + Called on iOS in applicationWillTerminate() + Called on Android in onDestroy() + */ + SDL_APP_LOWMEMORY, /**< The application is low on memory, free memory if possible. + Called on iOS in applicationDidReceiveMemoryWarning() + Called on Android in onLowMemory() + */ + SDL_APP_WILLENTERBACKGROUND, /**< The application is about to enter the background + Called on iOS in applicationWillResignActive() + Called on Android in onPause() + */ + SDL_APP_DIDENTERBACKGROUND, /**< The application did enter the background and may not get CPU for some time + Called on iOS in applicationDidEnterBackground() + Called on Android in onPause() + */ + SDL_APP_WILLENTERFOREGROUND, /**< The application is about to enter the foreground + Called on iOS in applicationWillEnterForeground() + Called on Android in onResume() + */ + SDL_APP_DIDENTERFOREGROUND, /**< The application is now interactive + Called on iOS in applicationDidBecomeActive() + Called on Android in onResume() + */ + + /* Window events */ + SDL_WINDOWEVENT = 0x200, /**< Window state change */ + SDL_SYSWMEVENT, /**< System specific event */ + + /* Keyboard events */ + SDL_KEYDOWN = 0x300, /**< Key pressed */ + SDL_KEYUP, /**< Key released */ + SDL_TEXTEDITING, /**< Keyboard text editing (composition) */ + SDL_TEXTINPUT, /**< Keyboard text input */ + + /* Mouse events */ + SDL_MOUSEMOTION = 0x400, /**< Mouse moved */ + SDL_MOUSEBUTTONDOWN, /**< Mouse button pressed */ + SDL_MOUSEBUTTONUP, /**< Mouse button released */ + SDL_MOUSEWHEEL, /**< Mouse wheel motion */ + + /* Joystick events */ + SDL_JOYAXISMOTION = 0x600, /**< Joystick axis motion */ + SDL_JOYBALLMOTION, /**< Joystick trackball motion */ + SDL_JOYHATMOTION, /**< Joystick hat position change */ + SDL_JOYBUTTONDOWN, /**< Joystick button pressed */ + SDL_JOYBUTTONUP, /**< Joystick button released */ + SDL_JOYDEVICEADDED, /**< A new joystick has been inserted into the system */ + SDL_JOYDEVICEREMOVED, /**< An opened joystick has been removed */ + + /* Game controller events */ + SDL_CONTROLLERAXISMOTION = 0x650, /**< Game controller axis motion */ + SDL_CONTROLLERBUTTONDOWN, /**< Game controller button pressed */ + SDL_CONTROLLERBUTTONUP, /**< Game controller button released */ + SDL_CONTROLLERDEVICEADDED, /**< A new Game controller has been inserted into the system */ + SDL_CONTROLLERDEVICEREMOVED, /**< An opened Game controller has been removed */ + SDL_CONTROLLERDEVICEREMAPPED, /**< The controller mapping was updated */ + + /* Touch events */ + SDL_FINGERDOWN = 0x700, + SDL_FINGERUP, + SDL_FINGERMOTION, + + /* Gesture events */ + SDL_DOLLARGESTURE = 0x800, + SDL_DOLLARRECORD, + SDL_MULTIGESTURE, + + /* Clipboard events */ + SDL_CLIPBOARDUPDATE = 0x900, /**< The clipboard changed */ + + /* Drag and drop events */ + SDL_DROPFILE = 0x1000, /**< The system requests a file open */ + + /** Events ::SDL_USEREVENT through ::SDL_LASTEVENT are for your use, + * and should be allocated with SDL_RegisterEvents() + */ + SDL_USEREVENT = 0x8000, + + /** + * This last event is only for bounding internal arrays + */ + SDL_LASTEVENT = 0xFFFF +} SDL_EventType; + +/** + * \brief Fields shared by every event + */ +typedef struct SDL_CommonEvent +{ + Uint32 type; + Uint32 timestamp; +} SDL_CommonEvent; + +/** + * \brief Window state change event data (event.window.*) + */ +typedef struct SDL_WindowEvent +{ + Uint32 type; /**< ::SDL_WINDOWEVENT */ + Uint32 timestamp; + Uint32 windowID; /**< The associated window */ + Uint8 event; /**< ::SDL_WindowEventID */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint32 data1; /**< event dependent data */ + Sint32 data2; /**< event dependent data */ +} SDL_WindowEvent; + +/** + * \brief Keyboard button event structure (event.key.*) + */ +typedef struct SDL_KeyboardEvent +{ + Uint32 type; /**< ::SDL_KEYDOWN or ::SDL_KEYUP */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 repeat; /**< Non-zero if this is a key repeat */ + Uint8 padding2; + Uint8 padding3; + SDL_Keysym keysym; /**< The key that was pressed or released */ +} SDL_KeyboardEvent; + +#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text editing event structure (event.edit.*) + */ +typedef struct SDL_TextEditingEvent +{ + Uint32 type; /**< ::SDL_TEXTEDITING */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE]; /**< The editing text */ + Sint32 start; /**< The start cursor of selected editing text */ + Sint32 length; /**< The length of selected editing text */ +} SDL_TextEditingEvent; + + +#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32) +/** + * \brief Keyboard text input event structure (event.text.*) + */ +typedef struct SDL_TextInputEvent +{ + Uint32 type; /**< ::SDL_TEXTINPUT */ + Uint32 timestamp; + Uint32 windowID; /**< The window with keyboard focus, if any */ + char text[SDL_TEXTINPUTEVENT_TEXT_SIZE]; /**< The input text */ +} SDL_TextInputEvent; + +/** + * \brief Mouse motion event structure (event.motion.*) + */ +typedef struct SDL_MouseMotionEvent +{ + Uint32 type; /**< ::SDL_MOUSEMOTION */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint32 state; /**< The current button state */ + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ + Sint32 xrel; /**< The relative motion in the X direction */ + Sint32 yrel; /**< The relative motion in the Y direction */ +} SDL_MouseMotionEvent; + +/** + * \brief Mouse button event structure (event.button.*) + */ +typedef struct SDL_MouseButtonEvent +{ + Uint32 type; /**< ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Uint8 button; /**< The mouse button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; + Sint32 x; /**< X coordinate, relative to window */ + Sint32 y; /**< Y coordinate, relative to window */ +} SDL_MouseButtonEvent; + +/** + * \brief Mouse wheel event structure (event.wheel.*) + */ +typedef struct SDL_MouseWheelEvent +{ + Uint32 type; /**< ::SDL_MOUSEWHEEL */ + Uint32 timestamp; + Uint32 windowID; /**< The window with mouse focus, if any */ + Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ + Sint32 x; /**< The amount scrolled horizontally */ + Sint32 y; /**< The amount scrolled vertically */ +} SDL_MouseWheelEvent; + +/** + * \brief Joystick axis motion event structure (event.jaxis.*) + */ +typedef struct SDL_JoyAxisEvent +{ + Uint32 type; /**< ::SDL_JOYAXISMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The joystick axis index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_JoyAxisEvent; + +/** + * \brief Joystick trackball motion event structure (event.jball.*) + */ +typedef struct SDL_JoyBallEvent +{ + Uint32 type; /**< ::SDL_JOYBALLMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 ball; /**< The joystick trackball index */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 xrel; /**< The relative motion in the X direction */ + Sint16 yrel; /**< The relative motion in the Y direction */ +} SDL_JoyBallEvent; + +/** + * \brief Joystick hat position change event structure (event.jhat.*) + */ +typedef struct SDL_JoyHatEvent +{ + Uint32 type; /**< ::SDL_JOYHATMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 hat; /**< The joystick hat index */ + Uint8 value; /**< The hat position value. + * \sa ::SDL_HAT_LEFTUP ::SDL_HAT_UP ::SDL_HAT_RIGHTUP + * \sa ::SDL_HAT_LEFT ::SDL_HAT_CENTERED ::SDL_HAT_RIGHT + * \sa ::SDL_HAT_LEFTDOWN ::SDL_HAT_DOWN ::SDL_HAT_RIGHTDOWN + * + * Note that zero means the POV is centered. + */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyHatEvent; + +/** + * \brief Joystick button event structure (event.jbutton.*) + */ +typedef struct SDL_JoyButtonEvent +{ + Uint32 type; /**< ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The joystick button index */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_JoyButtonEvent; + +/** + * \brief Joystick device event structure (event.jdevice.*) + */ +typedef struct SDL_JoyDeviceEvent +{ + Uint32 type; /**< ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED */ + Uint32 timestamp; + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED event */ +} SDL_JoyDeviceEvent; + + +/** + * \brief Game controller axis motion event structure (event.caxis.*) + */ +typedef struct SDL_ControllerAxisEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERAXISMOTION */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 axis; /**< The controller axis (SDL_GameControllerAxis) */ + Uint8 padding1; + Uint8 padding2; + Uint8 padding3; + Sint16 value; /**< The axis value (range: -32768 to 32767) */ + Uint16 padding4; +} SDL_ControllerAxisEvent; + + +/** + * \brief Game controller button event structure (event.cbutton.*) + */ +typedef struct SDL_ControllerButtonEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP */ + Uint32 timestamp; + SDL_JoystickID which; /**< The joystick instance id */ + Uint8 button; /**< The controller button (SDL_GameControllerButton) */ + Uint8 state; /**< ::SDL_PRESSED or ::SDL_RELEASED */ + Uint8 padding1; + Uint8 padding2; +} SDL_ControllerButtonEvent; + + +/** + * \brief Controller device event structure (event.cdevice.*) + */ +typedef struct SDL_ControllerDeviceEvent +{ + Uint32 type; /**< ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED */ + Uint32 timestamp; + Sint32 which; /**< The joystick device index for the ADDED event, instance id for the REMOVED or REMAPPED event */ +} SDL_ControllerDeviceEvent; + + +/** + * \brief Touch finger event structure (event.tfinger.*) + */ +typedef struct SDL_TouchFingerEvent +{ + Uint32 type; /**< ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device id */ + SDL_FingerID fingerId; + float x; /**< Normalized in the range 0...1 */ + float y; /**< Normalized in the range 0...1 */ + float dx; /**< Normalized in the range 0...1 */ + float dy; /**< Normalized in the range 0...1 */ + float pressure; /**< Normalized in the range 0...1 */ +} SDL_TouchFingerEvent; + + +/** + * \brief Multiple Finger Gesture Event (event.mgesture.*) + */ +typedef struct SDL_MultiGestureEvent +{ + Uint32 type; /**< ::SDL_MULTIGESTURE */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device index */ + float dTheta; + float dDist; + float x; + float y; + Uint16 numFingers; + Uint16 padding; +} SDL_MultiGestureEvent; + + +/** + * \brief Dollar Gesture Event (event.dgesture.*) + */ +typedef struct SDL_DollarGestureEvent +{ + Uint32 type; /**< ::SDL_DOLLARGESTURE */ + Uint32 timestamp; + SDL_TouchID touchId; /**< The touch device id */ + SDL_GestureID gestureId; + Uint32 numFingers; + float error; + float x; /**< Normalized center of gesture */ + float y; /**< Normalized center of gesture */ +} SDL_DollarGestureEvent; + + +/** + * \brief An event used to request a file open by the system (event.drop.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * \note If you enable this event, you must free the filename in the event. + */ +typedef struct SDL_DropEvent +{ + Uint32 type; /**< ::SDL_DROPFILE */ + Uint32 timestamp; + char *file; /**< The file name, which should be freed with SDL_free() */ +} SDL_DropEvent; + + +/** + * \brief The "quit requested" event + */ +typedef struct SDL_QuitEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; +} SDL_QuitEvent; + +/** + * \brief OS Specific event + */ +typedef struct SDL_OSEvent +{ + Uint32 type; /**< ::SDL_QUIT */ + Uint32 timestamp; +} SDL_OSEvent; + +/** + * \brief A user-defined event type (event.user.*) + */ +typedef struct SDL_UserEvent +{ + Uint32 type; /**< ::SDL_USEREVENT through ::SDL_LASTEVENT-1 */ + Uint32 timestamp; + Uint32 windowID; /**< The associated window if any */ + Sint32 code; /**< User defined event code */ + void *data1; /**< User defined data pointer */ + void *data2; /**< User defined data pointer */ +} SDL_UserEvent; + + +struct SDL_SysWMmsg; +typedef struct SDL_SysWMmsg SDL_SysWMmsg; + +/** + * \brief A video driver dependent system event (event.syswm.*) + * This event is disabled by default, you can enable it with SDL_EventState() + * + * \note If you want to use this event, you should include SDL_syswm.h. + */ +typedef struct SDL_SysWMEvent +{ + Uint32 type; /**< ::SDL_SYSWMEVENT */ + Uint32 timestamp; + SDL_SysWMmsg *msg; /**< driver dependent data, defined in SDL_syswm.h */ +} SDL_SysWMEvent; + +/** + * \brief General event structure + */ +typedef union SDL_Event +{ + Uint32 type; /**< Event type, shared with all events */ + SDL_CommonEvent common; /**< Common event data */ + SDL_WindowEvent window; /**< Window event data */ + SDL_KeyboardEvent key; /**< Keyboard event data */ + SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextInputEvent text; /**< Text input event data */ + SDL_MouseMotionEvent motion; /**< Mouse motion event data */ + SDL_MouseButtonEvent button; /**< Mouse button event data */ + SDL_MouseWheelEvent wheel; /**< Mouse wheel event data */ + SDL_JoyAxisEvent jaxis; /**< Joystick axis event data */ + SDL_JoyBallEvent jball; /**< Joystick ball event data */ + SDL_JoyHatEvent jhat; /**< Joystick hat event data */ + SDL_JoyButtonEvent jbutton; /**< Joystick button event data */ + SDL_JoyDeviceEvent jdevice; /**< Joystick device change event data */ + SDL_ControllerAxisEvent caxis; /**< Game Controller axis event data */ + SDL_ControllerButtonEvent cbutton; /**< Game Controller button event data */ + SDL_ControllerDeviceEvent cdevice; /**< Game Controller device event data */ + SDL_QuitEvent quit; /**< Quit request event data */ + SDL_UserEvent user; /**< Custom event data */ + SDL_SysWMEvent syswm; /**< System dependent window event data */ + SDL_TouchFingerEvent tfinger; /**< Touch finger event data */ + SDL_MultiGestureEvent mgesture; /**< Gesture event data */ + SDL_DollarGestureEvent dgesture; /**< Gesture event data */ + SDL_DropEvent drop; /**< Drag and drop event data */ + + /* This is necessary for ABI compatibility between Visual C++ and GCC + Visual C++ will respect the push pack pragma and use 52 bytes for + this structure, and GCC will use the alignment of the largest datatype + within the union, which is 8 bytes. + + So... we'll add padding to force the size to be 56 bytes for both. + */ + Uint8 padding[56]; +} SDL_Event; + + +/* Function prototypes */ + +/** + * Pumps the event loop, gathering events from the input devices. + * + * This function updates the event queue and internal input device state. + * + * This should only be run in the thread that sets the video mode. + */ +extern DECLSPEC void SDLCALL SDL_PumpEvents(void); + +/* @{ */ +typedef enum +{ + SDL_ADDEVENT, + SDL_PEEKEVENT, + SDL_GETEVENT +} SDL_eventaction; + +/** + * Checks the event queue for messages and optionally returns them. + * + * If \c action is ::SDL_ADDEVENT, up to \c numevents events will be added to + * the back of the event queue. + * + * If \c action is ::SDL_PEEKEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will not be removed from the queue. + * + * If \c action is ::SDL_GETEVENT, up to \c numevents events at the front + * of the event queue, within the specified minimum and maximum type, + * will be returned and will be removed from the queue. + * + * \return The number of events actually stored, or -1 if there was an error. + * + * This function is thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents, + SDL_eventaction action, + Uint32 minType, Uint32 maxType); +/* @} */ + +/** + * Checks to see if certain event types are in the event queue. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type); +extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType); + +/** + * This function clears events from the event queue + */ +extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type); +extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType); + +/** + * \brief Polls for currently pending events. + * + * \return 1 if there are any pending events, or 0 if there are none available. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event); + +/** + * \brief Waits indefinitely for the next available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + */ +extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event); + +/** + * \brief Waits until the specified timeout (in milliseconds) for the next + * available event. + * + * \return 1, or 0 if there was an error while waiting for events. + * + * \param event If not NULL, the next event is removed from the queue and + * stored in that area. + * \param timeout The timeout (in milliseconds) to wait for next event. + */ +extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event, + int timeout); + +/** + * \brief Add an event to the event queue. + * + * \return 1 on success, 0 if the event was filtered, or -1 if the event queue + * was full or there was some other error. + */ +extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event); + +typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event); + +/** + * Sets up a filter to process all events before they change internal state and + * are posted to the internal event queue. + * + * The filter is prototyped as: + * \code + * int SDL_EventFilter(void *userdata, SDL_Event * event); + * \endcode + * + * If the filter returns 1, then the event will be added to the internal queue. + * If it returns 0, then the event will be dropped from the queue, but the + * internal state will still be updated. This allows selective filtering of + * dynamically arriving events. + * + * \warning Be very careful of what you do in the event filter function, as + * it may run in a different thread! + * + * There is one caveat when dealing with the ::SDL_QuitEvent event type. The + * event filter is only called when the window manager desires to close the + * application window. If the event filter returns 1, then the window will + * be closed, otherwise the window will remain open if possible. + * + * If the quit event is generated by an interrupt signal, it will bypass the + * internal queue and be delivered to the application at the next event poll. + */ +extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter, + void *userdata); + +/** + * Return the current event filter - can be used to "chain" filters. + * If there is no event filter set, this function returns SDL_FALSE. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter, + void **userdata); + +/** + * Add a function which is called when an event is added to the queue. + */ +extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Remove an event watch function added with SDL_AddEventWatch() + */ +extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, + void *userdata); + +/** + * Run the filter function on the current event queue, removing any + * events for which the filter returns 0. + */ +extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter, + void *userdata); + +/* @{ */ +#define SDL_QUERY -1 +#define SDL_IGNORE 0 +#define SDL_DISABLE 0 +#define SDL_ENABLE 1 + +/** + * This function allows you to set the state of processing certain events. + * - If \c state is set to ::SDL_IGNORE, that event will be automatically + * dropped from the event queue and will not event be filtered. + * - If \c state is set to ::SDL_ENABLE, that event will be processed + * normally. + * - If \c state is set to ::SDL_QUERY, SDL_EventState() will return the + * current processing state of the specified event. + */ +extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state); +/* @} */ +#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY) + +/** + * This function allocates a set of user-defined events, and returns + * the beginning event number for that set of events. + * + * If there aren't enough user-defined events left, this function + * returns (Uint32)-1 + */ +extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_events_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_filesystem.h b/SDL/include/SDL_filesystem.h new file mode 100644 index 0000000..ea8a1b5 --- /dev/null +++ b/SDL/include/SDL_filesystem.h @@ -0,0 +1,136 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_filesystem.h + * + * \brief Include file for filesystem SDL API functions + */ + +#ifndef _SDL_filesystem_h +#define _SDL_filesystem_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Get the path where the application resides. + * + * Get the "base path". This is the directory where the application was run + * from, which is probably the installation directory, and may or may not + * be the process's current working directory. + * + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). + * + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. + * + * Some platforms can't determine the application's path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \return String of base dir in UTF-8 encoding, or NULL on error. + * + * \sa SDL_GetPrefPath + */ +extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); + +/** + * \brief Get the user-and-app-specific path where files can be written. + * + * Get the "pref dir". This is meant to be where users can write personal + * files (preferences and save games, etc) that are specific to your + * application. This directory is unique per user, per application. + * + * This function will decide the appropriate location in the native filesystem, + * create the directory if necessary, and return a string of the absolute + * path to the directory in UTF-8 encoding. + * + * On Windows, the string might look like: + * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" + * + * On Linux, the string might look like: + * "/home/bob/.local/share/My Program Name/" + * + * On Mac OS X, the string might look like: + * "/Users/bob/Library/Application Support/My Program Name/" + * + * (etc.) + * + * You specify the name of your organization (if it's not a real organization, + * your name or an Internet domain you own might do) and the name of your + * application. These should be untranslated proper names. + * + * Both the org and app strings may become part of a directory name, so + * please follow these rules: + * + * - Try to use the same org string (including case-sensitivity) for + * all your applications that use this function. + * - Always use a unique app string for each one, and make sure it never + * changes for an app once you've decided on it. + * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - ...only use letters, numbers, and spaces. Avoid punctuation like + * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. + * + * This returns an absolute path in UTF-8 encoding, and is guaranteed to + * end with a path separator ('\\' on Windows, '/' most other places). + * + * The pointer returned by this function is owned by you. Please call + * SDL_free() on the pointer when you are done with it, or it will be a + * memory leak. This is not necessarily a fast call, though, so you should + * call this once near startup and save the string if you need it. + * + * You should assume the path returned by this function is the only safe + * place to write files (and that SDL_GetBasePath(), while it might be + * writable, or even the parent of the returned path, aren't where you + * should be writing things). + * + * Some platforms can't determine the pref path, and on other + * platforms, this might be meaningless. In such cases, this function will + * return NULL. + * + * \param org The name of your organization. + * \param app The name of your application. + * \return UTF-8 string of user dir in platform-dependent notation. NULL + * if there's a problem (creating directory failed, etc). + * + * \sa SDL_GetBasePath + */ +extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_system_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_gamecontroller.h b/SDL/include/SDL_gamecontroller.h new file mode 100644 index 0000000..e55749c --- /dev/null +++ b/SDL/include/SDL_gamecontroller.h @@ -0,0 +1,298 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gamecontroller.h + * + * Include file for SDL game controller event handling + */ + +#ifndef _SDL_gamecontroller_h +#define _SDL_gamecontroller_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_gamecontroller.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for game controllers, and load appropriate drivers. + * + * If you would like to receive controller updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/* The gamecontroller structure used to identify an SDL game controller */ +struct _SDL_GameController; +typedef struct _SDL_GameController SDL_GameController; + + +typedef enum +{ + SDL_CONTROLLER_BINDTYPE_NONE = 0, + SDL_CONTROLLER_BINDTYPE_BUTTON, + SDL_CONTROLLER_BINDTYPE_AXIS, + SDL_CONTROLLER_BINDTYPE_HAT +} SDL_GameControllerBindType; + +/** + * Get the SDL joystick layer binding for this controller button/axis mapping + */ +typedef struct SDL_GameControllerButtonBind +{ + SDL_GameControllerBindType bindType; + union + { + int button; + int axis; + struct { + int hat; + int hat_mask; + } hat; + } value; + +} SDL_GameControllerButtonBind; + + +/** + * To count the number of game controllers in the system for the following: + * int nJoysticks = SDL_NumJoysticks(); + * int nGameControllers = 0; + * for ( int i = 0; i < nJoysticks; i++ ) { + * if ( SDL_IsGameController(i) ) { + * nGameControllers++; + * } + * } + * + * Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is: + * guid,name,mappings + * + * Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones. + * Under Windows there is a reserved GUID of "xinput" that covers any XInput devices. + * The mapping format for joystick is: + * bX - a joystick button, index X + * hX.Y - hat X with value Y + * aX - axis X of the joystick + * Buttons can be used as a controller axis and vice versa. + * + * This string shows an example of a valid mapping for a controller + * "341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7", + * + */ + +/** + * Add or update an existing mapping configuration + * + * \return 1 if mapping is added, 0 if updated, -1 on error + */ +extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingString ); + +/** + * Get a mapping string for a GUID + * + * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid ); + +/** + * Get a mapping string for an open GameController + * + * \return the mapping string. Must be freed with SDL_free. Returns NULL if no mapping is available + */ +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller ); + +/** + * Is the joystick on this index supported by the game controller interface? + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsGameController(int joystick_index); + + +/** + * Get the implementation dependent name of a game controller. + * This can be called before any controllers are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerNameForIndex(int joystick_index); + +/** + * Open a game controller for use. + * The index passed as an argument refers to the N'th game controller on the system. + * This index is the value which will identify this controller in future controller + * events. + * + * \return A controller identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_GameController *SDLCALL SDL_GameControllerOpen(int joystick_index); + +/** + * Return the name for this currently opened controller + */ +extern DECLSPEC const char *SDLCALL SDL_GameControllerName(SDL_GameController *gamecontroller); + +/** + * Returns SDL_TRUE if the controller has been opened and currently connected, + * or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GameControllerGetAttached(SDL_GameController *gamecontroller); + +/** + * Get the underlying joystick object used by a controller + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_GameControllerGetJoystick(SDL_GameController *gamecontroller); + +/** + * Enable/disable controller event polling. + * + * If controller events are disabled, you must call SDL_GameControllerUpdate() + * yourself and check the state of the controller when you want controller + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_GameControllerEventState(int state); + +/** + * Update the current state of the open game controllers. + * + * This is called automatically by the event loop if any game controller + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_GameControllerUpdate(void); + + +/** + * The list of axes available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_AXIS_INVALID = -1, + SDL_CONTROLLER_AXIS_LEFTX, + SDL_CONTROLLER_AXIS_LEFTY, + SDL_CONTROLLER_AXIS_RIGHTX, + SDL_CONTROLLER_AXIS_RIGHTY, + SDL_CONTROLLER_AXIS_TRIGGERLEFT, + SDL_CONTROLLER_AXIS_TRIGGERRIGHT, + SDL_CONTROLLER_AXIS_MAX +} SDL_GameControllerAxis; + +/** + * turn this string into a axis mapping + */ +extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString); + +/** + * turn this axis enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * Get the current state of an axis control on a game controller. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL +SDL_GameControllerGetAxis(SDL_GameController *gamecontroller, + SDL_GameControllerAxis axis); + +/** + * The list of buttons available from a controller + */ +typedef enum +{ + SDL_CONTROLLER_BUTTON_INVALID = -1, + SDL_CONTROLLER_BUTTON_A, + SDL_CONTROLLER_BUTTON_B, + SDL_CONTROLLER_BUTTON_X, + SDL_CONTROLLER_BUTTON_Y, + SDL_CONTROLLER_BUTTON_BACK, + SDL_CONTROLLER_BUTTON_GUIDE, + SDL_CONTROLLER_BUTTON_START, + SDL_CONTROLLER_BUTTON_LEFTSTICK, + SDL_CONTROLLER_BUTTON_RIGHTSTICK, + SDL_CONTROLLER_BUTTON_LEFTSHOULDER, + SDL_CONTROLLER_BUTTON_RIGHTSHOULDER, + SDL_CONTROLLER_BUTTON_DPAD_UP, + SDL_CONTROLLER_BUTTON_DPAD_DOWN, + SDL_CONTROLLER_BUTTON_DPAD_LEFT, + SDL_CONTROLLER_BUTTON_DPAD_RIGHT, + SDL_CONTROLLER_BUTTON_MAX +} SDL_GameControllerButton; + +/** + * turn this string into a button mapping + */ +extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString); + +/** + * turn this button enum into a string mapping + */ +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button); + +/** + * Get the SDL joystick layer binding for this controller button mapping + */ +extern DECLSPEC SDL_GameControllerButtonBind SDLCALL +SDL_GameControllerGetBindForButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + + +/** + * Get the current state of a button on a game controller. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_GameControllerGetButton(SDL_GameController *gamecontroller, + SDL_GameControllerButton button); + +/** + * Close a controller previously opened with SDL_GameControllerOpen(). + */ +extern DECLSPEC void SDLCALL SDL_GameControllerClose(SDL_GameController *gamecontroller); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_gamecontroller_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_gesture.h b/SDL/include/SDL_gesture.h new file mode 100644 index 0000000..21f10ea --- /dev/null +++ b/SDL/include/SDL_gesture.h @@ -0,0 +1,87 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_gesture.h + * + * Include file for SDL gesture event handling. + */ + +#ifndef _SDL_gesture_h +#define _SDL_gesture_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "SDL_touch.h" + + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_GestureID; + +/* Function prototypes */ + +/** + * \brief Begin Recording a gesture on the specified touch, or all touches (-1) + * + * + */ +extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); + + +/** + * \brief Save all currently loaded Dollar Gesture templates + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *src); + +/** + * \brief Save a currently loaded Dollar Gesture template + * + * + */ +extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *src); + + +/** + * \brief Load Dollar Gesture templates from a file + * + * + */ +extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_gesture_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_haptic.h b/SDL/include/SDL_haptic.h new file mode 100644 index 0000000..a029eb9 --- /dev/null +++ b/SDL/include/SDL_haptic.h @@ -0,0 +1,1225 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_haptic.h + * + * \brief The SDL Haptic subsystem allows you to control haptic (force feedback) + * devices. + * + * The basic usage is as follows: + * - Initialize the Subsystem (::SDL_INIT_HAPTIC). + * - Open a Haptic Device. + * - SDL_HapticOpen() to open from index. + * - SDL_HapticOpenFromJoystick() to open from an existing joystick. + * - Create an effect (::SDL_HapticEffect). + * - Upload the effect with SDL_HapticNewEffect(). + * - Run the effect with SDL_HapticRunEffect(). + * - (optional) Free the effect with SDL_HapticDestroyEffect(). + * - Close the haptic device with SDL_HapticClose(). + * + * \par Simple rumble example: + * \code + * SDL_Haptic *haptic; + * + * // Open the device + * haptic = SDL_HapticOpen( 0 ); + * if (haptic == NULL) + * return -1; + * + * // Initialize simple rumble + * if (SDL_HapticRumbleInit( haptic ) != 0) + * return -1; + * + * // Play effect at 50% strength for 2 seconds + * if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) + * return -1; + * SDL_Delay( 2000 ); + * + * // Clean up + * SDL_HapticClose( haptic ); + * \endcode + * + * \par Complete example: + * \code + * int test_haptic( SDL_Joystick * joystick ) { + * SDL_Haptic *haptic; + * SDL_HapticEffect effect; + * int effect_id; + * + * // Open the device + * haptic = SDL_HapticOpenFromJoystick( joystick ); + * if (haptic == NULL) return -1; // Most likely joystick isn't haptic + * + * // See if it can do sine waves + * if ((SDL_HapticQuery(haptic) & SDL_HAPTIC_SINE)==0) { + * SDL_HapticClose(haptic); // No sine effect + * return -1; + * } + * + * // Create the effect + * memset( &effect, 0, sizeof(SDL_HapticEffect) ); // 0 is safe default + * effect.type = SDL_HAPTIC_SINE; + * effect.periodic.direction.type = SDL_HAPTIC_POLAR; // Polar coordinates + * effect.periodic.direction.dir[0] = 18000; // Force comes from south + * effect.periodic.period = 1000; // 1000 ms + * effect.periodic.magnitude = 20000; // 20000/32767 strength + * effect.periodic.length = 5000; // 5 seconds long + * effect.periodic.attack_length = 1000; // Takes 1 second to get max strength + * effect.periodic.fade_length = 1000; // Takes 1 second to fade away + * + * // Upload the effect + * effect_id = SDL_HapticNewEffect( haptic, &effect ); + * + * // Test the effect + * SDL_HapticRunEffect( haptic, effect_id, 1 ); + * SDL_Delay( 5000); // Wait for the effect to finish + * + * // We destroy the effect, although closing the device also does this + * SDL_HapticDestroyEffect( haptic, effect_id ); + * + * // Close the device + * SDL_HapticClose(haptic); + * + * return 0; // Success + * } + * \endcode + * + * You can also find out more information on my blog: + * http://bobbens.dyndns.org/journal/2010/sdl_haptic/ + * + * \author Edgar Simo Serra + */ + +#ifndef _SDL_haptic_h +#define _SDL_haptic_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_joystick.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * \typedef SDL_Haptic + * + * \brief The haptic structure used to identify an SDL haptic. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + */ +struct _SDL_Haptic; +typedef struct _SDL_Haptic SDL_Haptic; + + +/** + * \name Haptic features + * + * Different haptic features a device can have. + */ +/* @{ */ + +/** + * \name Haptic effects + */ +/* @{ */ + +/** + * \brief Constant effect supported. + * + * Constant haptic effect. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_CONSTANT (1<<0) + +/** + * \brief Sine wave effect supported. + * + * Periodic haptic effect that simulates sine waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SINE (1<<1) + +/** + * \brief Left/Right effect supported. + * + * Haptic effect for direct control over high/low frequency motors. + * + * \sa SDL_HapticLeftRight + * \warning this value was SDL_HAPTIC_SQUARE right before 2.0.0 shipped. Sorry, + * we ran out of bits, and this is important for XInput devices. + */ +#define SDL_HAPTIC_LEFTRIGHT (1<<2) + +/* !!! FIXME: put this back when we have more bits in 2.1 */ +/* #define SDL_HAPTIC_SQUARE (1<<2) */ + +/** + * \brief Triangle wave effect supported. + * + * Periodic haptic effect that simulates triangular waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_TRIANGLE (1<<3) + +/** + * \brief Sawtoothup wave effect supported. + * + * Periodic haptic effect that simulates saw tooth up waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHUP (1<<4) + +/** + * \brief Sawtoothdown wave effect supported. + * + * Periodic haptic effect that simulates saw tooth down waves. + * + * \sa SDL_HapticPeriodic + */ +#define SDL_HAPTIC_SAWTOOTHDOWN (1<<5) + +/** + * \brief Ramp effect supported. + * + * Ramp haptic effect. + * + * \sa SDL_HapticRamp + */ +#define SDL_HAPTIC_RAMP (1<<6) + +/** + * \brief Spring effect supported - uses axes position. + * + * Condition haptic effect that simulates a spring. Effect is based on the + * axes position. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_SPRING (1<<7) + +/** + * \brief Damper effect supported - uses axes velocity. + * + * Condition haptic effect that simulates dampening. Effect is based on the + * axes velocity. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_DAMPER (1<<8) + +/** + * \brief Inertia effect supported - uses axes acceleration. + * + * Condition haptic effect that simulates inertia. Effect is based on the axes + * acceleration. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_INERTIA (1<<9) + +/** + * \brief Friction effect supported - uses axes movement. + * + * Condition haptic effect that simulates friction. Effect is based on the + * axes movement. + * + * \sa SDL_HapticCondition + */ +#define SDL_HAPTIC_FRICTION (1<<10) + +/** + * \brief Custom effect is supported. + * + * User defined custom haptic effect. + */ +#define SDL_HAPTIC_CUSTOM (1<<11) + +/* @} *//* Haptic effects */ + +/* These last few are features the device has, not effects */ + +/** + * \brief Device can set global gain. + * + * Device supports setting the global gain. + * + * \sa SDL_HapticSetGain + */ +#define SDL_HAPTIC_GAIN (1<<12) + +/** + * \brief Device can set autocenter. + * + * Device supports setting autocenter. + * + * \sa SDL_HapticSetAutocenter + */ +#define SDL_HAPTIC_AUTOCENTER (1<<13) + +/** + * \brief Device can be queried for effect status. + * + * Device can be queried for effect status. + * + * \sa SDL_HapticGetEffectStatus + */ +#define SDL_HAPTIC_STATUS (1<<14) + +/** + * \brief Device can be paused. + * + * \sa SDL_HapticPause + * \sa SDL_HapticUnpause + */ +#define SDL_HAPTIC_PAUSE (1<<15) + + +/** + * \name Direction encodings + */ +/* @{ */ + +/** + * \brief Uses polar coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_POLAR 0 + +/** + * \brief Uses cartesian coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_CARTESIAN 1 + +/** + * \brief Uses spherical coordinates for the direction. + * + * \sa SDL_HapticDirection + */ +#define SDL_HAPTIC_SPHERICAL 2 + +/* @} *//* Direction encodings */ + +/* @} *//* Haptic features */ + +/* + * Misc defines. + */ + +/** + * \brief Used to play a device an infinite number of times. + * + * \sa SDL_HapticRunEffect + */ +#define SDL_HAPTIC_INFINITY 4294967295U + + +/** + * \brief Structure that represents a haptic direction. + * + * Directions can be specified by: + * - ::SDL_HAPTIC_POLAR : Specified by polar coordinates. + * - ::SDL_HAPTIC_CARTESIAN : Specified by cartesian coordinates. + * - ::SDL_HAPTIC_SPHERICAL : Specified by spherical coordinates. + * + * Cardinal directions of the haptic device are relative to the positioning + * of the device. North is considered to be away from the user. + * + * The following diagram represents the cardinal directions: + * \verbatim + .--. + |__| .-------. + |=.| |.-----.| + |--| || || + | | |'-----'| + |__|~')_____(' + [ COMPUTER ] + + + North (0,-1) + ^ + | + | + (1,0) West <----[ HAPTIC ]----> East (-1,0) + | + | + v + South (0,1) + + + [ USER ] + \|||/ + (o o) + ---ooO-(_)-Ooo--- + \endverbatim + * + * If type is ::SDL_HAPTIC_POLAR, direction is encoded by hundredths of a + * degree starting north and turning clockwise. ::SDL_HAPTIC_POLAR only uses + * the first \c dir parameter. The cardinal directions would be: + * - North: 0 (0 degrees) + * - East: 9000 (90 degrees) + * - South: 18000 (180 degrees) + * - West: 27000 (270 degrees) + * + * If type is ::SDL_HAPTIC_CARTESIAN, direction is encoded by three positions + * (X axis, Y axis and Z axis (with 3 axes)). ::SDL_HAPTIC_CARTESIAN uses + * the first three \c dir parameters. The cardinal directions would be: + * - North: 0,-1, 0 + * - East: -1, 0, 0 + * - South: 0, 1, 0 + * - West: 1, 0, 0 + * + * The Z axis represents the height of the effect if supported, otherwise + * it's unused. In cartesian encoding (1, 2) would be the same as (2, 4), you + * can use any multiple you want, only the direction matters. + * + * If type is ::SDL_HAPTIC_SPHERICAL, direction is encoded by two rotations. + * The first two \c dir parameters are used. The \c dir parameters are as + * follows (all values are in hundredths of degrees): + * - Degrees from (1, 0) rotated towards (0, 1). + * - Degrees towards (0, 0, 1) (device needs at least 3 axes). + * + * + * Example of force coming from the south with all encodings (force coming + * from the south means the user will have to pull the stick to counteract): + * \code + * SDL_HapticDirection direction; + * + * // Cartesian directions + * direction.type = SDL_HAPTIC_CARTESIAN; // Using cartesian direction encoding. + * direction.dir[0] = 0; // X position + * direction.dir[1] = 1; // Y position + * // Assuming the device has 2 axes, we don't need to specify third parameter. + * + * // Polar directions + * direction.type = SDL_HAPTIC_POLAR; // We'll be using polar direction encoding. + * direction.dir[0] = 18000; // Polar only uses first parameter + * + * // Spherical coordinates + * direction.type = SDL_HAPTIC_SPHERICAL; // Spherical encoding + * direction.dir[0] = 9000; // Since we only have two axes we don't need more parameters. + * \endcode + * + * \sa SDL_HAPTIC_POLAR + * \sa SDL_HAPTIC_CARTESIAN + * \sa SDL_HAPTIC_SPHERICAL + * \sa SDL_HapticEffect + * \sa SDL_HapticNumAxes + */ +typedef struct SDL_HapticDirection +{ + Uint8 type; /**< The type of encoding. */ + Sint32 dir[3]; /**< The encoded direction. */ +} SDL_HapticDirection; + + +/** + * \brief A structure containing a template for a Constant effect. + * + * The struct is exclusive to the ::SDL_HAPTIC_CONSTANT effect. + * + * A constant effect applies a constant force in the specified direction + * to the joystick. + * + * \sa SDL_HAPTIC_CONSTANT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticConstant +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CONSTANT */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Constant */ + Sint16 level; /**< Strength of the constant effect. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticConstant; + +/** + * \brief A structure containing a template for a Periodic effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SINE + * - ::SDL_HAPTIC_LEFTRIGHT + * - ::SDL_HAPTIC_TRIANGLE + * - ::SDL_HAPTIC_SAWTOOTHUP + * - ::SDL_HAPTIC_SAWTOOTHDOWN + * + * A periodic effect consists in a wave-shaped effect that repeats itself + * over time. The type determines the shape of the wave and the parameters + * determine the dimensions of the wave. + * + * Phase is given by hundredth of a cycle meaning that giving the phase a value + * of 9000 will displace it 25% of its period. Here are sample values: + * - 0: No phase displacement. + * - 9000: Displaced 25% of its period. + * - 18000: Displaced 50% of its period. + * - 27000: Displaced 75% of its period. + * - 36000: Displaced 100% of its period, same as 0, but 0 is preferred. + * + * Examples: + * \verbatim + SDL_HAPTIC_SINE + __ __ __ __ + / \ / \ / \ / + / \__/ \__/ \__/ + + SDL_HAPTIC_SQUARE + __ __ __ __ __ + | | | | | | | | | | + | |__| |__| |__| |__| | + + SDL_HAPTIC_TRIANGLE + /\ /\ /\ /\ /\ + / \ / \ / \ / \ / + / \/ \/ \/ \/ + + SDL_HAPTIC_SAWTOOTHUP + /| /| /| /| /| /| /| + / | / | / | / | / | / | / | + / |/ |/ |/ |/ |/ |/ | + + SDL_HAPTIC_SAWTOOTHDOWN + \ |\ |\ |\ |\ |\ |\ | + \ | \ | \ | \ | \ | \ | \ | + \| \| \| \| \| \| \| + \endverbatim + * + * \sa SDL_HAPTIC_SINE + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HAPTIC_TRIANGLE + * \sa SDL_HAPTIC_SAWTOOTHUP + * \sa SDL_HAPTIC_SAWTOOTHDOWN + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticPeriodic +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, + ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or + ::SDL_HAPTIC_SAWTOOTHDOWN */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Periodic */ + Uint16 period; /**< Period of the wave. */ + Sint16 magnitude; /**< Peak value. */ + Sint16 offset; /**< Mean value of the wave. */ + Uint16 phase; /**< Horizontal shift given by hundredth of a cycle. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticPeriodic; + +/** + * \brief A structure containing a template for a Condition effect. + * + * The struct handles the following effects: + * - ::SDL_HAPTIC_SPRING: Effect based on axes position. + * - ::SDL_HAPTIC_DAMPER: Effect based on axes velocity. + * - ::SDL_HAPTIC_INERTIA: Effect based on axes acceleration. + * - ::SDL_HAPTIC_FRICTION: Effect based on axes movement. + * + * Direction is handled by condition internals instead of a direction member. + * The condition effect specific members have three parameters. The first + * refers to the X axis, the second refers to the Y axis and the third + * refers to the Z axis. The right terms refer to the positive side of the + * axis and the left terms refer to the negative side of the axis. Please + * refer to the ::SDL_HapticDirection diagram for which side is positive and + * which is negative. + * + * \sa SDL_HapticDirection + * \sa SDL_HAPTIC_SPRING + * \sa SDL_HAPTIC_DAMPER + * \sa SDL_HAPTIC_INERTIA + * \sa SDL_HAPTIC_FRICTION + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCondition +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, + ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION */ + SDL_HapticDirection direction; /**< Direction of the effect - Not used ATM. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Condition */ + Uint16 right_sat[3]; /**< Level when joystick is to the positive side. */ + Uint16 left_sat[3]; /**< Level when joystick is to the negative side. */ + Sint16 right_coeff[3]; /**< How fast to increase the force towards the positive side. */ + Sint16 left_coeff[3]; /**< How fast to increase the force towards the negative side. */ + Uint16 deadband[3]; /**< Size of the dead zone. */ + Sint16 center[3]; /**< Position of the dead zone. */ +} SDL_HapticCondition; + +/** + * \brief A structure containing a template for a Ramp effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_RAMP effect. + * + * The ramp effect starts at start strength and ends at end strength. + * It augments in linear fashion. If you use attack and fade with a ramp + * the effects get added to the ramp effect making the effect become + * quadratic instead of linear. + * + * \sa SDL_HAPTIC_RAMP + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticRamp +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_RAMP */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Ramp */ + Sint16 start; /**< Beginning strength level. */ + Sint16 end; /**< Ending strength level. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticRamp; + +/** + * \brief A structure containing a template for a Left/Right effect. + * + * This struct is exclusively for the ::SDL_HAPTIC_LEFTRIGHT effect. + * + * The Left/Right effect is used to explicitly control the large and small + * motors, commonly found in modern game controllers. One motor is high + * frequency, the other is low frequency. + * + * \sa SDL_HAPTIC_LEFTRIGHT + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticLeftRight +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_LEFTRIGHT */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + + /* Rumble */ + Uint16 large_magnitude; /**< Control of the large controller motor. */ + Uint16 small_magnitude; /**< Control of the small controller motor. */ +} SDL_HapticLeftRight; + +/** + * \brief A structure containing a template for the ::SDL_HAPTIC_CUSTOM effect. + * + * A custom force feedback effect is much like a periodic effect, where the + * application can define its exact shape. You will have to allocate the + * data yourself. Data should consist of channels * samples Uint16 samples. + * + * If channels is one, the effect is rotated using the defined direction. + * Otherwise it uses the samples in data for the different axes. + * + * \sa SDL_HAPTIC_CUSTOM + * \sa SDL_HapticEffect + */ +typedef struct SDL_HapticCustom +{ + /* Header */ + Uint16 type; /**< ::SDL_HAPTIC_CUSTOM */ + SDL_HapticDirection direction; /**< Direction of the effect. */ + + /* Replay */ + Uint32 length; /**< Duration of the effect. */ + Uint16 delay; /**< Delay before starting the effect. */ + + /* Trigger */ + Uint16 button; /**< Button that triggers the effect. */ + Uint16 interval; /**< How soon it can be triggered again after button. */ + + /* Custom */ + Uint8 channels; /**< Axes to use, minimum of one. */ + Uint16 period; /**< Sample periods. */ + Uint16 samples; /**< Amount of samples. */ + Uint16 *data; /**< Should contain channels*samples items. */ + + /* Envelope */ + Uint16 attack_length; /**< Duration of the attack. */ + Uint16 attack_level; /**< Level at the start of the attack. */ + Uint16 fade_length; /**< Duration of the fade. */ + Uint16 fade_level; /**< Level at the end of the fade. */ +} SDL_HapticCustom; + +/** + * \brief The generic template for any haptic effect. + * + * All values max at 32767 (0x7FFF). Signed values also can be negative. + * Time values unless specified otherwise are in milliseconds. + * + * You can also pass ::SDL_HAPTIC_INFINITY to length instead of a 0-32767 + * value. Neither delay, interval, attack_length nor fade_length support + * ::SDL_HAPTIC_INFINITY. Fade will also not be used since effect never ends. + * + * Additionally, the ::SDL_HAPTIC_RAMP effect does not support a duration of + * ::SDL_HAPTIC_INFINITY. + * + * Button triggers may not be supported on all devices, it is advised to not + * use them if possible. Buttons start at index 1 instead of index 0 like + * the joystick. + * + * If both attack_length and fade_level are 0, the envelope is not used, + * otherwise both values are used. + * + * Common parts: + * \code + * // Replay - All effects have this + * Uint32 length; // Duration of effect (ms). + * Uint16 delay; // Delay before starting effect. + * + * // Trigger - All effects have this + * Uint16 button; // Button that triggers effect. + * Uint16 interval; // How soon before effect can be triggered again. + * + * // Envelope - All effects except condition effects have this + * Uint16 attack_length; // Duration of the attack (ms). + * Uint16 attack_level; // Level at the start of the attack. + * Uint16 fade_length; // Duration of the fade out (ms). + * Uint16 fade_level; // Level at the end of the fade. + * \endcode + * + * + * Here we have an example of a constant effect evolution in time: + * \verbatim + Strength + ^ + | + | effect level --> _________________ + | / \ + | / \ + | / \ + | / \ + | attack_level --> | \ + | | | <--- fade_level + | + +--------------------------------------------------> Time + [--] [---] + attack_length fade_length + + [------------------][-----------------------] + delay length + \endverbatim + * + * Note either the attack_level or the fade_level may be above the actual + * effect level. + * + * \sa SDL_HapticConstant + * \sa SDL_HapticPeriodic + * \sa SDL_HapticCondition + * \sa SDL_HapticRamp + * \sa SDL_HapticLeftRight + * \sa SDL_HapticCustom + */ +typedef union SDL_HapticEffect +{ + /* Common for all force feedback effects */ + Uint16 type; /**< Effect type. */ + SDL_HapticConstant constant; /**< Constant effect. */ + SDL_HapticPeriodic periodic; /**< Periodic effect. */ + SDL_HapticCondition condition; /**< Condition effect. */ + SDL_HapticRamp ramp; /**< Ramp effect. */ + SDL_HapticLeftRight leftright; /**< Left/Right effect. */ + SDL_HapticCustom custom; /**< Custom effect. */ +} SDL_HapticEffect; + + +/* Function prototypes */ +/** + * \brief Count the number of haptic devices attached to the system. + * + * \return Number of haptic devices detected on the system. + */ +extern DECLSPEC int SDLCALL SDL_NumHaptics(void); + +/** + * \brief Get the implementation dependent name of a Haptic device. + * + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + * + * \param device_index Index of the device to get its name. + * \return Name of the device or NULL on error. + * + * \sa SDL_NumHaptics + */ +extern DECLSPEC const char *SDLCALL SDL_HapticName(int device_index); + +/** + * \brief Opens a Haptic device for usage. + * + * The index passed as an argument refers to the N'th Haptic device on this + * system. + * + * When opening a haptic device, its gain will be set to maximum and + * autocenter will be disabled. To modify these values use + * SDL_HapticSetGain() and SDL_HapticSetAutocenter(). + * + * \param device_index Index of the device to open. + * \return Device identifier or NULL on error. + * + * \sa SDL_HapticIndex + * \sa SDL_HapticOpenFromMouse + * \sa SDL_HapticOpenFromJoystick + * \sa SDL_HapticClose + * \sa SDL_HapticSetGain + * \sa SDL_HapticSetAutocenter + * \sa SDL_HapticPause + * \sa SDL_HapticStopAll + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpen(int device_index); + +/** + * \brief Checks if the haptic device at index has been opened. + * + * \param device_index Index to check to see if it has been opened. + * \return 1 if it has been opened or 0 if it hasn't. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticIndex + */ +extern DECLSPEC int SDLCALL SDL_HapticOpened(int device_index); + +/** + * \brief Gets the index of a haptic device. + * + * \param haptic Haptic device to get the index of. + * \return The index of the haptic device or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticOpened + */ +extern DECLSPEC int SDLCALL SDL_HapticIndex(SDL_Haptic * haptic); + +/** + * \brief Gets whether or not the current mouse has haptic capabilities. + * + * \return SDL_TRUE if the mouse is haptic, SDL_FALSE if it isn't. + * + * \sa SDL_HapticOpenFromMouse + */ +extern DECLSPEC int SDLCALL SDL_MouseIsHaptic(void); + +/** + * \brief Tries to open a haptic device from the current mouse. + * + * \return The haptic device identifier or NULL on error. + * + * \sa SDL_MouseIsHaptic + * \sa SDL_HapticOpen + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromMouse(void); + +/** + * \brief Checks to see if a joystick has haptic features. + * + * \param joystick Joystick to test for haptic capabilities. + * \return 1 if the joystick is haptic, 0 if it isn't + * or -1 if an error ocurred. + * + * \sa SDL_HapticOpenFromJoystick + */ +extern DECLSPEC int SDLCALL SDL_JoystickIsHaptic(SDL_Joystick * joystick); + +/** + * \brief Opens a Haptic device for usage from a Joystick device. + * + * You must still close the haptic device seperately. It will not be closed + * with the joystick. + * + * When opening from a joystick you should first close the haptic device before + * closing the joystick device. If not, on some implementations the haptic + * device will also get unallocated and you'll be unable to use force feedback + * on that device. + * + * \param joystick Joystick to create a haptic device from. + * \return A valid haptic device identifier on success or NULL on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticClose + */ +extern DECLSPEC SDL_Haptic *SDLCALL SDL_HapticOpenFromJoystick(SDL_Joystick * + joystick); + +/** + * \brief Closes a Haptic device previously opened with SDL_HapticOpen(). + * + * \param haptic Haptic device to close. + */ +extern DECLSPEC void SDLCALL SDL_HapticClose(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can store. + * + * On some platforms this isn't fully supported, and therefore is an + * approximation. Always check to see if your created effect was actually + * created and do not rely solely on SDL_HapticNumEffects(). + * + * \param haptic The haptic device to query effect max. + * \return The number of effects the haptic device can store or + * -1 on error. + * + * \sa SDL_HapticNumEffectsPlaying + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffects(SDL_Haptic * haptic); + +/** + * \brief Returns the number of effects a haptic device can play at the same + * time. + * + * This is not supported on all platforms, but will always return a value. + * Added here for the sake of completeness. + * + * \param haptic The haptic device to query maximum playing effects. + * \return The number of effects the haptic device can play at the same time + * or -1 on error. + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticNumEffectsPlaying(SDL_Haptic * haptic); + +/** + * \brief Gets the haptic devices supported features in bitwise matter. + * + * Example: + * \code + * if (SDL_HapticQuery(haptic) & SDL_HAPTIC_CONSTANT) { + * printf("We have constant haptic effect!"); + * } + * \endcode + * + * \param haptic The haptic device to query. + * \return Haptic features in bitwise manner (OR'd). + * + * \sa SDL_HapticNumEffects + * \sa SDL_HapticEffectSupported + */ +extern DECLSPEC unsigned int SDLCALL SDL_HapticQuery(SDL_Haptic * haptic); + + +/** + * \brief Gets the number of haptic axes the device has. + * + * \sa SDL_HapticDirection + */ +extern DECLSPEC int SDLCALL SDL_HapticNumAxes(SDL_Haptic * haptic); + +/** + * \brief Checks to see if effect is supported by haptic. + * + * \param haptic Haptic device to check on. + * \param effect Effect to check to see if it is supported. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticQuery + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticEffectSupported(SDL_Haptic * haptic, + SDL_HapticEffect * + effect); + +/** + * \brief Creates a new haptic effect on the device. + * + * \param haptic Haptic device to create the effect on. + * \param effect Properties of the effect to create. + * \return The id of the effect on success or -1 on error. + * + * \sa SDL_HapticUpdateEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticNewEffect(SDL_Haptic * haptic, + SDL_HapticEffect * effect); + +/** + * \brief Updates the properties of an effect. + * + * Can be used dynamically, although behaviour when dynamically changing + * direction may be strange. Specifically the effect may reupload itself + * and start playing from the start. You cannot change the type either when + * running SDL_HapticUpdateEffect(). + * + * \param haptic Haptic device that has the effect. + * \param effect Effect to update. + * \param data New effect properties to use. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticNewEffect + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticUpdateEffect(SDL_Haptic * haptic, + int effect, + SDL_HapticEffect * data); + +/** + * \brief Runs the haptic effect on its associated haptic device. + * + * If iterations are ::SDL_HAPTIC_INFINITY, it'll run the effect over and over + * repeating the envelope (attack and fade) every time. If you only want the + * effect to last forever, set ::SDL_HAPTIC_INFINITY in the effect's length + * parameter. + * + * \param haptic Haptic device to run the effect on. + * \param effect Identifier of the haptic effect to run. + * \param iterations Number of iterations to run the effect. Use + * ::SDL_HAPTIC_INFINITY for infinity. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticStopEffect + * \sa SDL_HapticDestroyEffect + * \sa SDL_HapticGetEffectStatus + */ +extern DECLSPEC int SDLCALL SDL_HapticRunEffect(SDL_Haptic * haptic, + int effect, + Uint32 iterations); + +/** + * \brief Stops the haptic effect on its associated haptic device. + * + * \param haptic Haptic device to stop the effect on. + * \param effect Identifier of the effect to stop. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticDestroyEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticStopEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Destroys a haptic effect on the device. + * + * This will stop the effect if it's running. Effects are automatically + * destroyed when the device is closed. + * + * \param haptic Device to destroy the effect on. + * \param effect Identifier of the effect to destroy. + * + * \sa SDL_HapticNewEffect + */ +extern DECLSPEC void SDLCALL SDL_HapticDestroyEffect(SDL_Haptic * haptic, + int effect); + +/** + * \brief Gets the status of the current effect on the haptic device. + * + * Device must support the ::SDL_HAPTIC_STATUS feature. + * + * \param haptic Haptic device to query the effect status on. + * \param effect Identifier of the effect to query its status. + * \return 0 if it isn't playing, 1 if it is playing or -1 on error. + * + * \sa SDL_HapticRunEffect + * \sa SDL_HapticStopEffect + */ +extern DECLSPEC int SDLCALL SDL_HapticGetEffectStatus(SDL_Haptic * haptic, + int effect); + +/** + * \brief Sets the global gain of the device. + * + * Device must support the ::SDL_HAPTIC_GAIN feature. + * + * The user may specify the maximum gain by setting the environment variable + * SDL_HAPTIC_GAIN_MAX which should be between 0 and 100. All calls to + * SDL_HapticSetGain() will scale linearly using SDL_HAPTIC_GAIN_MAX as the + * maximum. + * + * \param haptic Haptic device to set the gain on. + * \param gain Value to set the gain to, should be between 0 and 100. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetGain(SDL_Haptic * haptic, int gain); + +/** + * \brief Sets the global autocenter of the device. + * + * Autocenter should be between 0 and 100. Setting it to 0 will disable + * autocentering. + * + * Device must support the ::SDL_HAPTIC_AUTOCENTER feature. + * + * \param haptic Haptic device to set autocentering on. + * \param autocenter Value to set autocenter to, 0 disables autocentering. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticQuery + */ +extern DECLSPEC int SDLCALL SDL_HapticSetAutocenter(SDL_Haptic * haptic, + int autocenter); + +/** + * \brief Pauses a haptic device. + * + * Device must support the ::SDL_HAPTIC_PAUSE feature. Call + * SDL_HapticUnpause() to resume playback. + * + * Do not modify the effects nor add new ones while the device is paused. + * That can cause all sorts of weird errors. + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticUnpause + */ +extern DECLSPEC int SDLCALL SDL_HapticPause(SDL_Haptic * haptic); + +/** + * \brief Unpauses a haptic device. + * + * Call to unpause after SDL_HapticPause(). + * + * \param haptic Haptic device to pause. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticPause + */ +extern DECLSPEC int SDLCALL SDL_HapticUnpause(SDL_Haptic * haptic); + +/** + * \brief Stops all the currently playing effects on a haptic device. + * + * \param haptic Haptic device to stop. + * \return 0 on success or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_HapticStopAll(SDL_Haptic * haptic); + +/** + * \brief Checks to see if rumble is supported on a haptic device. + * + * \param haptic Haptic device to check to see if it supports rumble. + * \return SDL_TRUE if effect is supported, SDL_FALSE if it isn't or -1 on error. + * + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleSupported(SDL_Haptic * haptic); + +/** + * \brief Initializes the haptic device for simple rumble playback. + * + * \param haptic Haptic device to initialize for simple rumble playback. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticOpen + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumblePlay + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleInit(SDL_Haptic * haptic); + +/** + * \brief Runs simple rumble on a haptic device + * + * \param haptic Haptic device to play rumble effect on. + * \param strength Strength of the rumble to play as a 0-1 float value. + * \param length Length of the rumble to play in milliseconds. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumbleStop + */ +extern DECLSPEC int SDLCALL SDL_HapticRumblePlay(SDL_Haptic * haptic, float strength, Uint32 length ); + +/** + * \brief Stops the simple rumble on a haptic device. + * + * \param haptic Haptic to stop the rumble on. + * \return 0 on success or -1 on error. + * + * \sa SDL_HapticRumbleSupported + * \sa SDL_HapticRumbleInit + * \sa SDL_HapticRumblePlay + */ +extern DECLSPEC int SDLCALL SDL_HapticRumbleStop(SDL_Haptic * haptic); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_haptic_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_hints.h b/SDL/include/SDL_hints.h new file mode 100644 index 0000000..dac928e --- /dev/null +++ b/SDL/include/SDL_hints.h @@ -0,0 +1,355 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_hints.h + * + * Official documentation for SDL configuration variables + * + * This file contains functions to set and get configuration hints, + * as well as listing each of them alphabetically. + * + * The convention for naming hints is SDL_HINT_X, where "SDL_X" is + * the environment variable that can be used to override the default. + * + * In general these hints are just that - they may or may not be + * supported or applicable on any given platform, but they provide + * a way for an application or user to give the library a hint as + * to how they would like the library to work. + */ + +#ifndef _SDL_hints_h +#define _SDL_hints_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief A variable controlling how 3D acceleration is used to accelerate the SDL screen surface. + * + * SDL can try to accelerate the SDL screen surface by using streaming + * textures with a 3D rendering engine. This variable controls whether and + * how this is done. + * + * This variable can be set to the following values: + * "0" - Disable 3D acceleration + * "1" - Enable 3D acceleration, using the default renderer. + * "X" - Enable 3D acceleration, using X where X is one of the valid rendering drivers. (e.g. "direct3d", "opengl", etc.) + * + * By default SDL tries to make a best guess for each platform whether + * to use acceleration or not. + */ +#define SDL_HINT_FRAMEBUFFER_ACCELERATION "SDL_FRAMEBUFFER_ACCELERATION" + +/** + * \brief A variable specifying which render driver to use. + * + * If the application doesn't pick a specific renderer to use, this variable + * specifies the name of the preferred renderer. If the preferred renderer + * can't be initialized, the normal default renderer is used. + * + * This variable is case insensitive and can be set to the following values: + * "direct3d" + * "opengl" + * "opengles2" + * "opengles" + * "software" + * + * The default varies by platform, but it's the first one in the list that + * is available on the current platform. + */ +#define SDL_HINT_RENDER_DRIVER "SDL_RENDER_DRIVER" + +/** + * \brief A variable controlling whether the OpenGL render driver uses shaders if they are available. + * + * This variable can be set to the following values: + * "0" - Disable shaders + * "1" - Enable shaders + * + * By default shaders are used if OpenGL supports them. + */ +#define SDL_HINT_RENDER_OPENGL_SHADERS "SDL_RENDER_OPENGL_SHADERS" + +/** + * \brief A variable controlling whether the Direct3D device is initialized for thread-safe operations. + * + * This variable can be set to the following values: + * "0" - Thread-safety is not enabled (faster) + * "1" - Thread-safety is enabled + * + * By default the Direct3D device is created with thread-safety disabled. + */ +#define SDL_HINT_RENDER_DIRECT3D_THREADSAFE "SDL_RENDER_DIRECT3D_THREADSAFE" + +/** + * \brief A variable controlling the scaling quality + * + * This variable can be set to the following values: + * "0" or "nearest" - Nearest pixel sampling + * "1" or "linear" - Linear filtering (supported by OpenGL and Direct3D) + * "2" or "best" - Currently this is the same as "linear" + * + * By default nearest pixel sampling is used + */ +#define SDL_HINT_RENDER_SCALE_QUALITY "SDL_RENDER_SCALE_QUALITY" + +/** + * \brief A variable controlling whether updates to the SDL screen surface should be synchronized with the vertical refresh, to avoid tearing. + * + * This variable can be set to the following values: + * "0" - Disable vsync + * "1" - Enable vsync + * + * By default SDL does not sync screen surface updates with vertical refresh. + */ +#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC" + +/** + * \brief A variable controlling whether the X11 VidMode extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XVidMode + * "1" - Enable XVidMode + * + * By default SDL will use XVidMode if it is available. + */ +#define SDL_HINT_VIDEO_X11_XVIDMODE "SDL_VIDEO_X11_XVIDMODE" + +/** + * \brief A variable controlling whether the X11 Xinerama extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable Xinerama + * "1" - Enable Xinerama + * + * By default SDL will use Xinerama if it is available. + */ +#define SDL_HINT_VIDEO_X11_XINERAMA "SDL_VIDEO_X11_XINERAMA" + +/** + * \brief A variable controlling whether the X11 XRandR extension should be used. + * + * This variable can be set to the following values: + * "0" - Disable XRandR + * "1" - Enable XRandR + * + * By default SDL will not use XRandR because of window manager issues. + */ +#define SDL_HINT_VIDEO_X11_XRANDR "SDL_VIDEO_X11_XRANDR" + +/** + * \brief A variable controlling whether grabbing input grabs the keyboard + * + * This variable can be set to the following values: + * "0" - Grab will affect only the mouse + * "1" - Grab will affect mouse and keyboard + * + * By default SDL will not grab the keyboard so system shortcuts still work. + */ +#define SDL_HINT_GRAB_KEYBOARD "SDL_GRAB_KEYBOARD" + +/** + * \brief Minimize your SDL_Window if it loses key focus when in Fullscreen mode. Defaults to true. + * + */ +#define SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS "SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS" + + +/** + * \brief A variable controlling whether the idle timer is disabled on iOS. + * + * When an iOS app does not receive touches for some time, the screen is + * dimmed automatically. For games where the accelerometer is the only input + * this is problematic. This functionality can be disabled by setting this + * hint. + * + * This variable can be set to the following values: + * "0" - Enable idle timer + * "1" - Disable idle timer + */ +#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED" + +/** + * \brief A variable controlling which orientations are allowed on iOS. + * + * In some circumstances it is necessary to be able to explicitly control + * which UI orientations are allowed. + * + * This variable is a space delimited list of the following values: + * "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown" + */ +#define SDL_HINT_ORIENTATIONS "SDL_IOS_ORIENTATIONS" + + +/** + * \brief A variable that lets you disable the detection and use of Xinput gamepad devices + * + * The variable can be set to the following values: + * "0" - Disable XInput timer (only uses direct input) + * "1" - Enable XInput timer (the default) + */ +#define SDL_HINT_XINPUT_ENABLED "SDL_XINPUT_ENABLED" + + +/** + * \brief A variable that lets you manually hint extra gamecontroller db entries + * + * The variable should be newline delimited rows of gamecontroller config data, see SDL_gamecontroller.h + * + * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER) + * You can update mappings after the system is initialized with SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping() + */ +#define SDL_HINT_GAMECONTROLLERCONFIG "SDL_GAMECONTROLLERCONFIG" + + +/** + * \brief A variable that lets you enable joystick (and gamecontroller) events even when your app is in the background. + * + * The variable can be set to the following values: + * "0" - Disable joystick & gamecontroller input events when the + * application is in the background. + * "1" - Enable joystick & gamecontroller input events when the + * application is in the backgroumd. + * + * The default value is "0". This hint may be set at any time. + */ +#define SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS "SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS" + + +/** + * \brief If set to 0 then never set the top most bit on a SDL Window, even if the video mode expects it. + * This is a debugging aid for developers and not expected to be used by end users. The default is "1" + * + * This variable can be set to the following values: + * "0" - don't allow topmost + * "1" - allow topmost + */ +#define SDL_HINT_ALLOW_TOPMOST "SDL_ALLOW_TOPMOST" + + +/** + * \brief A variable that controls the timer resolution, in milliseconds. + * + * The higher resolution the timer, the more frequently the CPU services + * timer interrupts, and the more precise delays are, but this takes up + * power and CPU time. This hint is only used on Windows 7 and earlier. + * + * See this blog post for more information: + * http://randomascii.wordpress.com/2013/07/08/windows-timer-resolution-megawatts-wasted/ + * + * If this variable is set to "0", the system timer resolution is not set. + * + * The default value is "1". This hint may be set at any time. + */ +#define SDL_HINT_TIMER_RESOLUTION "SDL_TIMER_RESOLUTION" + + +/** + * \brief If set to 1, then do not allow high-DPI windows. ("Retina" on Mac) + */ +#define SDL_HINT_VIDEO_HIGHDPI_DISABLED "SDL_VIDEO_HIGHDPI_DISABLED" + + +/** + * \brief An enumeration of hint priorities + */ +typedef enum +{ + SDL_HINT_DEFAULT, + SDL_HINT_NORMAL, + SDL_HINT_OVERRIDE +} SDL_HintPriority; + + +/** + * \brief Set a hint with a specific priority + * + * The priority controls the behavior when setting a hint that already + * has a value. Hints will replace existing hints of their priority and + * lower. Environment variables are considered to have override priority. + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name, + const char *value, + SDL_HintPriority priority); + +/** + * \brief Set a hint with normal priority + * + * \return SDL_TRUE if the hint was set, SDL_FALSE otherwise + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name, + const char *value); + +/** + * \brief Get a hint + * + * \return The string value of a hint variable. + */ +extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name); + +/** + * \brief Add a function to watch a particular hint + * + * \param name The hint to watch + * \param callback The function to call when the hint value changes + * \param userdata A pointer to pass to the callback function + */ +typedef void (*SDL_HintCallback)(void *userdata, const char *name, const char *oldValue, const char *newValue); +extern DECLSPEC void SDLCALL SDL_AddHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Remove a function watching a particular hint + * + * \param name The hint being watched + * \param callback The function being called when the hint value changes + * \param userdata A pointer being passed to the callback function + */ +extern DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name, + SDL_HintCallback callback, + void *userdata); + +/** + * \brief Clear all hints + * + * This function is called during SDL_Quit() to free stored hints. + */ +extern DECLSPEC void SDLCALL SDL_ClearHints(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_hints_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_image.h b/SDL/include/SDL_image.h new file mode 100644 index 0000000..8862a12 --- /dev/null +++ b/SDL/include/SDL_image.h @@ -0,0 +1,145 @@ +/* + SDL_image: An example image loading library for use with SDL + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* A simple library to load images of various formats as SDL surfaces */ + +#ifndef _SDL_IMAGE_H +#define _SDL_IMAGE_H + +#include "SDL.h" +#include "SDL_version.h" +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_IMAGE_MAJOR_VERSION 2 +#define SDL_IMAGE_MINOR_VERSION 0 +#define SDL_IMAGE_PATCHLEVEL 0 + +/* This macro can be used to fill a version structure with the compile-time + * version of the SDL_image library. + */ +#define SDL_IMAGE_VERSION(X) \ +{ \ + (X)->major = SDL_IMAGE_MAJOR_VERSION; \ + (X)->minor = SDL_IMAGE_MINOR_VERSION; \ + (X)->patch = SDL_IMAGE_PATCHLEVEL; \ +} + +/* This function gets the version of the dynamically linked SDL_image library. + it should NOT be used to fill a version structure, instead you should + use the SDL_IMAGE_VERSION() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void); + +typedef enum +{ + IMG_INIT_JPG = 0x00000001, + IMG_INIT_PNG = 0x00000002, + IMG_INIT_TIF = 0x00000004, + IMG_INIT_WEBP = 0x00000008 +} IMG_InitFlags; + +/* Loads dynamic libraries and prepares them for use. Flags should be + one or more flags from IMG_InitFlags OR'd together. + It returns the flags successfully initialized, or 0 on failure. + */ +extern DECLSPEC int SDLCALL IMG_Init(int flags); + +/* Unloads libraries loaded with IMG_Init */ +extern DECLSPEC void SDLCALL IMG_Quit(void); + +/* Load an image from an SDL data source. + The 'type' may be one of: "BMP", "GIF", "PNG", etc. + + If the image format supports a transparent pixel, SDL will set the + colorkey for the surface. You can enable RLE acceleration on the + surface afterwards by calling: + SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey); + */ +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, const char *type); +/* Convenience functions */ +extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file); +extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc); + +#if SDL_VERSION_ATLEAST(2,0,0) +/* Load an image directly into a render texture. + */ +extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer, const char *file); +extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc); +extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc, const char *type); +#endif /* SDL 2.0 */ + +/* Functions to detect a file type, given a seekable source */ +extern DECLSPEC int SDLCALL IMG_isICO(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isCUR(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src); +extern DECLSPEC int SDLCALL IMG_isWEBP(SDL_RWops *src); + +/* Individual loading functions */ +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadCUR_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadWEBP_RW(SDL_RWops *src); + +extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm); + +/* Individual saving functions */ +extern DECLSPEC int SDLCALL IMG_SavePNG(SDL_Surface *surface, const char *file); +extern DECLSPEC int SDLCALL IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst); + +/* We'll use SDL for reporting errors */ +#define IMG_SetError SDL_SetError +#define IMG_GetError SDL_GetError + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_IMAGE_H */ diff --git a/SDL/include/SDL_joystick.h b/SDL/include/SDL_joystick.h new file mode 100644 index 0000000..b0e4b5d --- /dev/null +++ b/SDL/include/SDL_joystick.h @@ -0,0 +1,253 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_joystick.h + * + * Include file for SDL joystick event handling + * + * The term "device_index" identifies currently plugged in joystick devices between 0 and SDL_NumJoysticks, with the exact joystick + * behind a device_index changing as joysticks are plugged and unplugged. + * + * The term "instance_id" is the current instantiation of a joystick device in the system, if the joystick is removed and then re-inserted + * then it will get a new instance_id, instance_id's are monotonically increasing identifiers of a joystick plugged in. + * + * The term JoystickGUID is a stable 128-bit identifier for a joystick device that does not change over time, it identifies class of + * the device (a X360 wired controller for example). This identifier is platform dependent. + * + * + */ + +#ifndef _SDL_joystick_h +#define _SDL_joystick_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_joystick.h + * + * In order to use these functions, SDL_Init() must have been called + * with the ::SDL_INIT_JOYSTICK flag. This causes SDL to scan the system + * for joysticks, and load appropriate drivers. + * + * If you would like to receive joystick updates while the application + * is in the background, you should set the following hint before calling + * SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS + */ + +/* The joystick structure used to identify an SDL joystick */ +struct _SDL_Joystick; +typedef struct _SDL_Joystick SDL_Joystick; + +/* A structure that encodes the stable unique id for a joystick device */ +typedef struct { + Uint8 data[16]; +} SDL_JoystickGUID; + +typedef Sint32 SDL_JoystickID; + + +/* Function prototypes */ +/** + * Count the number of joysticks attached to the system right now + */ +extern DECLSPEC int SDLCALL SDL_NumJoysticks(void); + +/** + * Get the implementation dependent name of a joystick. + * This can be called before any joysticks are opened. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickNameForIndex(int device_index); + +/** + * Open a joystick for use. + * The index passed as an argument refers tothe N'th joystick on the system. + * This index is the value which will identify this joystick in future joystick + * events. + * + * \return A joystick identifier, or NULL if an error occurred. + */ +extern DECLSPEC SDL_Joystick *SDLCALL SDL_JoystickOpen(int device_index); + +/** + * Return the name for this currently opened joystick. + * If no name can be found, this function returns NULL. + */ +extern DECLSPEC const char *SDLCALL SDL_JoystickName(SDL_Joystick * joystick); + +/** + * Return the GUID for the joystick at this index + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetDeviceGUID(int device_index); + +/** + * Return the GUID for this opened joystick + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUID(SDL_Joystick * joystick); + +/** + * Return a string representation for this guid. pszGUID must point to at least 33 bytes + * (32 for the string plus a NULL terminator). + */ +extern DECLSPEC void SDL_JoystickGetGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); + +/** + * convert a string into a joystick formatted guid + */ +extern DECLSPEC SDL_JoystickGUID SDLCALL SDL_JoystickGetGUIDFromString(const char *pchGUID); + +/** + * Returns SDL_TRUE if the joystick has been opened and currently connected, or SDL_FALSE if it has not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_JoystickGetAttached(SDL_Joystick * joystick); + +/** + * Get the instance ID of an opened joystick or -1 if the joystick is invalid. + */ +extern DECLSPEC SDL_JoystickID SDLCALL SDL_JoystickInstanceID(SDL_Joystick * joystick); + +/** + * Get the number of general axis controls on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumAxes(SDL_Joystick * joystick); + +/** + * Get the number of trackballs on a joystick. + * + * Joystick trackballs have only relative motion events associated + * with them and their state cannot be polled. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumBalls(SDL_Joystick * joystick); + +/** + * Get the number of POV hats on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumHats(SDL_Joystick * joystick); + +/** + * Get the number of buttons on a joystick. + */ +extern DECLSPEC int SDLCALL SDL_JoystickNumButtons(SDL_Joystick * joystick); + +/** + * Update the current state of the open joysticks. + * + * This is called automatically by the event loop if any joystick + * events are enabled. + */ +extern DECLSPEC void SDLCALL SDL_JoystickUpdate(void); + +/** + * Enable/disable joystick event polling. + * + * If joystick events are disabled, you must call SDL_JoystickUpdate() + * yourself and check the state of the joystick when you want joystick + * information. + * + * The state can be one of ::SDL_QUERY, ::SDL_ENABLE or ::SDL_IGNORE. + */ +extern DECLSPEC int SDLCALL SDL_JoystickEventState(int state); + +/** + * Get the current state of an axis control on a joystick. + * + * The state is a value ranging from -32768 to 32767. + * + * The axis indices start at index 0. + */ +extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick, + int axis); + +/** + * \name Hat positions + */ +/* @{ */ +#define SDL_HAT_CENTERED 0x00 +#define SDL_HAT_UP 0x01 +#define SDL_HAT_RIGHT 0x02 +#define SDL_HAT_DOWN 0x04 +#define SDL_HAT_LEFT 0x08 +#define SDL_HAT_RIGHTUP (SDL_HAT_RIGHT|SDL_HAT_UP) +#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN) +#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP) +#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN) +/* @} */ + +/** + * Get the current state of a POV hat on a joystick. + * + * The hat indices start at index 0. + * + * \return The return value is one of the following positions: + * - ::SDL_HAT_CENTERED + * - ::SDL_HAT_UP + * - ::SDL_HAT_RIGHT + * - ::SDL_HAT_DOWN + * - ::SDL_HAT_LEFT + * - ::SDL_HAT_RIGHTUP + * - ::SDL_HAT_RIGHTDOWN + * - ::SDL_HAT_LEFTUP + * - ::SDL_HAT_LEFTDOWN + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetHat(SDL_Joystick * joystick, + int hat); + +/** + * Get the ball axis change since the last poll. + * + * \return 0, or -1 if you passed it invalid parameters. + * + * The ball indices start at index 0. + */ +extern DECLSPEC int SDLCALL SDL_JoystickGetBall(SDL_Joystick * joystick, + int ball, int *dx, int *dy); + +/** + * Get the current state of a button on a joystick. + * + * The button indices start at index 0. + */ +extern DECLSPEC Uint8 SDLCALL SDL_JoystickGetButton(SDL_Joystick * joystick, + int button); + +/** + * Close a joystick previously opened with SDL_JoystickOpen(). + */ +extern DECLSPEC void SDLCALL SDL_JoystickClose(SDL_Joystick * joystick); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_joystick_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_keyboard.h b/SDL/include/SDL_keyboard.h new file mode 100644 index 0000000..e10f9fd --- /dev/null +++ b/SDL/include/SDL_keyboard.h @@ -0,0 +1,217 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keyboard.h + * + * Include file for SDL keyboard event handling + */ + +#ifndef _SDL_keyboard_h +#define _SDL_keyboard_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_keycode.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The SDL keysym structure, used in key events. + * + * \note If you are looking for translated character input, see the ::SDL_TEXTINPUT event. + */ +typedef struct SDL_Keysym +{ + SDL_Scancode scancode; /**< SDL physical key code - see ::SDL_Scancode for details */ + SDL_Keycode sym; /**< SDL virtual key code - see ::SDL_Keycode for details */ + Uint16 mod; /**< current key modifiers */ + Uint32 unused; +} SDL_Keysym; + +/* Function prototypes */ + +/** + * \brief Get the window which currently has keyboard focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); + +/** + * \brief Get a snapshot of the current state of the keyboard. + * + * \param numkeys if non-NULL, receives the length of the returned array. + * + * \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values. + * + * \b Example: + * \code + * const Uint8 *state = SDL_GetKeyboardState(NULL); + * if ( state[SDL_SCANCODE_RETURN] ) { + * printf(" is pressed.\n"); + * } + * \endcode + */ +extern DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); + +/** + * \brief Get the current key modifier state for the keyboard. + */ +extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void); + +/** + * \brief Set the current key modifier state for the keyboard. + * + * \note This does not change the keyboard state, only the key modifier flags. + */ +extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); + +/** + * \brief Get the key code corresponding to the given scancode according + * to the current keyboard layout. + * + * See ::SDL_Keycode for details. + * + * \sa SDL_GetKeyName() + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); + +/** + * \brief Get the scancode corresponding to the given key code according to the + * current keyboard layout. + * + * See ::SDL_Scancode for details. + * + * \sa SDL_GetScancodeName() + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); + +/** + * \brief Get a human-readable name for a scancode. + * + * \return A pointer to the name for the scancode. + * If the scancode doesn't have a name, this function returns + * an empty string (""). + * + * \sa SDL_Scancode + */ +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); + +/** + * \brief Get a scancode from a human-readable name + * + * \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Scancode + */ +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name); + +/** + * \brief Get a human-readable name for a key. + * + * \return A pointer to a UTF-8 string that stays valid at least until the next + * call to this function. If you need it around any longer, you must + * copy it. If the key doesn't have a name, this function returns an + * empty string (""). + * + * \sa SDL_Key + */ +extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); + +/** + * \brief Get a key code from a human-readable name + * + * \return key code, or SDLK_UNKNOWN if the name wasn't recognized + * + * \sa SDL_Keycode + */ +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); + +/** + * \brief Start accepting Unicode text input events. + * This function will show the on-screen keyboard if supported. + * + * \sa SDL_StopTextInput() + * \sa SDL_SetTextInputRect() + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC void SDLCALL SDL_StartTextInput(void); + +/** + * \brief Return whether or not Unicode text input events are enabled. + * + * \sa SDL_StartTextInput() + * \sa SDL_StopTextInput() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsTextInputActive(void); + +/** + * \brief Stop receiving any text input events. + * This function will hide the on-screen keyboard if supported. + * + * \sa SDL_StartTextInput() + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC void SDLCALL SDL_StopTextInput(void); + +/** + * \brief Set the rectangle used to type Unicode text inputs. + * This is used as a hint for IME and on-screen keyboard placement. + * + * \sa SDL_StartTextInput() + */ +extern DECLSPEC void SDLCALL SDL_SetTextInputRect(SDL_Rect *rect); + +/** + * \brief Returns whether the platform has some screen keyboard support. + * + * \return SDL_TRUE if some keyboard support is available else SDL_FALSE. + * + * \note Not all screen keyboard functions are supported on all platforms. + * + * \sa SDL_IsScreenKeyboardShown() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasScreenKeyboardSupport(void); + +/** + * \brief Returns whether the screen keyboard is shown for given window. + * + * \param window The window for which screen keyboard should be queried. + * + * \return SDL_TRUE if screen keyboard is shown else SDL_FALSE. + * + * \sa SDL_HasScreenKeyboardSupport() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenKeyboardShown(SDL_Window *window); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_keyboard_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_keycode.h b/SDL/include/SDL_keycode.h new file mode 100644 index 0000000..de584e1 --- /dev/null +++ b/SDL/include/SDL_keycode.h @@ -0,0 +1,341 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_keycode.h + * + * Defines constants which identify keyboard keys and modifiers. + */ + +#ifndef _SDL_keycode_h +#define _SDL_keycode_h + +#include "SDL_stdinc.h" +#include "SDL_scancode.h" + +/** + * \brief The SDL virtual key representation. + * + * Values of this type are used to represent keyboard keys using the current + * layout of the keyboard. These values include Unicode values representing + * the unmodified character that would be generated by pressing the key, or + * an SDLK_* constant for those keys that do not generate characters. + */ +typedef Sint32 SDL_Keycode; + +#define SDLK_SCANCODE_MASK (1<<30) +#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) + +enum +{ + SDLK_UNKNOWN = 0, + + SDLK_RETURN = '\r', + SDLK_ESCAPE = '\033', + SDLK_BACKSPACE = '\b', + SDLK_TAB = '\t', + SDLK_SPACE = ' ', + SDLK_EXCLAIM = '!', + SDLK_QUOTEDBL = '"', + SDLK_HASH = '#', + SDLK_PERCENT = '%', + SDLK_DOLLAR = '$', + SDLK_AMPERSAND = '&', + SDLK_QUOTE = '\'', + SDLK_LEFTPAREN = '(', + SDLK_RIGHTPAREN = ')', + SDLK_ASTERISK = '*', + SDLK_PLUS = '+', + SDLK_COMMA = ',', + SDLK_MINUS = '-', + SDLK_PERIOD = '.', + SDLK_SLASH = '/', + SDLK_0 = '0', + SDLK_1 = '1', + SDLK_2 = '2', + SDLK_3 = '3', + SDLK_4 = '4', + SDLK_5 = '5', + SDLK_6 = '6', + SDLK_7 = '7', + SDLK_8 = '8', + SDLK_9 = '9', + SDLK_COLON = ':', + SDLK_SEMICOLON = ';', + SDLK_LESS = '<', + SDLK_EQUALS = '=', + SDLK_GREATER = '>', + SDLK_QUESTION = '?', + SDLK_AT = '@', + /* + Skip uppercase letters + */ + SDLK_LEFTBRACKET = '[', + SDLK_BACKSLASH = '\\', + SDLK_RIGHTBRACKET = ']', + SDLK_CARET = '^', + SDLK_UNDERSCORE = '_', + SDLK_BACKQUOTE = '`', + SDLK_a = 'a', + SDLK_b = 'b', + SDLK_c = 'c', + SDLK_d = 'd', + SDLK_e = 'e', + SDLK_f = 'f', + SDLK_g = 'g', + SDLK_h = 'h', + SDLK_i = 'i', + SDLK_j = 'j', + SDLK_k = 'k', + SDLK_l = 'l', + SDLK_m = 'm', + SDLK_n = 'n', + SDLK_o = 'o', + SDLK_p = 'p', + SDLK_q = 'q', + SDLK_r = 'r', + SDLK_s = 's', + SDLK_t = 't', + SDLK_u = 'u', + SDLK_v = 'v', + SDLK_w = 'w', + SDLK_x = 'x', + SDLK_y = 'y', + SDLK_z = 'z', + + SDLK_CAPSLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK), + + SDLK_F1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1), + SDLK_F2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2), + SDLK_F3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3), + SDLK_F4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4), + SDLK_F5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5), + SDLK_F6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6), + SDLK_F7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7), + SDLK_F8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8), + SDLK_F9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9), + SDLK_F10 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10), + SDLK_F11 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11), + SDLK_F12 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12), + + SDLK_PRINTSCREEN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN), + SDLK_SCROLLLOCK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK), + SDLK_PAUSE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE), + SDLK_INSERT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT), + SDLK_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME), + SDLK_PAGEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP), + SDLK_DELETE = '\177', + SDLK_END = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END), + SDLK_PAGEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN), + SDLK_RIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT), + SDLK_LEFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT), + SDLK_DOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN), + SDLK_UP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP), + + SDLK_NUMLOCKCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR), + SDLK_KP_DIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE), + SDLK_KP_MULTIPLY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY), + SDLK_KP_MINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS), + SDLK_KP_PLUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS), + SDLK_KP_ENTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER), + SDLK_KP_1 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1), + SDLK_KP_2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2), + SDLK_KP_3 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3), + SDLK_KP_4 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4), + SDLK_KP_5 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5), + SDLK_KP_6 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6), + SDLK_KP_7 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7), + SDLK_KP_8 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8), + SDLK_KP_9 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9), + SDLK_KP_0 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0), + SDLK_KP_PERIOD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD), + + SDLK_APPLICATION = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION), + SDLK_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER), + SDLK_KP_EQUALS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS), + SDLK_F13 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13), + SDLK_F14 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14), + SDLK_F15 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15), + SDLK_F16 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16), + SDLK_F17 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17), + SDLK_F18 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18), + SDLK_F19 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19), + SDLK_F20 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20), + SDLK_F21 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21), + SDLK_F22 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22), + SDLK_F23 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23), + SDLK_F24 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24), + SDLK_EXECUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE), + SDLK_HELP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP), + SDLK_MENU = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU), + SDLK_SELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT), + SDLK_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP), + SDLK_AGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN), + SDLK_UNDO = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO), + SDLK_CUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT), + SDLK_COPY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY), + SDLK_PASTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE), + SDLK_FIND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND), + SDLK_MUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE), + SDLK_VOLUMEUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP), + SDLK_VOLUMEDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN), + SDLK_KP_COMMA = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA), + SDLK_KP_EQUALSAS400 = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400), + + SDLK_ALTERASE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE), + SDLK_SYSREQ = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ), + SDLK_CANCEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL), + SDLK_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR), + SDLK_PRIOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR), + SDLK_RETURN2 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2), + SDLK_SEPARATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR), + SDLK_OUT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT), + SDLK_OPER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER), + SDLK_CLEARAGAIN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN), + SDLK_CRSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL), + SDLK_EXSEL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL), + + SDLK_KP_00 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00), + SDLK_KP_000 = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000), + SDLK_THOUSANDSSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR), + SDLK_DECIMALSEPARATOR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR), + SDLK_CURRENCYUNIT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT), + SDLK_CURRENCYSUBUNIT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT), + SDLK_KP_LEFTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN), + SDLK_KP_RIGHTPAREN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN), + SDLK_KP_LEFTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE), + SDLK_KP_RIGHTBRACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE), + SDLK_KP_TAB = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB), + SDLK_KP_BACKSPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE), + SDLK_KP_A = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A), + SDLK_KP_B = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B), + SDLK_KP_C = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C), + SDLK_KP_D = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D), + SDLK_KP_E = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E), + SDLK_KP_F = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F), + SDLK_KP_XOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR), + SDLK_KP_POWER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER), + SDLK_KP_PERCENT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT), + SDLK_KP_LESS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS), + SDLK_KP_GREATER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER), + SDLK_KP_AMPERSAND = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND), + SDLK_KP_DBLAMPERSAND = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND), + SDLK_KP_VERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR), + SDLK_KP_DBLVERTICALBAR = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR), + SDLK_KP_COLON = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON), + SDLK_KP_HASH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH), + SDLK_KP_SPACE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE), + SDLK_KP_AT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT), + SDLK_KP_EXCLAM = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM), + SDLK_KP_MEMSTORE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE), + SDLK_KP_MEMRECALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL), + SDLK_KP_MEMCLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR), + SDLK_KP_MEMADD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD), + SDLK_KP_MEMSUBTRACT = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT), + SDLK_KP_MEMMULTIPLY = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY), + SDLK_KP_MEMDIVIDE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE), + SDLK_KP_PLUSMINUS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS), + SDLK_KP_CLEAR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR), + SDLK_KP_CLEARENTRY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY), + SDLK_KP_BINARY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY), + SDLK_KP_OCTAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL), + SDLK_KP_DECIMAL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL), + SDLK_KP_HEXADECIMAL = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL), + + SDLK_LCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL), + SDLK_LSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT), + SDLK_LALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT), + SDLK_LGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI), + SDLK_RCTRL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL), + SDLK_RSHIFT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT), + SDLK_RALT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT), + SDLK_RGUI = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI), + + SDLK_MODE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE), + + SDLK_AUDIONEXT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT), + SDLK_AUDIOPREV = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV), + SDLK_AUDIOSTOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP), + SDLK_AUDIOPLAY = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY), + SDLK_AUDIOMUTE = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE), + SDLK_MEDIASELECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT), + SDLK_WWW = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW), + SDLK_MAIL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL), + SDLK_CALCULATOR = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR), + SDLK_COMPUTER = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER), + SDLK_AC_SEARCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH), + SDLK_AC_HOME = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME), + SDLK_AC_BACK = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK), + SDLK_AC_FORWARD = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD), + SDLK_AC_STOP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP), + SDLK_AC_REFRESH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH), + SDLK_AC_BOOKMARKS = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS), + + SDLK_BRIGHTNESSDOWN = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN), + SDLK_BRIGHTNESSUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP), + SDLK_DISPLAYSWITCH = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH), + SDLK_KBDILLUMTOGGLE = + SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE), + SDLK_KBDILLUMDOWN = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN), + SDLK_KBDILLUMUP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP), + SDLK_EJECT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT), + SDLK_SLEEP = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) +}; + +/** + * \brief Enumeration of valid key mods (possibly OR'd together). + */ +typedef enum +{ + KMOD_NONE = 0x0000, + KMOD_LSHIFT = 0x0001, + KMOD_RSHIFT = 0x0002, + KMOD_LCTRL = 0x0040, + KMOD_RCTRL = 0x0080, + KMOD_LALT = 0x0100, + KMOD_RALT = 0x0200, + KMOD_LGUI = 0x0400, + KMOD_RGUI = 0x0800, + KMOD_NUM = 0x1000, + KMOD_CAPS = 0x2000, + KMOD_MODE = 0x4000, + KMOD_RESERVED = 0x8000 +} SDL_Keymod; + +#define KMOD_CTRL (KMOD_LCTRL|KMOD_RCTRL) +#define KMOD_SHIFT (KMOD_LSHIFT|KMOD_RSHIFT) +#define KMOD_ALT (KMOD_LALT|KMOD_RALT) +#define KMOD_GUI (KMOD_LGUI|KMOD_RGUI) + +#endif /* _SDL_keycode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_loadso.h b/SDL/include/SDL_loadso.h new file mode 100644 index 0000000..790d0a7 --- /dev/null +++ b/SDL/include/SDL_loadso.h @@ -0,0 +1,81 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_loadso.h + * + * System dependent library loading routines + * + * Some things to keep in mind: + * \li These functions only work on C function names. Other languages may + * have name mangling and intrinsic language support that varies from + * compiler to compiler. + * \li Make sure you declare your function pointers with the same calling + * convention as the actual library function. Your code will crash + * mysteriously if you do not do this. + * \li Avoid namespace collisions. If you load a symbol from the library, + * it is not defined whether or not it goes into the global symbol + * namespace for the application. If it does and it conflicts with + * symbols in your code or other shared libraries, you will not get + * the results you expect. :) + */ + +#ifndef _SDL_loadso_h +#define _SDL_loadso_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This function dynamically loads a shared object and returns a pointer + * to the object handle (or NULL if there was an error). + * The 'sofile' parameter is a system dependent name of the object file. + */ +extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); + +/** + * Given an object handle, this function looks up the address of the + * named function in the shared object and returns it. This address + * is no longer valid after calling SDL_UnloadObject(). + */ +extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, + const char *name); + +/** + * Unload a shared object from memory. + */ +extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_loadso_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_log.h b/SDL/include/SDL_log.h new file mode 100644 index 0000000..79ae4cd --- /dev/null +++ b/SDL/include/SDL_log.h @@ -0,0 +1,211 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_log.h + * + * Simple log messages with categories and priorities. + * + * By default logs are quiet, but if you're debugging SDL you might want: + * + * SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN); + * + * Here's where the messages go on different platforms: + * Windows: debug output stream + * Android: log output + * Others: standard error output (stderr) + */ + +#ifndef _SDL_log_h +#define _SDL_log_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * \brief The maximum size of a log message + * + * Messages longer than the maximum size will be truncated + */ +#define SDL_MAX_LOG_MESSAGE 4096 + +/** + * \brief The predefined log categories + * + * By default the application category is enabled at the INFO level, + * the assert category is enabled at the WARN level, test is enabled + * at the VERBOSE level and all other categories are enabled at the + * CRITICAL level. + */ +enum +{ + SDL_LOG_CATEGORY_APPLICATION, + SDL_LOG_CATEGORY_ERROR, + SDL_LOG_CATEGORY_ASSERT, + SDL_LOG_CATEGORY_SYSTEM, + SDL_LOG_CATEGORY_AUDIO, + SDL_LOG_CATEGORY_VIDEO, + SDL_LOG_CATEGORY_RENDER, + SDL_LOG_CATEGORY_INPUT, + SDL_LOG_CATEGORY_TEST, + + /* Reserved for future SDL library use */ + SDL_LOG_CATEGORY_RESERVED1, + SDL_LOG_CATEGORY_RESERVED2, + SDL_LOG_CATEGORY_RESERVED3, + SDL_LOG_CATEGORY_RESERVED4, + SDL_LOG_CATEGORY_RESERVED5, + SDL_LOG_CATEGORY_RESERVED6, + SDL_LOG_CATEGORY_RESERVED7, + SDL_LOG_CATEGORY_RESERVED8, + SDL_LOG_CATEGORY_RESERVED9, + SDL_LOG_CATEGORY_RESERVED10, + + /* Beyond this point is reserved for application use, e.g. + enum { + MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM, + MYAPP_CATEGORY_AWESOME2, + MYAPP_CATEGORY_AWESOME3, + ... + }; + */ + SDL_LOG_CATEGORY_CUSTOM +}; + +/** + * \brief The predefined log priorities + */ +typedef enum +{ + SDL_LOG_PRIORITY_VERBOSE = 1, + SDL_LOG_PRIORITY_DEBUG, + SDL_LOG_PRIORITY_INFO, + SDL_LOG_PRIORITY_WARN, + SDL_LOG_PRIORITY_ERROR, + SDL_LOG_PRIORITY_CRITICAL, + SDL_NUM_LOG_PRIORITIES +} SDL_LogPriority; + + +/** + * \brief Set the priority of all log categories + */ +extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority); + +/** + * \brief Set the priority of a particular log category + */ +extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category, + SDL_LogPriority priority); + +/** + * \brief Get the priority of a particular log category + */ +extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category); + +/** + * \brief Reset all priorities to default. + * + * \note This is called in SDL_Quit(). + */ +extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void); + +/** + * \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_VERBOSE + */ +extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_DEBUG + */ +extern DECLSPEC void SDLCALL SDL_LogDebug(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_INFO + */ +extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_WARN + */ +extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_ERROR + */ +extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...); + +/** + * \brief Log a message with SDL_LOG_PRIORITY_CRITICAL + */ +extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessage(int category, + SDL_LogPriority priority, + const char *fmt, ...); + +/** + * \brief Log a message with the specified category and priority. + */ +extern DECLSPEC void SDLCALL SDL_LogMessageV(int category, + SDL_LogPriority priority, + const char *fmt, va_list ap); + +/** + * \brief The prototype for the log output function + */ +typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message); + +/** + * \brief Get the current log output function. + */ +extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata); + +/** + * \brief This function allows you to replace the default log output + * function with one of your own. + */ +extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_log_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_main.h b/SDL/include/SDL_main.h new file mode 100644 index 0000000..b7e4a10 --- /dev/null +++ b/SDL/include/SDL_main.h @@ -0,0 +1,125 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_main_h +#define _SDL_main_h + +#include "SDL_stdinc.h" + +/** + * \file SDL_main.h + * + * Redefine main() on some platforms so that it is called by SDL. + */ + +#ifndef SDL_MAIN_HANDLED +#if defined(__WIN32__) +/* On Windows SDL provides WinMain(), which parses the command line and passes + the arguments to your main function. + + If you provide your own WinMain(), you may define SDL_MAIN_HANDLED + */ +#define SDL_MAIN_AVAILABLE + +#elif defined(__IPHONEOS__) +/* On iOS SDL provides a main function that creates an application delegate + and starts the iOS application run loop. + + See src/video/uikit/SDL_uikitappdelegate.m for more details. + */ +#define SDL_MAIN_NEEDED + +#elif defined(__ANDROID__) +/* On Android SDL provides a Java class in SDLActivity.java that is the + main activity entry point. + + See README-android.txt for more details on extending that class. + */ +#define SDL_MAIN_NEEDED + +#endif +#endif /* SDL_MAIN_HANDLED */ + +#ifdef __cplusplus +#define C_LINKAGE "C" +#else +#define C_LINKAGE +#endif /* __cplusplus */ + +/** + * \file SDL_main.h + * + * The application's main() function must be called with C linkage, + * and should be declared like this: + * \code + * #ifdef __cplusplus + * extern "C" + * #endif + * int main(int argc, char *argv[]) + * { + * } + * \endcode + */ + +#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) +#define main SDL_main +#endif + +/** + * The prototype for the application's main() function + */ +extern C_LINKAGE int SDL_main(int argc, char *argv[]); + + +#include "begin_code.h" +#ifdef __cplusplus +extern "C" { +#endif + +/** + * This is called by the real SDL main function to let the rest of the + * library know that initialization was done properly. + * + * Calling this yourself without knowing what you're doing can cause + * crashes and hard to diagnose problems with your application. + */ +extern DECLSPEC void SDL_SetMainReady(void); + +#ifdef __WIN32__ + +/** + * This can be called to set the application class at startup + */ +extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, + void *hInst); +extern DECLSPEC void SDLCALL SDL_UnregisterApp(void); + +#endif /* __WIN32__ */ + + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_main_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_messagebox.h b/SDL/include/SDL_messagebox.h new file mode 100644 index 0000000..cb1a1cc --- /dev/null +++ b/SDL/include/SDL_messagebox.h @@ -0,0 +1,144 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_messagebox_h +#define _SDL_messagebox_h + +#include "SDL_stdinc.h" +#include "SDL_video.h" /* For SDL_Window */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief SDL_MessageBox flags. If supported will display warning icon, etc. + */ +typedef enum +{ + SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ + SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ + SDL_MESSAGEBOX_INFORMATION = 0x00000040 /**< informational dialog */ +} SDL_MessageBoxFlags; + +/** + * \brief Flags for SDL_MessageBoxButtonData. + */ +typedef enum +{ + SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ + SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ +} SDL_MessageBoxButtonFlags; + +/** + * \brief Individual button data. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ + int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ + const char * text; /**< The UTF-8 button text */ +} SDL_MessageBoxButtonData; + +/** + * \brief RGB value used in a message box color scheme + */ +typedef struct +{ + Uint8 r, g, b; +} SDL_MessageBoxColor; + +typedef enum +{ + SDL_MESSAGEBOX_COLOR_BACKGROUND, + SDL_MESSAGEBOX_COLOR_TEXT, + SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, + SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, + SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, + SDL_MESSAGEBOX_COLOR_MAX +} SDL_MessageBoxColorType; + +/** + * \brief A set of colors to use for message box dialogs + */ +typedef struct +{ + SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; +} SDL_MessageBoxColorScheme; + +/** + * \brief MessageBox structure containing title, text, window, etc. + */ +typedef struct +{ + Uint32 flags; /**< ::SDL_MessageBoxFlags */ + SDL_Window *window; /**< Parent window, can be NULL */ + const char *title; /**< UTF-8 title */ + const char *message; /**< UTF-8 message text */ + + int numbuttons; + const SDL_MessageBoxButtonData *buttons; + + const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ +} SDL_MessageBoxData; + +/** + * \brief Create a modal message box. + * + * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. + * \param buttonid The pointer to which user id of hit button should be copied. + * + * \return -1 on error, otherwise 0 and buttonid contains user id of button + * hit or -1 if dialog was closed. + * + * \note This function should be called on the thread that created the parent + * window, or on the main thread if the messagebox has no parent. It will + * block execution of that thread until the user clicks a button or + * closes the messagebox. + */ +extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); + +/** + * \brief Create a simple modal message box + * + * \param flags ::SDL_MessageBoxFlags + * \param title UTF-8 title text + * \param message UTF-8 message text + * \param window The parent window, or NULL for no parent + * + * \return 0 on success, -1 on error + * + * \sa SDL_ShowMessageBox + */ +extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_messagebox_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_mixer.h b/SDL/include/SDL_mixer.h new file mode 100644 index 0000000..53fac6d --- /dev/null +++ b/SDL/include/SDL_mixer.h @@ -0,0 +1,631 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* $Id$ */ + +#ifndef _SDL_MIXER_H +#define _SDL_MIXER_H + +#include "SDL_stdinc.h" +#include "SDL_rwops.h" +#include "SDL_audio.h" +#include "SDL_endian.h" +#include "SDL_version.h" +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MIXER_MAJOR_VERSION 2 +#define SDL_MIXER_MINOR_VERSION 0 +#define SDL_MIXER_PATCHLEVEL 0 + +/* This macro can be used to fill a version structure with the compile-time + * version of the SDL_mixer library. + */ +#define SDL_MIXER_VERSION(X) \ +{ \ + (X)->major = SDL_MIXER_MAJOR_VERSION; \ + (X)->minor = SDL_MIXER_MINOR_VERSION; \ + (X)->patch = SDL_MIXER_PATCHLEVEL; \ +} + +/* Backwards compatibility */ +#define MIX_MAJOR_VERSION SDL_MIXER_MAJOR_VERSION +#define MIX_MINOR_VERSION SDL_MIXER_MINOR_VERSION +#define MIX_PATCHLEVEL SDL_MIXER_PATCHLEVEL +#define MIX_VERSION(X) SDL_MIXER_VERSION(X) + +/* This function gets the version of the dynamically linked SDL_mixer library. + it should NOT be used to fill a version structure, instead you should + use the SDL_MIXER_VERSION() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL Mix_Linked_Version(void); + +typedef enum +{ + MIX_INIT_FLAC = 0x00000001, + MIX_INIT_MOD = 0x00000002, + MIX_INIT_MODPLUG = 0x00000004, + MIX_INIT_MP3 = 0x00000008, + MIX_INIT_OGG = 0x00000010, + MIX_INIT_FLUIDSYNTH = 0x00000020 +} MIX_InitFlags; + +/* Loads dynamic libraries and prepares them for use. Flags should be + one or more flags from MIX_InitFlags OR'd together. + It returns the flags successfully initialized, or 0 on failure. + */ +extern DECLSPEC int SDLCALL Mix_Init(int flags); + +/* Unloads libraries loaded with Mix_Init */ +extern DECLSPEC void SDLCALL Mix_Quit(void); + + +/* The default mixer has 8 simultaneous mixing channels */ +#ifndef MIX_CHANNELS +#define MIX_CHANNELS 8 +#endif + +/* Good default values for a PC soundcard */ +#define MIX_DEFAULT_FREQUENCY 22050 +#if SDL_BYTEORDER == SDL_LIL_ENDIAN +#define MIX_DEFAULT_FORMAT AUDIO_S16LSB +#else +#define MIX_DEFAULT_FORMAT AUDIO_S16MSB +#endif +#define MIX_DEFAULT_CHANNELS 2 +#define MIX_MAX_VOLUME 128 /* Volume of a chunk */ + +/* The internal format for an audio chunk */ +typedef struct Mix_Chunk { + int allocated; + Uint8 *abuf; + Uint32 alen; + Uint8 volume; /* Per-sample volume, 0-128 */ +} Mix_Chunk; + +/* The different fading types supported */ +typedef enum { + MIX_NO_FADING, + MIX_FADING_OUT, + MIX_FADING_IN +} Mix_Fading; + +typedef enum { + MUS_NONE, + MUS_CMD, + MUS_WAV, + MUS_MOD, + MUS_MID, + MUS_OGG, + MUS_MP3, + MUS_MP3_MAD, + MUS_FLAC, + MUS_MODPLUG +} Mix_MusicType; + +/* The internal format for a music chunk interpreted via mikmod */ +typedef struct _Mix_Music Mix_Music; + +/* Open the mixer with a certain audio format */ +extern DECLSPEC int SDLCALL Mix_OpenAudio(int frequency, Uint16 format, int channels, int chunksize); + +/* Dynamically change the number of channels managed by the mixer. + If decreasing the number of channels, the upper channels are + stopped. + This function returns the new number of allocated channels. + */ +extern DECLSPEC int SDLCALL Mix_AllocateChannels(int numchans); + +/* Find out what the actual audio device parameters are. + This function returns 1 if the audio has been opened, 0 otherwise. + */ +extern DECLSPEC int SDLCALL Mix_QuerySpec(int *frequency,Uint16 *format,int *channels); + +/* Load a wave file or a music (.mod .s3m .it .xm) file */ +extern DECLSPEC Mix_Chunk * SDLCALL Mix_LoadWAV_RW(SDL_RWops *src, int freesrc); +#define Mix_LoadWAV(file) Mix_LoadWAV_RW(SDL_RWFromFile(file, "rb"), 1) +extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS(const char *file); + +/* Load a music file from an SDL_RWop object (Ogg and MikMod specific currently) + Matt Campbell (matt@campbellhome.dhs.org) April 2000 */ +extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUS_RW(SDL_RWops *src, int freesrc); + +/* Load a music file from an SDL_RWop object assuming a specific format */ +extern DECLSPEC Mix_Music * SDLCALL Mix_LoadMUSType_RW(SDL_RWops *src, Mix_MusicType type, int freesrc); + +/* Load a wave file of the mixer format from a memory buffer */ +extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_WAV(Uint8 *mem); + +/* Load raw audio data of the mixer format from a memory buffer */ +extern DECLSPEC Mix_Chunk * SDLCALL Mix_QuickLoad_RAW(Uint8 *mem, Uint32 len); + +/* Free an audio chunk previously loaded */ +extern DECLSPEC void SDLCALL Mix_FreeChunk(Mix_Chunk *chunk); +extern DECLSPEC void SDLCALL Mix_FreeMusic(Mix_Music *music); + +/* Get a list of chunk/music decoders that this build of SDL_mixer provides. + This list can change between builds AND runs of the program, if external + libraries that add functionality become available. + You must successfully call Mix_OpenAudio() before calling these functions. + This API is only available in SDL_mixer 1.2.9 and later. + + // usage... + int i; + const int total = Mix_GetNumChunkDecoders(); + for (i = 0; i < total; i++) + printf("Supported chunk decoder: [%s]\n", Mix_GetChunkDecoder(i)); + + Appearing in this list doesn't promise your specific audio file will + decode...but it's handy to know if you have, say, a functioning Timidity + install. + + These return values are static, read-only data; do not modify or free it. + The pointers remain valid until you call Mix_CloseAudio(). +*/ +extern DECLSPEC int SDLCALL Mix_GetNumChunkDecoders(void); +extern DECLSPEC const char * SDLCALL Mix_GetChunkDecoder(int index); +extern DECLSPEC int SDLCALL Mix_GetNumMusicDecoders(void); +extern DECLSPEC const char * SDLCALL Mix_GetMusicDecoder(int index); + +/* Find out the music format of a mixer music, or the currently playing + music, if 'music' is NULL. +*/ +extern DECLSPEC Mix_MusicType SDLCALL Mix_GetMusicType(const Mix_Music *music); + +/* Set a function that is called after all mixing is performed. + This can be used to provide real-time visual display of the audio stream + or add a custom mixer filter for the stream data. +*/ +extern DECLSPEC void SDLCALL Mix_SetPostMix(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg); + +/* Add your own music player or additional mixer function. + If 'mix_func' is NULL, the default music player is re-enabled. + */ +extern DECLSPEC void SDLCALL Mix_HookMusic(void (*mix_func)(void *udata, Uint8 *stream, int len), void *arg); + +/* Add your own callback when the music has finished playing. + This callback is only called if the music finishes naturally. + */ +extern DECLSPEC void SDLCALL Mix_HookMusicFinished(void (*music_finished)(void)); + +/* Get a pointer to the user data for the current music hook */ +extern DECLSPEC void * SDLCALL Mix_GetMusicHookData(void); + +/* + * Add your own callback when a channel has finished playing. NULL + * to disable callback. The callback may be called from the mixer's audio + * callback or it could be called as a result of Mix_HaltChannel(), etc. + * do not call SDL_LockAudio() from this callback; you will either be + * inside the audio callback, or SDL_mixer will explicitly lock the audio + * before calling your callback. + */ +extern DECLSPEC void SDLCALL Mix_ChannelFinished(void (*channel_finished)(int channel)); + + +/* Special Effects API by ryan c. gordon. (icculus@icculus.org) */ + +#define MIX_CHANNEL_POST -2 + +/* This is the format of a special effect callback: + * + * myeffect(int chan, void *stream, int len, void *udata); + * + * (chan) is the channel number that your effect is affecting. (stream) is + * the buffer of data to work upon. (len) is the size of (stream), and + * (udata) is a user-defined bit of data, which you pass as the last arg of + * Mix_RegisterEffect(), and is passed back unmolested to your callback. + * Your effect changes the contents of (stream) based on whatever parameters + * are significant, or just leaves it be, if you prefer. You can do whatever + * you like to the buffer, though, and it will continue in its changed state + * down the mixing pipeline, through any other effect functions, then finally + * to be mixed with the rest of the channels and music for the final output + * stream. + * + * DO NOT EVER call SDL_LockAudio() from your callback function! + */ +typedef void (*Mix_EffectFunc_t)(int chan, void *stream, int len, void *udata); + +/* + * This is a callback that signifies that a channel has finished all its + * loops and has completed playback. This gets called if the buffer + * plays out normally, or if you call Mix_HaltChannel(), implicitly stop + * a channel via Mix_AllocateChannels(), or unregister a callback while + * it's still playing. + * + * DO NOT EVER call SDL_LockAudio() from your callback function! + */ +typedef void (*Mix_EffectDone_t)(int chan, void *udata); + + +/* Register a special effect function. At mixing time, the channel data is + * copied into a buffer and passed through each registered effect function. + * After it passes through all the functions, it is mixed into the final + * output stream. The copy to buffer is performed once, then each effect + * function performs on the output of the previous effect. Understand that + * this extra copy to a buffer is not performed if there are no effects + * registered for a given chunk, which saves CPU cycles, and any given + * effect will be extra cycles, too, so it is crucial that your code run + * fast. Also note that the data that your function is given is in the + * format of the sound device, and not the format you gave to Mix_OpenAudio(), + * although they may in reality be the same. This is an unfortunate but + * necessary speed concern. Use Mix_QuerySpec() to determine if you can + * handle the data before you register your effect, and take appropriate + * actions. + * You may also specify a callback (Mix_EffectDone_t) that is called when + * the channel finishes playing. This gives you a more fine-grained control + * than Mix_ChannelFinished(), in case you need to free effect-specific + * resources, etc. If you don't need this, you can specify NULL. + * You may set the callbacks before or after calling Mix_PlayChannel(). + * Things like Mix_SetPanning() are just internal special effect functions, + * so if you are using that, you've already incurred the overhead of a copy + * to a separate buffer, and that these effects will be in the queue with + * any functions you've registered. The list of registered effects for a + * channel is reset when a chunk finishes playing, so you need to explicitly + * set them with each call to Mix_PlayChannel*(). + * You may also register a special effect function that is to be run after + * final mixing occurs. The rules for these callbacks are identical to those + * in Mix_RegisterEffect, but they are run after all the channels and the + * music have been mixed into a single stream, whereas channel-specific + * effects run on a given channel before any other mixing occurs. These + * global effect callbacks are call "posteffects". Posteffects only have + * their Mix_EffectDone_t function called when they are unregistered (since + * the main output stream is never "done" in the same sense as a channel). + * You must unregister them manually when you've had enough. Your callback + * will be told that the channel being mixed is (MIX_CHANNEL_POST) if the + * processing is considered a posteffect. + * + * After all these effects have finished processing, the callback registered + * through Mix_SetPostMix() runs, and then the stream goes to the audio + * device. + * + * DO NOT EVER call SDL_LockAudio() from your callback function! + * + * returns zero if error (no such channel), nonzero if added. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_RegisterEffect(int chan, Mix_EffectFunc_t f, Mix_EffectDone_t d, void *arg); + + +/* You may not need to call this explicitly, unless you need to stop an + * effect from processing in the middle of a chunk's playback. + * Posteffects are never implicitly unregistered as they are for channels, + * but they may be explicitly unregistered through this function by + * specifying MIX_CHANNEL_POST for a channel. + * returns zero if error (no such channel or effect), nonzero if removed. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_UnregisterEffect(int channel, Mix_EffectFunc_t f); + + +/* You may not need to call this explicitly, unless you need to stop all + * effects from processing in the middle of a chunk's playback. Note that + * this will also shut off some internal effect processing, since + * Mix_SetPanning() and others may use this API under the hood. This is + * called internally when a channel completes playback. + * Posteffects are never implicitly unregistered as they are for channels, + * but they may be explicitly unregistered through this function by + * specifying MIX_CHANNEL_POST for a channel. + * returns zero if error (no such channel), nonzero if all effects removed. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_UnregisterAllEffects(int channel); + + +#define MIX_EFFECTSMAXSPEED "MIX_EFFECTSMAXSPEED" + +/* + * These are the internally-defined mixing effects. They use the same API that + * effects defined in the application use, but are provided here as a + * convenience. Some effects can reduce their quality or use more memory in + * the name of speed; to enable this, make sure the environment variable + * MIX_EFFECTSMAXSPEED (see above) is defined before you call + * Mix_OpenAudio(). + */ + + +/* Set the panning of a channel. The left and right channels are specified + * as integers between 0 and 255, quietest to loudest, respectively. + * + * Technically, this is just individual volume control for a sample with + * two (stereo) channels, so it can be used for more than just panning. + * If you want real panning, call it like this: + * + * Mix_SetPanning(channel, left, 255 - left); + * + * ...which isn't so hard. + * + * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and + * the panning will be done to the final mixed stream before passing it on + * to the audio device. + * + * This uses the Mix_RegisterEffect() API internally, and returns without + * registering the effect function if the audio device is not configured + * for stereo output. Setting both (left) and (right) to 255 causes this + * effect to be unregistered, since that is the data's normal state. + * + * returns zero if error (no such channel or Mix_RegisterEffect() fails), + * nonzero if panning effect enabled. Note that an audio device in mono + * mode is a no-op, but this call will return successful in that case. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_SetPanning(int channel, Uint8 left, Uint8 right); + + +/* Set the position of a channel. (angle) is an integer from 0 to 360, that + * specifies the location of the sound in relation to the listener. (angle) + * will be reduced as neccesary (540 becomes 180 degrees, -100 becomes 260). + * Angle 0 is due north, and rotates clockwise as the value increases. + * For efficiency, the precision of this effect may be limited (angles 1 + * through 7 might all produce the same effect, 8 through 15 are equal, etc). + * (distance) is an integer between 0 and 255 that specifies the space + * between the sound and the listener. The larger the number, the further + * away the sound is. Using 255 does not guarantee that the channel will be + * culled from the mixing process or be completely silent. For efficiency, + * the precision of this effect may be limited (distance 0 through 5 might + * all produce the same effect, 6 through 10 are equal, etc). Setting (angle) + * and (distance) to 0 unregisters this effect, since the data would be + * unchanged. + * + * If you need more precise positional audio, consider using OpenAL for + * spatialized effects instead of SDL_mixer. This is only meant to be a + * basic effect for simple "3D" games. + * + * If the audio device is configured for mono output, then you won't get + * any effectiveness from the angle; however, distance attenuation on the + * channel will still occur. While this effect will function with stereo + * voices, it makes more sense to use voices with only one channel of sound, + * so when they are mixed through this effect, the positioning will sound + * correct. You can convert them to mono through SDL before giving them to + * the mixer in the first place if you like. + * + * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and + * the positioning will be done to the final mixed stream before passing it + * on to the audio device. + * + * This is a convenience wrapper over Mix_SetDistance() and Mix_SetPanning(). + * + * returns zero if error (no such channel or Mix_RegisterEffect() fails), + * nonzero if position effect is enabled. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_SetPosition(int channel, Sint16 angle, Uint8 distance); + + +/* Set the "distance" of a channel. (distance) is an integer from 0 to 255 + * that specifies the location of the sound in relation to the listener. + * Distance 0 is overlapping the listener, and 255 is as far away as possible + * A distance of 255 does not guarantee silence; in such a case, you might + * want to try changing the chunk's volume, or just cull the sample from the + * mixing process with Mix_HaltChannel(). + * For efficiency, the precision of this effect may be limited (distances 1 + * through 7 might all produce the same effect, 8 through 15 are equal, etc). + * (distance) is an integer between 0 and 255 that specifies the space + * between the sound and the listener. The larger the number, the further + * away the sound is. + * Setting (distance) to 0 unregisters this effect, since the data would be + * unchanged. + * If you need more precise positional audio, consider using OpenAL for + * spatialized effects instead of SDL_mixer. This is only meant to be a + * basic effect for simple "3D" games. + * + * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and + * the distance attenuation will be done to the final mixed stream before + * passing it on to the audio device. + * + * This uses the Mix_RegisterEffect() API internally. + * + * returns zero if error (no such channel or Mix_RegisterEffect() fails), + * nonzero if position effect is enabled. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_SetDistance(int channel, Uint8 distance); + + +/* + * !!! FIXME : Haven't implemented, since the effect goes past the + * end of the sound buffer. Will have to think about this. + * --ryan. + */ +#if 0 +/* Causes an echo effect to be mixed into a sound. (echo) is the amount + * of echo to mix. 0 is no echo, 255 is infinite (and probably not + * what you want). + * + * Setting (channel) to MIX_CHANNEL_POST registers this as a posteffect, and + * the reverbing will be done to the final mixed stream before passing it on + * to the audio device. + * + * This uses the Mix_RegisterEffect() API internally. If you specify an echo + * of zero, the effect is unregistered, as the data is already in that state. + * + * returns zero if error (no such channel or Mix_RegisterEffect() fails), + * nonzero if reversing effect is enabled. + * Error messages can be retrieved from Mix_GetError(). + */ +extern no_parse_DECLSPEC int SDLCALL Mix_SetReverb(int channel, Uint8 echo); +#endif + +/* Causes a channel to reverse its stereo. This is handy if the user has his + * speakers hooked up backwards, or you would like to have a minor bit of + * psychedelia in your sound code. :) Calling this function with (flip) + * set to non-zero reverses the chunks's usual channels. If (flip) is zero, + * the effect is unregistered. + * + * This uses the Mix_RegisterEffect() API internally, and thus is probably + * more CPU intensive than having the user just plug in his speakers + * correctly. Mix_SetReverseStereo() returns without registering the effect + * function if the audio device is not configured for stereo output. + * + * If you specify MIX_CHANNEL_POST for (channel), then this the effect is used + * on the final mixed stream before sending it on to the audio device (a + * posteffect). + * + * returns zero if error (no such channel or Mix_RegisterEffect() fails), + * nonzero if reversing effect is enabled. Note that an audio device in mono + * mode is a no-op, but this call will return successful in that case. + * Error messages can be retrieved from Mix_GetError(). + */ +extern DECLSPEC int SDLCALL Mix_SetReverseStereo(int channel, int flip); + +/* end of effects API. --ryan. */ + + +/* Reserve the first channels (0 -> n-1) for the application, i.e. don't allocate + them dynamically to the next sample if requested with a -1 value below. + Returns the number of reserved channels. + */ +extern DECLSPEC int SDLCALL Mix_ReserveChannels(int num); + +/* Channel grouping functions */ + +/* Attach a tag to a channel. A tag can be assigned to several mixer + channels, to form groups of channels. + If 'tag' is -1, the tag is removed (actually -1 is the tag used to + represent the group of all the channels). + Returns true if everything was OK. + */ +extern DECLSPEC int SDLCALL Mix_GroupChannel(int which, int tag); +/* Assign several consecutive channels to a group */ +extern DECLSPEC int SDLCALL Mix_GroupChannels(int from, int to, int tag); +/* Finds the first available channel in a group of channels, + returning -1 if none are available. + */ +extern DECLSPEC int SDLCALL Mix_GroupAvailable(int tag); +/* Returns the number of channels in a group. This is also a subtle + way to get the total number of channels when 'tag' is -1 + */ +extern DECLSPEC int SDLCALL Mix_GroupCount(int tag); +/* Finds the "oldest" sample playing in a group of channels */ +extern DECLSPEC int SDLCALL Mix_GroupOldest(int tag); +/* Finds the "most recent" (i.e. last) sample playing in a group of channels */ +extern DECLSPEC int SDLCALL Mix_GroupNewer(int tag); + +/* Play an audio chunk on a specific channel. + If the specified channel is -1, play on the first free channel. + If 'loops' is greater than zero, loop the sound that many times. + If 'loops' is -1, loop inifinitely (~65000 times). + Returns which channel was used to play the sound. +*/ +#define Mix_PlayChannel(channel,chunk,loops) Mix_PlayChannelTimed(channel,chunk,loops,-1) +/* The same as above, but the sound is played at most 'ticks' milliseconds */ +extern DECLSPEC int SDLCALL Mix_PlayChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ticks); +extern DECLSPEC int SDLCALL Mix_PlayMusic(Mix_Music *music, int loops); + +/* Fade in music or a channel over "ms" milliseconds, same semantics as the "Play" functions */ +extern DECLSPEC int SDLCALL Mix_FadeInMusic(Mix_Music *music, int loops, int ms); +extern DECLSPEC int SDLCALL Mix_FadeInMusicPos(Mix_Music *music, int loops, int ms, double position); +#define Mix_FadeInChannel(channel,chunk,loops,ms) Mix_FadeInChannelTimed(channel,chunk,loops,ms,-1) +extern DECLSPEC int SDLCALL Mix_FadeInChannelTimed(int channel, Mix_Chunk *chunk, int loops, int ms, int ticks); + +/* Set the volume in the range of 0-128 of a specific channel or chunk. + If the specified channel is -1, set volume for all channels. + Returns the original volume. + If the specified volume is -1, just return the current volume. +*/ +extern DECLSPEC int SDLCALL Mix_Volume(int channel, int volume); +extern DECLSPEC int SDLCALL Mix_VolumeChunk(Mix_Chunk *chunk, int volume); +extern DECLSPEC int SDLCALL Mix_VolumeMusic(int volume); + +/* Halt playing of a particular channel */ +extern DECLSPEC int SDLCALL Mix_HaltChannel(int channel); +extern DECLSPEC int SDLCALL Mix_HaltGroup(int tag); +extern DECLSPEC int SDLCALL Mix_HaltMusic(void); + +/* Change the expiration delay for a particular channel. + The sample will stop playing after the 'ticks' milliseconds have elapsed, + or remove the expiration if 'ticks' is -1 +*/ +extern DECLSPEC int SDLCALL Mix_ExpireChannel(int channel, int ticks); + +/* Halt a channel, fading it out progressively till it's silent + The ms parameter indicates the number of milliseconds the fading + will take. + */ +extern DECLSPEC int SDLCALL Mix_FadeOutChannel(int which, int ms); +extern DECLSPEC int SDLCALL Mix_FadeOutGroup(int tag, int ms); +extern DECLSPEC int SDLCALL Mix_FadeOutMusic(int ms); + +/* Query the fading status of a channel */ +extern DECLSPEC Mix_Fading SDLCALL Mix_FadingMusic(void); +extern DECLSPEC Mix_Fading SDLCALL Mix_FadingChannel(int which); + +/* Pause/Resume a particular channel */ +extern DECLSPEC void SDLCALL Mix_Pause(int channel); +extern DECLSPEC void SDLCALL Mix_Resume(int channel); +extern DECLSPEC int SDLCALL Mix_Paused(int channel); + +/* Pause/Resume the music stream */ +extern DECLSPEC void SDLCALL Mix_PauseMusic(void); +extern DECLSPEC void SDLCALL Mix_ResumeMusic(void); +extern DECLSPEC void SDLCALL Mix_RewindMusic(void); +extern DECLSPEC int SDLCALL Mix_PausedMusic(void); + +/* Set the current position in the music stream. + This returns 0 if successful, or -1 if it failed or isn't implemented. + This function is only implemented for MOD music formats (set pattern + order number) and for OGG, FLAC, MP3_MAD, and MODPLUG music (set + position in seconds), at the moment. +*/ +extern DECLSPEC int SDLCALL Mix_SetMusicPosition(double position); + +/* Check the status of a specific channel. + If the specified channel is -1, check all channels. +*/ +extern DECLSPEC int SDLCALL Mix_Playing(int channel); +extern DECLSPEC int SDLCALL Mix_PlayingMusic(void); + +/* Stop music and set external music playback command */ +extern DECLSPEC int SDLCALL Mix_SetMusicCMD(const char *command); + +/* Synchro value is set by MikMod from modules while playing */ +extern DECLSPEC int SDLCALL Mix_SetSynchroValue(int value); +extern DECLSPEC int SDLCALL Mix_GetSynchroValue(void); + +/* Set/Get/Iterate SoundFonts paths to use by supported MIDI backends */ +extern DECLSPEC int SDLCALL Mix_SetSoundFonts(const char *paths); +extern DECLSPEC const char* SDLCALL Mix_GetSoundFonts(void); +extern DECLSPEC int SDLCALL Mix_EachSoundFont(int (*function)(const char*, void*), void *data); + +/* Get the Mix_Chunk currently associated with a mixer channel + Returns NULL if it's an invalid channel, or there's no chunk associated. +*/ +extern DECLSPEC Mix_Chunk * SDLCALL Mix_GetChunk(int channel); + +/* Close the mixer, halting all playing audio */ +extern DECLSPEC void SDLCALL Mix_CloseAudio(void); + +/* We'll use SDL for reporting errors */ +#define Mix_SetError SDL_SetError +#define Mix_GetError SDL_GetError + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_MIXER_H */ diff --git a/SDL/include/SDL_mouse.h b/SDL/include/SDL_mouse.h new file mode 100644 index 0000000..36c29e9 --- /dev/null +++ b/SDL/include/SDL_mouse.h @@ -0,0 +1,224 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_mouse.h + * + * Include file for SDL mouse event handling. + */ + +#ifndef _SDL_mouse_h +#define _SDL_mouse_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ + +/** + * \brief Cursor types for SDL_CreateSystemCursor. + */ +typedef enum +{ + SDL_SYSTEM_CURSOR_ARROW, /**< Arrow */ + SDL_SYSTEM_CURSOR_IBEAM, /**< I-beam */ + SDL_SYSTEM_CURSOR_WAIT, /**< Wait */ + SDL_SYSTEM_CURSOR_CROSSHAIR, /**< Crosshair */ + SDL_SYSTEM_CURSOR_WAITARROW, /**< Small wait cursor (or Wait if not available) */ + SDL_SYSTEM_CURSOR_SIZENWSE, /**< Double arrow pointing northwest and southeast */ + SDL_SYSTEM_CURSOR_SIZENESW, /**< Double arrow pointing northeast and southwest */ + SDL_SYSTEM_CURSOR_SIZEWE, /**< Double arrow pointing west and east */ + SDL_SYSTEM_CURSOR_SIZENS, /**< Double arrow pointing north and south */ + SDL_SYSTEM_CURSOR_SIZEALL, /**< Four pointed arrow pointing north, south, east, and west */ + SDL_SYSTEM_CURSOR_NO, /**< Slashed circle or crossbones */ + SDL_SYSTEM_CURSOR_HAND, /**< Hand */ + SDL_NUM_SYSTEM_CURSORS +} SDL_SystemCursor; + +/* Function prototypes */ + +/** + * \brief Get the window which currently has mouse focus. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetMouseFocus(void); + +/** + * \brief Retrieve the current state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse cursor position relative to the focus window for the currently + * selected mouse. You can pass NULL for either x or y. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetMouseState(int *x, int *y); + +/** + * \brief Retrieve the relative state of the mouse. + * + * The current button state is returned as a button bitmask, which can + * be tested using the SDL_BUTTON(X) macros, and x and y are set to the + * mouse deltas since the last call to SDL_GetRelativeMouseState(). + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); + +/** + * \brief Moves the mouse to the given position within the window. + * + * \param window The window to move the mouse into, or NULL for the current mouse focus + * \param x The x coordinate within the window + * \param y The y coordinate within the window + * + * \note This function generates a mouse motion event + */ +extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_Window * window, + int x, int y); + +/** + * \brief Set relative mouse mode. + * + * \param enabled Whether or not to enable relative mode + * + * \return 0 on success, or -1 if relative mode is not supported. + * + * While the mouse is in relative mode, the cursor is hidden, and the + * driver will try to report continuous motion in the current window. + * Only relative motion events will be delivered, the mouse position + * will not change. + * + * \note This function will flush any pending mouse motion. + * + * \sa SDL_GetRelativeMouseMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRelativeMouseMode(SDL_bool enabled); + +/** + * \brief Query whether relative mouse mode is enabled. + * + * \sa SDL_SetRelativeMouseMode() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); + +/** + * \brief Create a cursor, using the specified bitmap data and + * mask (in MSB format). + * + * The cursor width must be a multiple of 8 bits. + * + * The cursor is created in black and white according to the following: + * + * + * + * + * + * + *
data mask resulting pixel on screen
0 1 White
1 1 Black
0 0 Transparent
1 0 Inverted color if possible, black + * if not.
+ * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, + const Uint8 * mask, + int w, int h, int hot_x, + int hot_y); + +/** + * \brief Create a color cursor. + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, + int hot_x, + int hot_y); + +/** + * \brief Create a system cursor. + * + * \sa SDL_FreeCursor() + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); + +/** + * \brief Set the active cursor. + */ +extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor * cursor); + +/** + * \brief Return the active cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); + +/** + * \brief Return the default cursor. + */ +extern DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); + +/** + * \brief Frees a cursor created with SDL_CreateCursor(). + * + * \sa SDL_CreateCursor() + */ +extern DECLSPEC void SDLCALL SDL_FreeCursor(SDL_Cursor * cursor); + +/** + * \brief Toggle whether or not the cursor is shown. + * + * \param toggle 1 to show the cursor, 0 to hide it, -1 to query the current + * state. + * + * \return 1 if the cursor is shown, or 0 if the cursor is hidden. + */ +extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle); + +/** + * Used as a mask when testing buttons in buttonstate. + * - Button 1: Left mouse button + * - Button 2: Middle mouse button + * - Button 3: Right mouse button + */ +#define SDL_BUTTON(X) (1 << ((X)-1)) +#define SDL_BUTTON_LEFT 1 +#define SDL_BUTTON_MIDDLE 2 +#define SDL_BUTTON_RIGHT 3 +#define SDL_BUTTON_X1 4 +#define SDL_BUTTON_X2 5 +#define SDL_BUTTON_LMASK SDL_BUTTON(SDL_BUTTON_LEFT) +#define SDL_BUTTON_MMASK SDL_BUTTON(SDL_BUTTON_MIDDLE) +#define SDL_BUTTON_RMASK SDL_BUTTON(SDL_BUTTON_RIGHT) +#define SDL_BUTTON_X1MASK SDL_BUTTON(SDL_BUTTON_X1) +#define SDL_BUTTON_X2MASK SDL_BUTTON(SDL_BUTTON_X2) + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mouse_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_mutex.h b/SDL/include/SDL_mutex.h new file mode 100644 index 0000000..2b5df0e --- /dev/null +++ b/SDL/include/SDL_mutex.h @@ -0,0 +1,251 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_mutex_h +#define _SDL_mutex_h + +/** + * \file SDL_mutex.h + * + * Functions to provide thread synchronization primitives. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Synchronization functions which can time out return this value + * if they time out. + */ +#define SDL_MUTEX_TIMEDOUT 1 + +/** + * This is the timeout value which corresponds to never time out. + */ +#define SDL_MUTEX_MAXWAIT (~(Uint32)0) + + +/** + * \name Mutex functions + */ +/* @{ */ + +/* The SDL mutex structure, defined in SDL_sysmutex.c */ +struct SDL_mutex; +typedef struct SDL_mutex SDL_mutex; + +/** + * Create a mutex, initialized unlocked. + */ +extern DECLSPEC SDL_mutex *SDLCALL SDL_CreateMutex(void); + +/** + * Lock the mutex. + * + * \return 0, or -1 on error. + */ +#define SDL_mutexP(m) SDL_LockMutex(m) +extern DECLSPEC int SDLCALL SDL_LockMutex(SDL_mutex * mutex); + +/** + * Try to lock the mutex + * + * \return 0, SDL_MUTEX_TIMEDOUT, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_TryLockMutex(SDL_mutex * mutex); + +/** + * Unlock the mutex. + * + * \return 0, or -1 on error. + * + * \warning It is an error to unlock a mutex that has not been locked by + * the current thread, and doing so results in undefined behavior. + */ +#define SDL_mutexV(m) SDL_UnlockMutex(m) +extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex); + +/** + * Destroy a mutex. + */ +extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex); + +/* @} *//* Mutex functions */ + + +/** + * \name Semaphore functions + */ +/* @{ */ + +/* The SDL semaphore structure, defined in SDL_syssem.c */ +struct SDL_semaphore; +typedef struct SDL_semaphore SDL_sem; + +/** + * Create a semaphore, initialized with value, returns NULL on failure. + */ +extern DECLSPEC SDL_sem *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); + +/** + * Destroy a semaphore. + */ +extern DECLSPEC void SDLCALL SDL_DestroySemaphore(SDL_sem * sem); + +/** + * This function suspends the calling thread until the semaphore pointed + * to by \c sem has a positive count. It then atomically decreases the + * semaphore count. + */ +extern DECLSPEC int SDLCALL SDL_SemWait(SDL_sem * sem); + +/** + * Non-blocking variant of SDL_SemWait(). + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait would + * block, and -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemTryWait(SDL_sem * sem); + +/** + * Variant of SDL_SemWait() with a timeout in milliseconds. + * + * \return 0 if the wait succeeds, ::SDL_MUTEX_TIMEDOUT if the wait does not + * succeed in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_SemWaitTimeout(SDL_sem * sem, Uint32 ms); + +/** + * Atomically increases the semaphore's count (not blocking). + * + * \return 0, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem); + +/** + * Returns the current count of the semaphore. + */ +extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem); + +/* @} *//* Semaphore functions */ + + +/** + * \name Condition variable functions + */ +/* @{ */ + +/* The SDL condition variable structure, defined in SDL_syscond.c */ +struct SDL_cond; +typedef struct SDL_cond SDL_cond; + +/** + * Create a condition variable. + * + * Typical use of condition variables: + * + * Thread A: + * SDL_LockMutex(lock); + * while ( ! condition ) { + * SDL_CondWait(cond, lock); + * } + * SDL_UnlockMutex(lock); + * + * Thread B: + * SDL_LockMutex(lock); + * ... + * condition = true; + * ... + * SDL_CondSignal(cond); + * SDL_UnlockMutex(lock); + * + * There is some discussion whether to signal the condition variable + * with the mutex locked or not. There is some potential performance + * benefit to unlocking first on some platforms, but there are some + * potential race conditions depending on how your code is structured. + * + * In general it's safer to signal the condition variable while the + * mutex is locked. + */ +extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void); + +/** + * Destroy a condition variable. + */ +extern DECLSPEC void SDLCALL SDL_DestroyCond(SDL_cond * cond); + +/** + * Restart one of the threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond); + +/** + * Restart all threads that are waiting on the condition variable. + * + * \return 0 or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond); + +/** + * Wait on the condition variable, unlocking the provided mutex. + * + * \warning The mutex must be locked before entering this function! + * + * The mutex is re-locked once the condition variable is signaled. + * + * \return 0 when it is signaled, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex); + +/** + * Waits for at most \c ms milliseconds, and returns 0 if the condition + * variable is signaled, ::SDL_MUTEX_TIMEDOUT if the condition is not + * signaled in the allotted time, and -1 on error. + * + * \warning On some platforms this function is implemented by looping with a + * delay of 1 ms, and so should be avoided if possible. + */ +extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond, + SDL_mutex * mutex, Uint32 ms); + +/* @} *//* Condition variable functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_mutex_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_name.h b/SDL/include/SDL_name.h new file mode 100644 index 0000000..d0469e1 --- /dev/null +++ b/SDL/include/SDL_name.h @@ -0,0 +1,11 @@ + +#ifndef _SDLname_h_ +#define _SDLname_h_ + +#if defined(__STDC__) || defined(__cplusplus) +#define NeedFunctionPrototypes 1 +#endif + +#define SDL_NAME(X) SDL_##X + +#endif /* _SDLname_h_ */ diff --git a/SDL/include/SDL_opengl.h b/SDL/include/SDL_opengl.h new file mode 100644 index 0000000..2f120aa --- /dev/null +++ b/SDL/include/SDL_opengl.h @@ -0,0 +1,11126 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengl.h + * + * This is a simple file to encapsulate the OpenGL API headers. + */ + +#ifndef _SDL_opengl_h +#define _SDL_opengl_h + +#include "SDL_config.h" + +#ifndef __IPHONEOS__ + +#ifdef __WIN32__ +#define WIN32_LEAN_AND_MEAN +#ifndef NOMINMAX +#define NOMINMAX /* Don't defined min() and max() */ +#endif +#include +#endif + +#ifdef __glext_h_ +/* Someone has already included glext.h */ +#define NO_SDL_GLEXT +#endif +#ifndef NO_SDL_GLEXT +#define __glext_h_ /* Don't let gl.h include glext.h */ +#endif +#if defined(__MACOSX__) +#include /* Header File For The OpenGL Library */ +#define __X_GL_H +#else +#include /* Header File For The OpenGL Library */ +#endif +#ifndef NO_SDL_GLEXT +#undef __glext_h_ +#endif + +/** + * \file SDL_opengl.h + * + * This file is included because glext.h is not available on some systems. + * If you don't want this version included, simply define ::NO_SDL_GLEXT. + * + * The latest version is available from: + * http://www.opengl.org/registry/ + */ + +/** + * \def NO_SDL_GLEXT + * + * Define this if you have your own version of glext.h and want to disable the + * version included in SDL_opengl.h. + */ + +#if !defined(NO_SDL_GLEXT) && !defined(GL_GLEXT_LEGACY) +#ifndef __glext_h_ +#define __glext_h_ + +#ifdef __cplusplus +extern "C" { +#endif + +/* +** Copyright (c) 2007-2010 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +/* Header file version number, required by OpenGL ABI for Linux */ +/* glext.h last updated $Date: 2010-08-03 01:30:25 -0700 (Tue, 03 Aug 2010) $ */ +/* Current version at http://www.opengl.org/registry/ */ +#define GL_GLEXT_VERSION 64 +/* Function declaration macros - to move into glplatform.h */ + +#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) +#define WIN32_LEAN_AND_MEAN 1 +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif +#ifndef APIENTRYP +#define APIENTRYP APIENTRY * +#endif +#ifndef GLAPI +#define GLAPI extern +#endif + +/*************************************************************/ + +#ifndef GL_VERSION_1_2 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E +#endif + +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_RESCALE_NORMAL 0x803A +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#endif + +#ifndef GL_ARB_imaging +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#endif + +#ifndef GL_ARB_imaging_DEPRECATED +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_CONSTANT_BORDER 0x8151 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 +#endif + +#ifndef GL_VERSION_1_3 +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_CLAMP_TO_BORDER 0x812D +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_MULTISAMPLE_BIT 0x20000000 +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_SUBTRACT 0x84E7 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#endif + +#ifndef GL_VERSION_1_4 +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_COMPARE_R_TO_TEXTURE 0x884E +#endif + +#ifndef GL_VERSION_1_5 +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 +#endif + +#ifndef GL_VERSION_1_5_DEPRECATED +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_FOG_COORD_SRC 0x8450 +#define GL_FOG_COORD 0x8451 +#define GL_CURRENT_FOG_COORD 0x8453 +#define GL_FOG_COORD_ARRAY_TYPE 0x8454 +#define GL_FOG_COORD_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORD_ARRAY_POINTER 0x8456 +#define GL_FOG_COORD_ARRAY 0x8457 +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING 0x889D +#define GL_SRC0_RGB 0x8580 +#define GL_SRC1_RGB 0x8581 +#define GL_SRC2_RGB 0x8582 +#define GL_SRC0_ALPHA 0x8588 +#define GL_SRC1_ALPHA 0x8589 +#define GL_SRC2_ALPHA 0x858A +#endif + +#ifndef GL_VERSION_2_0 +#define GL_BLEND_EQUATION_RGB 0x8009 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 +#endif + +#ifndef GL_VERSION_2_0_DEPRECATED +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_TEXTURE_COORDS 0x8871 +#endif + +#ifndef GL_VERSION_2_1 +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#endif + +#ifndef GL_VERSION_2_1_DEPRECATED +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B +#endif + +#ifndef GL_VERSION_3_0 +#define GL_COMPARE_REF_TO_TEXTURE 0x884E +#define GL_CLIP_DISTANCE0 0x3000 +#define GL_CLIP_DISTANCE1 0x3001 +#define GL_CLIP_DISTANCE2 0x3002 +#define GL_CLIP_DISTANCE3 0x3003 +#define GL_CLIP_DISTANCE4 0x3004 +#define GL_CLIP_DISTANCE5 0x3005 +#define GL_CLIP_DISTANCE6 0x3006 +#define GL_CLIP_DISTANCE7 0x3007 +#define GL_MAX_CLIP_DISTANCES 0x0D32 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_MAX_VARYING_COMPONENTS 0x8B4B +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 +/* Reuse tokens from ARB_depth_buffer_float */ +/* reuse GL_DEPTH_COMPONENT32F */ +/* reuse GL_DEPTH32F_STENCIL8 */ +/* reuse GL_FLOAT_32_UNSIGNED_INT_24_8_REV */ +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_INVALID_FRAMEBUFFER_OPERATION */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_DEFAULT */ +/* reuse GL_FRAMEBUFFER_UNDEFINED */ +/* reuse GL_DEPTH_STENCIL_ATTACHMENT */ +/* reuse GL_INDEX */ +/* reuse GL_MAX_RENDERBUFFER_SIZE */ +/* reuse GL_DEPTH_STENCIL */ +/* reuse GL_UNSIGNED_INT_24_8 */ +/* reuse GL_DEPTH24_STENCIL8 */ +/* reuse GL_TEXTURE_STENCIL_SIZE */ +/* reuse GL_TEXTURE_RED_TYPE */ +/* reuse GL_TEXTURE_GREEN_TYPE */ +/* reuse GL_TEXTURE_BLUE_TYPE */ +/* reuse GL_TEXTURE_ALPHA_TYPE */ +/* reuse GL_TEXTURE_DEPTH_TYPE */ +/* reuse GL_UNSIGNED_NORMALIZED */ +/* reuse GL_FRAMEBUFFER_BINDING */ +/* reuse GL_DRAW_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_BINDING */ +/* reuse GL_READ_FRAMEBUFFER */ +/* reuse GL_DRAW_FRAMEBUFFER */ +/* reuse GL_READ_FRAMEBUFFER_BINDING */ +/* reuse GL_RENDERBUFFER_SAMPLES */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* reuse GL_FRAMEBUFFER_COMPLETE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ +/* reuse GL_FRAMEBUFFER_UNSUPPORTED */ +/* reuse GL_MAX_COLOR_ATTACHMENTS */ +/* reuse GL_COLOR_ATTACHMENT0 */ +/* reuse GL_COLOR_ATTACHMENT1 */ +/* reuse GL_COLOR_ATTACHMENT2 */ +/* reuse GL_COLOR_ATTACHMENT3 */ +/* reuse GL_COLOR_ATTACHMENT4 */ +/* reuse GL_COLOR_ATTACHMENT5 */ +/* reuse GL_COLOR_ATTACHMENT6 */ +/* reuse GL_COLOR_ATTACHMENT7 */ +/* reuse GL_COLOR_ATTACHMENT8 */ +/* reuse GL_COLOR_ATTACHMENT9 */ +/* reuse GL_COLOR_ATTACHMENT10 */ +/* reuse GL_COLOR_ATTACHMENT11 */ +/* reuse GL_COLOR_ATTACHMENT12 */ +/* reuse GL_COLOR_ATTACHMENT13 */ +/* reuse GL_COLOR_ATTACHMENT14 */ +/* reuse GL_COLOR_ATTACHMENT15 */ +/* reuse GL_DEPTH_ATTACHMENT */ +/* reuse GL_STENCIL_ATTACHMENT */ +/* reuse GL_FRAMEBUFFER */ +/* reuse GL_RENDERBUFFER */ +/* reuse GL_RENDERBUFFER_WIDTH */ +/* reuse GL_RENDERBUFFER_HEIGHT */ +/* reuse GL_RENDERBUFFER_INTERNAL_FORMAT */ +/* reuse GL_STENCIL_INDEX1 */ +/* reuse GL_STENCIL_INDEX4 */ +/* reuse GL_STENCIL_INDEX8 */ +/* reuse GL_STENCIL_INDEX16 */ +/* reuse GL_RENDERBUFFER_RED_SIZE */ +/* reuse GL_RENDERBUFFER_GREEN_SIZE */ +/* reuse GL_RENDERBUFFER_BLUE_SIZE */ +/* reuse GL_RENDERBUFFER_ALPHA_SIZE */ +/* reuse GL_RENDERBUFFER_DEPTH_SIZE */ +/* reuse GL_RENDERBUFFER_STENCIL_SIZE */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ +/* reuse GL_MAX_SAMPLES */ +/* Reuse tokens from ARB_framebuffer_sRGB */ +/* reuse GL_FRAMEBUFFER_SRGB */ +/* Reuse tokens from ARB_half_float_vertex */ +/* reuse GL_HALF_FLOAT */ +/* Reuse tokens from ARB_map_buffer_range */ +/* reuse GL_MAP_READ_BIT */ +/* reuse GL_MAP_WRITE_BIT */ +/* reuse GL_MAP_INVALIDATE_RANGE_BIT */ +/* reuse GL_MAP_INVALIDATE_BUFFER_BIT */ +/* reuse GL_MAP_FLUSH_EXPLICIT_BIT */ +/* reuse GL_MAP_UNSYNCHRONIZED_BIT */ +/* Reuse tokens from ARB_texture_compression_rgtc */ +/* reuse GL_COMPRESSED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_SIGNED_RED_RGTC1 */ +/* reuse GL_COMPRESSED_RG_RGTC2 */ +/* reuse GL_COMPRESSED_SIGNED_RG_RGTC2 */ +/* Reuse tokens from ARB_texture_rg */ +/* reuse GL_RG */ +/* reuse GL_RG_INTEGER */ +/* reuse GL_R8 */ +/* reuse GL_R16 */ +/* reuse GL_RG8 */ +/* reuse GL_RG16 */ +/* reuse GL_R16F */ +/* reuse GL_R32F */ +/* reuse GL_RG16F */ +/* reuse GL_RG32F */ +/* reuse GL_R8I */ +/* reuse GL_R8UI */ +/* reuse GL_R16I */ +/* reuse GL_R16UI */ +/* reuse GL_R32I */ +/* reuse GL_R32UI */ +/* reuse GL_RG8I */ +/* reuse GL_RG8UI */ +/* reuse GL_RG16I */ +/* reuse GL_RG16UI */ +/* reuse GL_RG32I */ +/* reuse GL_RG32UI */ +/* Reuse tokens from ARB_vertex_array_object */ +/* reuse GL_VERTEX_ARRAY_BINDING */ +#endif + +#ifndef GL_VERSION_3_0_DEPRECATED +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_ALPHA_INTEGER 0x8D97 +/* Reuse tokens from ARB_framebuffer_object */ +/* reuse GL_TEXTURE_LUMINANCE_TYPE */ +/* reuse GL_TEXTURE_INTENSITY_TYPE */ +#endif + +#ifndef GL_VERSION_3_1 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +/* Reuse tokens from ARB_copy_buffer */ +/* reuse GL_COPY_READ_BUFFER */ +/* reuse GL_COPY_WRITE_BUFFER */ +/* Reuse tokens from ARB_draw_instanced (none) */ +/* Reuse tokens from ARB_uniform_buffer_object */ +/* reuse GL_UNIFORM_BUFFER */ +/* reuse GL_UNIFORM_BUFFER_BINDING */ +/* reuse GL_UNIFORM_BUFFER_START */ +/* reuse GL_UNIFORM_BUFFER_SIZE */ +/* reuse GL_MAX_VERTEX_UNIFORM_BLOCKS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_BLOCKS */ +/* reuse GL_MAX_COMBINED_UNIFORM_BLOCKS */ +/* reuse GL_MAX_UNIFORM_BUFFER_BINDINGS */ +/* reuse GL_MAX_UNIFORM_BLOCK_SIZE */ +/* reuse GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT */ +/* reuse GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH */ +/* reuse GL_ACTIVE_UNIFORM_BLOCKS */ +/* reuse GL_UNIFORM_TYPE */ +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_INDEX */ +/* reuse GL_UNIFORM_OFFSET */ +/* reuse GL_UNIFORM_ARRAY_STRIDE */ +/* reuse GL_UNIFORM_MATRIX_STRIDE */ +/* reuse GL_UNIFORM_IS_ROW_MAJOR */ +/* reuse GL_UNIFORM_BLOCK_BINDING */ +/* reuse GL_UNIFORM_BLOCK_DATA_SIZE */ +/* reuse GL_UNIFORM_BLOCK_NAME_LENGTH */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS */ +/* reuse GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER */ +/* reuse GL_INVALID_INDEX */ +#endif + +#ifndef GL_VERSION_3_2 +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +/* Reuse tokens from ARB_depth_clamp */ +/* reuse GL_DEPTH_CLAMP */ +/* Reuse tokens from ARB_draw_elements_base_vertex (none) */ +/* Reuse tokens from ARB_fragment_coord_conventions (none) */ +/* Reuse tokens from ARB_provoking_vertex */ +/* reuse GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +/* Reuse tokens from ARB_seamless_cube_map */ +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS */ +/* Reuse tokens from ARB_sync */ +/* reuse GL_MAX_SERVER_WAIT_TIMEOUT */ +/* reuse GL_OBJECT_TYPE */ +/* reuse GL_SYNC_CONDITION */ +/* reuse GL_SYNC_STATUS */ +/* reuse GL_SYNC_FLAGS */ +/* reuse GL_SYNC_FENCE */ +/* reuse GL_SYNC_GPU_COMMANDS_COMPLETE */ +/* reuse GL_UNSIGNALED */ +/* reuse GL_SIGNALED */ +/* reuse GL_ALREADY_SIGNALED */ +/* reuse GL_TIMEOUT_EXPIRED */ +/* reuse GL_CONDITION_SATISFIED */ +/* reuse GL_WAIT_FAILED */ +/* reuse GL_TIMEOUT_IGNORED */ +/* reuse GL_SYNC_FLUSH_COMMANDS_BIT */ +/* reuse GL_TIMEOUT_IGNORED */ +/* Reuse tokens from ARB_texture_multisample */ +/* reuse GL_SAMPLE_POSITION */ +/* reuse GL_SAMPLE_MASK */ +/* reuse GL_SAMPLE_MASK_VALUE */ +/* reuse GL_MAX_SAMPLE_MASK_WORDS */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE */ +/* reuse GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_TEXTURE_SAMPLES */ +/* reuse GL_TEXTURE_FIXED_SAMPLE_LOCATIONS */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE */ +/* reuse GL_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY */ +/* reuse GL_MAX_COLOR_TEXTURE_SAMPLES */ +/* reuse GL_MAX_DEPTH_TEXTURE_SAMPLES */ +/* reuse GL_MAX_INTEGER_SAMPLES */ +/* Don't need to reuse tokens from ARB_vertex_array_bgra since they're already in 1.2 core */ +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +/* Reuse tokens from ARB_blend_func_extended */ +/* reuse GL_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_COLOR */ +/* reuse GL_ONE_MINUS_SRC1_ALPHA */ +/* reuse GL_MAX_DUAL_SOURCE_DRAW_BUFFERS */ +/* Reuse tokens from ARB_explicit_attrib_location (none) */ +/* Reuse tokens from ARB_occlusion_query2 */ +/* reuse GL_ANY_SAMPLES_PASSED */ +/* Reuse tokens from ARB_sampler_objects */ +/* reuse GL_SAMPLER_BINDING */ +/* Reuse tokens from ARB_shader_bit_encoding (none) */ +/* Reuse tokens from ARB_texture_rgb10_a2ui */ +/* reuse GL_RGB10_A2UI */ +/* Reuse tokens from ARB_texture_swizzle */ +/* reuse GL_TEXTURE_SWIZZLE_R */ +/* reuse GL_TEXTURE_SWIZZLE_G */ +/* reuse GL_TEXTURE_SWIZZLE_B */ +/* reuse GL_TEXTURE_SWIZZLE_A */ +/* reuse GL_TEXTURE_SWIZZLE_RGBA */ +/* Reuse tokens from ARB_timer_query */ +/* reuse GL_TIME_ELAPSED */ +/* reuse GL_TIMESTAMP */ +/* Reuse tokens from ARB_vertex_type_2_10_10_10_rev */ +/* reuse GL_INT_2_10_10_10_REV */ +#endif + +#ifndef GL_VERSION_4_0 +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F +/* Reuse tokens from ARB_texture_query_lod (none) */ +/* Reuse tokens from ARB_draw_buffers_blend (none) */ +/* Reuse tokens from ARB_draw_indirect */ +/* reuse GL_DRAW_INDIRECT_BUFFER */ +/* reuse GL_DRAW_INDIRECT_BUFFER_BINDING */ +/* Reuse tokens from ARB_gpu_shader5 */ +/* reuse GL_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MAX_GEOMETRY_SHADER_INVOCATIONS */ +/* reuse GL_MIN_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_MAX_FRAGMENT_INTERPOLATION_OFFSET */ +/* reuse GL_FRAGMENT_INTERPOLATION_OFFSET_BITS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +/* Reuse tokens from ARB_gpu_shader_fp64 */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +/* Reuse tokens from ARB_shader_subroutine */ +/* reuse GL_ACTIVE_SUBROUTINES */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORMS */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_ACTIVE_SUBROUTINE_MAX_LENGTH */ +/* reuse GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH */ +/* reuse GL_MAX_SUBROUTINES */ +/* reuse GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS */ +/* reuse GL_NUM_COMPATIBLE_SUBROUTINES */ +/* reuse GL_COMPATIBLE_SUBROUTINES */ +/* Reuse tokens from ARB_tessellation_shader */ +/* reuse GL_PATCHES */ +/* reuse GL_PATCH_VERTICES */ +/* reuse GL_PATCH_DEFAULT_INNER_LEVEL */ +/* reuse GL_PATCH_DEFAULT_OUTER_LEVEL */ +/* reuse GL_TESS_CONTROL_OUTPUT_VERTICES */ +/* reuse GL_TESS_GEN_MODE */ +/* reuse GL_TESS_GEN_SPACING */ +/* reuse GL_TESS_GEN_VERTEX_ORDER */ +/* reuse GL_TESS_GEN_POINT_MODE */ +/* reuse GL_ISOLINES */ +/* reuse GL_FRACTIONAL_ODD */ +/* reuse GL_FRACTIONAL_EVEN */ +/* reuse GL_MAX_PATCH_VERTICES */ +/* reuse GL_MAX_TESS_GEN_LEVEL */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS */ +/* reuse GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_PATCH_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS */ +/* reuse GL_MAX_TESS_CONTROL_INPUT_COMPONENTS */ +/* reuse GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS */ +/* reuse GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER */ +/* reuse GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_EVALUATION_SHADER */ +/* reuse GL_TESS_CONTROL_SHADER */ +/* Reuse tokens from ARB_texture_buffer_object_rgb32 (none) */ +/* Reuse tokens from ARB_transform_feedback2 */ +/* reuse GL_TRANSFORM_FEEDBACK */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED */ +/* reuse GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE */ +/* reuse GL_TRANSFORM_FEEDBACK_BINDING */ +/* Reuse tokens from ARB_transform_feedback3 */ +/* reuse GL_MAX_TRANSFORM_FEEDBACK_BUFFERS */ +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_VERSION_4_1 +/* Reuse tokens from ARB_ES2_compatibility */ +/* reuse GL_FIXED */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_TYPE */ +/* reuse GL_IMPLEMENTATION_COLOR_READ_FORMAT */ +/* reuse GL_LOW_FLOAT */ +/* reuse GL_MEDIUM_FLOAT */ +/* reuse GL_HIGH_FLOAT */ +/* reuse GL_LOW_INT */ +/* reuse GL_MEDIUM_INT */ +/* reuse GL_HIGH_INT */ +/* reuse GL_SHADER_COMPILER */ +/* reuse GL_NUM_SHADER_BINARY_FORMATS */ +/* reuse GL_MAX_VERTEX_UNIFORM_VECTORS */ +/* reuse GL_MAX_VARYING_VECTORS */ +/* reuse GL_MAX_FRAGMENT_UNIFORM_VECTORS */ +/* Reuse tokens from ARB_get_program_binary */ +/* reuse GL_PROGRAM_BINARY_RETRIEVABLE_HINT */ +/* reuse GL_PROGRAM_BINARY_LENGTH */ +/* reuse GL_NUM_PROGRAM_BINARY_FORMATS */ +/* reuse GL_PROGRAM_BINARY_FORMATS */ +/* Reuse tokens from ARB_separate_shader_objects */ +/* reuse GL_VERTEX_SHADER_BIT */ +/* reuse GL_FRAGMENT_SHADER_BIT */ +/* reuse GL_GEOMETRY_SHADER_BIT */ +/* reuse GL_TESS_CONTROL_SHADER_BIT */ +/* reuse GL_TESS_EVALUATION_SHADER_BIT */ +/* reuse GL_ALL_SHADER_BITS */ +/* reuse GL_PROGRAM_SEPARABLE */ +/* reuse GL_ACTIVE_PROGRAM */ +/* reuse GL_PROGRAM_PIPELINE_BINDING */ +/* Reuse tokens from ARB_shader_precision (none) */ +/* Reuse tokens from ARB_vertex_attrib_64bit - all are in GL 3.0 and 4.0 already */ +/* Reuse tokens from ARB_viewport_array - some are in GL 1.1 and ARB_provoking_vertex already */ +/* reuse GL_MAX_VIEWPORTS */ +/* reuse GL_VIEWPORT_SUBPIXEL_BITS */ +/* reuse GL_VIEWPORT_BOUNDS_RANGE */ +/* reuse GL_LAYER_PROVOKING_VERTEX */ +/* reuse GL_VIEWPORT_INDEX_PROVOKING_VERTEX */ +/* reuse GL_UNDEFINED_VERTEX */ +#endif + +#ifndef GL_ARB_multitexture +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 +#endif + +#ifndef GL_ARB_multisample +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 +#endif + +#ifndef GL_ARB_texture_env_add +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C +#endif + +#ifndef GL_ARB_texture_compression +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_CLAMP_TO_BORDER_ARB 0x812D +#endif + +#ifndef GL_ARB_point_parameters +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_ARB 0x8370 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B +#endif + +#ifndef GL_ARB_shadow +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF +#endif + +#ifndef GL_ARB_window_pos +#endif + +#ifndef GL_ARB_vertex_program +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF +#endif + +#ifndef GL_ARB_fragment_program +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 +#endif + +#ifndef GL_ARB_shader_objects +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#endif + +#ifndef GL_ARB_point_sprite +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_HALF_FLOAT_ARB 0x140B +#endif + +#ifndef GL_ARB_texture_float +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD +#endif + +#ifndef GL_ARB_draw_instanced +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_DRAW_FRAMEBUFFER_BINDING GL_FRAMEBUFFER_BINDING +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 +#endif + +#ifndef GL_ARB_framebuffer_object_DEPRECATED +#define GL_INDEX 0x8222 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB 0x8DB9 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_LINES_ADJACENCY_ARB 0x000A +#define GL_LINE_STRIP_ADJACENCY_ARB 0x000B +#define GL_TRIANGLES_ADJACENCY_ARB 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0x000D +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 +/* reuse GL_MAX_VARYING_COMPONENTS */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_HALF_FLOAT 0x140B +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE +#endif + +#ifndef GL_ARB_texture_rg +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING 0x85B5 +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFFu +#endif + +#ifndef GL_ARB_compatibility +/* ARB_compatibility just defines tokens from core 3.0 */ +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 +#endif + +#ifndef GL_ARB_shader_texture_lod +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_DEPTH_CLAMP 0x864F +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F +#endif + +#ifndef GL_ARB_sync +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 +#endif + +#ifndef GL_ARB_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_ARB_draw_buffers_blend +#endif + +#ifndef GL_ARB_sample_shading +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F +#endif + +#ifndef GL_ARB_texture_gather +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#endif + +#ifndef GL_ARB_texture_query_lod +#endif + +#ifndef GL_ARB_shading_language_include +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_SRC1_COLOR 0x88F9 +/* reuse GL_SRC1_ALPHA */ +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC +#endif + +#ifndef GL_ARB_explicit_attrib_location +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_SAMPLER_BINDING 0x8919 +#endif + +#ifndef GL_ARB_shader_bit_encoding +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_RGB10_A2UI 0x906F +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#endif + +#ifndef GL_ARB_timer_query +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +/* reuse GL_UNSIGNED_INT_2_10_10_10_REV */ +#define GL_INT_2_10_10_10_REV 0x8D9F +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +/* reuse GL_MAX_VERTEX_STREAMS */ +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B +/* reuse GL_UNIFORM_SIZE */ +/* reuse GL_UNIFORM_NAME_LENGTH */ +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_PATCHES 0x000E +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +/* reuse GL_TRIANGLES */ +/* reuse GL_QUADS */ +#define GL_ISOLINES 0x8E7A +/* reuse GL_EQUAL */ +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +/* reuse GL_CCW */ +/* reuse GL_CW */ +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +/* reuse GL_RGB32F */ +/* reuse GL_RGB32UI */ +/* reuse GL_RGB32I */ +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_ALL_SHADER_BITS 0xFFFFFFFF +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#endif + +#ifndef GL_ARB_shader_precision +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +/* reuse GL_RGB32I */ +/* reuse GL_DOUBLE_VEC2 */ +/* reuse GL_DOUBLE_VEC3 */ +/* reuse GL_DOUBLE_VEC4 */ +/* reuse GL_DOUBLE_MAT2 */ +/* reuse GL_DOUBLE_MAT3 */ +/* reuse GL_DOUBLE_MAT4 */ +/* reuse GL_DOUBLE_MAT2x3 */ +/* reuse GL_DOUBLE_MAT2x4 */ +/* reuse GL_DOUBLE_MAT3x2 */ +/* reuse GL_DOUBLE_MAT3x4 */ +/* reuse GL_DOUBLE_MAT4x2 */ +/* reuse GL_DOUBLE_MAT4x3 */ +#endif + +#ifndef GL_ARB_viewport_array +/* reuse GL_SCISSOR_BOX */ +/* reuse GL_VIEWPORT */ +/* reuse GL_DEPTH_RANGE */ +/* reuse GL_SCISSOR_TEST */ +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +/* reuse GL_FIRST_VERTEX_CONVENTION */ +/* reuse GL_LAST_VERTEX_CONVENTION */ +/* reuse GL_PROVOKING_VERTEX */ +#endif + +#ifndef GL_ARB_cl_event +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 +#endif + +#ifndef GL_ARB_debug_output +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 +#endif + +#ifndef GL_ARB_robustness +/* reuse GL_NO_ERROR */ +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 +#endif + +#ifndef GL_ARB_shader_stencil_export +#endif + +#ifndef GL_EXT_abgr +#define GL_ABGR_EXT 0x8000 +#endif + +#ifndef GL_EXT_blend_color +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 +#endif + +#ifndef GL_EXT_texture +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 +#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 +#endif + +#ifndef GL_EXT_texture3D +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_FILTER4_SGIS 0x8146 +#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 +#endif + +#ifndef GL_EXT_subtexture +#endif + +#ifndef GL_EXT_copy_texture +#endif + +#ifndef GL_EXT_histogram +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 +#define GL_TABLE_TOO_LARGE_EXT 0x8031 +#endif + +#ifndef GL_EXT_convolution +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 +#endif + +#ifndef GL_SGI_color_matrix +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB +#endif + +#ifndef GL_SGI_color_table +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_PIXEL_TEXTURE_SGIS 0x8353 +#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 +#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 +#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_PIXEL_TEX_GEN_SGIX 0x8139 +#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B +#endif + +#ifndef GL_SGIS_texture4D +#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 +#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 +#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 +#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 +#define GL_TEXTURE_4D_SGIS 0x8134 +#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 +#define GL_TEXTURE_4DSIZE_SGIS 0x8136 +#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 +#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 +#define GL_TEXTURE_4D_BINDING_SGIS 0x814F +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD +#endif + +#ifndef GL_EXT_cmyka +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F +#endif + +#ifndef GL_EXT_texture_object +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 +#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 +#define GL_LINEAR_DETAIL_SGIS 0x8097 +#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 +#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 +#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A +#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B +#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_LINEAR_SHARPEN_SGIS 0x80AD +#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE +#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF +#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D +#endif + +#ifndef GL_SGIS_multisample +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_RESCALE_NORMAL_EXT 0x803A +#endif + +#ifndef GL_EXT_vertex_array +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 +#endif + +#ifndef GL_EXT_misc_attribute +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 +#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 +#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 +#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 +#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 +#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 +#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 +#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 +#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 +#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D +#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E +#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F +#endif + +#ifndef GL_SGIX_shadow +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_CLAMP_TO_EDGE_SGIS 0x812F +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_CLAMP_TO_BORDER_SGIS 0x812D +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B +#endif + +#ifndef GL_EXT_blend_logic_op +#endif + +#ifndef GL_SGIX_interlace +#define GL_INTERLACE_SGIX 0x8094 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E +#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F +#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 +#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 +#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 +#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 +#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 +#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 +#endif + +#ifndef GL_SGIS_texture_select +#define GL_DUAL_ALPHA4_SGIS 0x8110 +#define GL_DUAL_ALPHA8_SGIS 0x8111 +#define GL_DUAL_ALPHA12_SGIS 0x8112 +#define GL_DUAL_ALPHA16_SGIS 0x8113 +#define GL_DUAL_LUMINANCE4_SGIS 0x8114 +#define GL_DUAL_LUMINANCE8_SGIS 0x8115 +#define GL_DUAL_LUMINANCE12_SGIS 0x8116 +#define GL_DUAL_LUMINANCE16_SGIS 0x8117 +#define GL_DUAL_INTENSITY4_SGIS 0x8118 +#define GL_DUAL_INTENSITY8_SGIS 0x8119 +#define GL_DUAL_INTENSITY12_SGIS 0x811A +#define GL_DUAL_INTENSITY16_SGIS 0x811B +#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C +#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D +#define GL_QUAD_ALPHA4_SGIS 0x811E +#define GL_QUAD_ALPHA8_SGIS 0x811F +#define GL_QUAD_LUMINANCE4_SGIS 0x8120 +#define GL_QUAD_LUMINANCE8_SGIS 0x8121 +#define GL_QUAD_INTENSITY4_SGIS 0x8122 +#define GL_QUAD_INTENSITY8_SGIS 0x8123 +#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 +#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SPRITE_SGIX 0x8148 +#define GL_SPRITE_MODE_SGIX 0x8149 +#define GL_SPRITE_AXIS_SGIX 0x814A +#define GL_SPRITE_TRANSLATION_SGIX 0x814B +#define GL_SPRITE_AXIAL_SGIX 0x814C +#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D +#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E +#endif + +#ifndef GL_EXT_point_parameters +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_POINT_SIZE_MIN_SGIS 0x8126 +#define GL_POINT_SIZE_MAX_SGIS 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 +#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 +#endif + +#ifndef GL_SGIX_instruments +#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 +#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C +#endif + +#ifndef GL_SGIX_framezoom +#define GL_FRAMEZOOM_SGIX 0x818B +#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C +#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#endif + +#ifndef GL_FfdMaskSGIX +#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 +#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 +#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 +#define GL_DEFORMATIONS_MASK_SGIX 0x8196 +#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_REFERENCE_PLANE_SGIX 0x817D +#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E +#endif + +#ifndef GL_SGIX_flush_raster +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_FOG_FUNC_SGIS 0x812A +#define GL_FOG_FUNC_POINTS_SGIS 0x812B +#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 +#endif + +#ifndef GL_HP_image_transform +#define GL_IMAGE_SCALE_X_HP 0x8155 +#define GL_IMAGE_SCALE_Y_HP 0x8156 +#define GL_IMAGE_TRANSLATE_X_HP 0x8157 +#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 +#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 +#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A +#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B +#define GL_IMAGE_MAG_FILTER_HP 0x815C +#define GL_IMAGE_MIN_FILTER_HP 0x815D +#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E +#define GL_CUBIC_HP 0x815F +#define GL_AVERAGE_HP 0x8160 +#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 +#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 +#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_IGNORE_BORDER_HP 0x8150 +#define GL_CONSTANT_BORDER_HP 0x8151 +#define GL_REPLICATE_BORDER_HP 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 +#endif + +#ifndef GL_INGR_palette_buffer +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE +#endif + +#ifndef GL_EXT_color_subtable +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_VERTEX_DATA_HINT_PGI 0x1A22A +#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B +#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C +#define GL_MAX_VERTEX_HINT_PGI 0x1A22D +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 +#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD +#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 +#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C +#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E +#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F +#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 +#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 +#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 +#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 +#define GL_CLIP_NEAR_HINT_PGI 0x1A220 +#define GL_CLIP_FAR_HINT_PGI 0x1A221 +#define GL_WIDE_LINE_HINT_PGI 0x1A222 +#define GL_BACK_NORMALS_HINT_PGI 0x1A223 +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_LIST_PRIORITY_SGIX 0x8182 +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_IR_INSTRUMENT1_SGIX 0x817F +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E +#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F +#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SHADOW_AMBIENT_SGIX 0x80BF +#endif + +#ifndef GL_EXT_index_texture +#endif + +#ifndef GL_EXT_index_material +#define GL_INDEX_MATERIAL_EXT 0x81B8 +#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 +#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA +#endif + +#ifndef GL_EXT_index_func +#define GL_INDEX_TEST_EXT 0x81B5 +#define GL_INDEX_TEST_FUNC_EXT 0x81B6 +#define GL_INDEX_TEST_REF_EXT 0x81B7 +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_IUI_V2F_EXT 0x81AD +#define GL_IUI_V3F_EXT 0x81AE +#define GL_IUI_N3F_V2F_EXT 0x81AF +#define GL_IUI_N3F_V3F_EXT 0x81B0 +#define GL_T2F_IUI_V2F_EXT 0x81B1 +#define GL_T2F_IUI_V3F_EXT 0x81B2 +#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 +#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_YCRCB_422_SGIX 0x81BB +#define GL_YCRCB_444_SGIX 0x81BC +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 +#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 +#define GL_LIGHT_ENV_MODE_SGIX 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B +#define GL_FRAGMENT_LIGHT0_SGIX 0x840C +#define GL_FRAGMENT_LIGHT1_SGIX 0x840D +#define GL_FRAGMENT_LIGHT2_SGIX 0x840E +#define GL_FRAGMENT_LIGHT3_SGIX 0x840F +#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 +#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 +#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 +#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 +#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 +#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 +#endif + +#ifndef GL_WIN_phong_shading +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB +#endif + +#ifndef GL_WIN_specular_fog +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC +#endif + +#ifndef GL_EXT_light_texture +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +/* reuse GL_FRAGMENT_DEPTH_EXT */ +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 +#endif + +#ifndef GL_SGIX_impact_pixel_texture +#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 +#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 +#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 +#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 +#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 +#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 +#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A +#endif + +#ifndef GL_EXT_bgra +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 +#endif + +#ifndef GL_SGIX_async +#define GL_ASYNC_MARKER_SGIX 0x8329 +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D +#endif + +#ifndef GL_INTEL_texture_scissor +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 +#endif + +#ifndef GL_HP_occlusion_test +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA +#endif + +#ifndef GL_EXT_secondary_color +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF +#endif + +#ifndef GL_EXT_multi_draw_arrays +#endif + +#ifndef GL_EXT_fog_coord +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_TRANSFORM_HINT_APPLE 0x85B1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_FOG_SCALE_SGIX 0x81FC +#define GL_FOG_SCALE_VALUE_SGIX 0x81FD +#endif + +#ifndef GL_SUNX_constant_data +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 +#endif + +#ifndef GL_SUN_global_alpha +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA +#endif + +#ifndef GL_SUN_triangle_list +#define GL_RESTART_SUN 0x0001 +#define GL_REPLACE_MIDDLE_SUN 0x0002 +#define GL_REPLACE_OLDEST_SUN 0x0003 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB +#endif + +#ifndef GL_SUN_vertex +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB +#endif + +#ifndef GL_INGR_color_clamp +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INTERLACE_READ_INGR 0x8568 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 +#endif + +#ifndef GL_EXT_texture_cube_map +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_WRAP_BORDER_SUN 0x81D4 +#endif + +#ifndef GL_EXT_texture_env_add +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW0_EXT GL_MODELVIEW +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 +#endif + +#ifndef GL_NV_register_combiners +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 +/* reuse GL_TEXTURE0_ARB */ +/* reuse GL_TEXTURE1_ARB */ +/* reuse GL_ZERO */ +/* reuse GL_NONE */ +/* reuse GL_FOG */ +#endif + +#ifndef GL_NV_fog_distance +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C +/* reuse GL_EYE_PLANE */ +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F +#endif + +#ifndef GL_NV_blend_square +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B +#endif + +#ifndef GL_MESA_resize_buffers +#endif + +#ifndef GL_MESA_window_pos +#endif + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_CULL_VERTEX_IBM 103050 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 +#endif + +#ifndef GL_SGIX_subsample +#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 +#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 +#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 +#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 +#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_YCRCB_SGIX 0x8318 +#define GL_YCRCBA_SGIX 0x8319 +#endif + +#ifndef GL_SGI_depth_pass_instrument +#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 +#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 +#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 +#endif + +#ifndef GL_3DFX_tbuffer +#endif + +#ifndef GL_EXT_multisample +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_CONVOLUTION_HINT_SGIX 0x8316 +#endif + +#ifndef GL_SGIX_resample +#define GL_PACK_RESAMPLE_SGIX 0x842C +#define GL_UNPACK_RESAMPLE_SGIX 0x842D +#define GL_RESAMPLE_REPLICATE_SGIX 0x842E +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 +#endif + +#ifndef GL_NV_fence +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 +#endif + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_MIRRORED_REPEAT_IBM 0x8370 +#endif + +#ifndef GL_NV_evaluators +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 +#endif + +#ifndef GL_NV_texture_compression_vtc +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 +#endif + +#ifndef GL_NV_texture_shader +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV +#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV +#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 +#endif + +#ifndef GL_NV_vertex_program +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SCALEBIAS_HINT_SGIX 0x8322 +#endif + +#ifndef GL_OML_interlace +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 +#endif + +#ifndef GL_OML_subsample +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 +#endif + +#ifndef GL_OML_resample +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_REG_6_ATI 0x8927 +#define GL_REG_7_ATI 0x8928 +#define GL_REG_8_ATI 0x8929 +#define GL_REG_9_ATI 0x892A +#define GL_REG_10_ATI 0x892B +#define GL_REG_11_ATI 0x892C +#define GL_REG_12_ATI 0x892D +#define GL_REG_13_ATI 0x892E +#define GL_REG_14_ATI 0x892F +#define GL_REG_15_ATI 0x8930 +#define GL_REG_16_ATI 0x8931 +#define GL_REG_17_ATI 0x8932 +#define GL_REG_18_ATI 0x8933 +#define GL_REG_19_ATI 0x8934 +#define GL_REG_20_ATI 0x8935 +#define GL_REG_21_ATI 0x8936 +#define GL_REG_22_ATI 0x8937 +#define GL_REG_23_ATI 0x8938 +#define GL_REG_24_ATI 0x8939 +#define GL_REG_25_ATI 0x893A +#define GL_REG_26_ATI 0x893B +#define GL_REG_27_ATI 0x893C +#define GL_REG_28_ATI 0x893D +#define GL_REG_29_ATI 0x893E +#define GL_REG_30_ATI 0x893F +#define GL_REG_31_ATI 0x8940 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_CON_8_ATI 0x8949 +#define GL_CON_9_ATI 0x894A +#define GL_CON_10_ATI 0x894B +#define GL_CON_11_ATI 0x894C +#define GL_CON_12_ATI 0x894D +#define GL_CON_13_ATI 0x894E +#define GL_CON_14_ATI 0x894F +#define GL_CON_15_ATI 0x8950 +#define GL_CON_16_ATI 0x8951 +#define GL_CON_17_ATI 0x8952 +#define GL_CON_18_ATI 0x8953 +#define GL_CON_19_ATI 0x8954 +#define GL_CON_20_ATI 0x8955 +#define GL_CON_21_ATI 0x8956 +#define GL_CON_22_ATI 0x8957 +#define GL_CON_23_ATI 0x8958 +#define GL_CON_24_ATI 0x8959 +#define GL_CON_25_ATI 0x895A +#define GL_CON_26_ATI 0x895B +#define GL_CON_27_ATI 0x895C +#define GL_CON_28_ATI 0x895D +#define GL_CON_29_ATI 0x895E +#define GL_CON_30_ATI 0x895F +#define GL_CON_31_ATI 0x8960 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B +#define GL_RED_BIT_ATI 0x00000001 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_STREAM0_ATI 0x876C +#define GL_VERTEX_STREAM1_ATI 0x876D +#define GL_VERTEX_STREAM2_ATI 0x876E +#define GL_VERTEX_STREAM3_ATI 0x876F +#define GL_VERTEX_STREAM4_ATI 0x8770 +#define GL_VERTEX_STREAM5_ATI 0x8771 +#define GL_VERTEX_STREAM6_ATI 0x8772 +#define GL_VERTEX_STREAM7_ATI 0x8773 +#define GL_VERTEX_SOURCE_ATI 0x8774 +#endif + +#ifndef GL_ATI_element_array +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A +#endif + +#ifndef GL_SUN_mesh_array +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SLICE_ACCUM_SUN 0x85CC +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_DEPTH_CLAMP_NV 0x864F +#endif + +#ifndef GL_NV_occlusion_query +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 +#endif + +#ifndef GL_NV_point_sprite +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 +#endif + +#ifndef GL_NV_vertex_program1_1 +#endif + +#ifndef GL_EXT_shadow_funcs +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 +#endif + +#ifndef GL_APPLE_element_array +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E +#endif + +#ifndef GL_APPLE_fence +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#endif + +#ifndef GL_S3_s3tc +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 +#endif + +#ifndef GL_ATI_texture_float +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F +#endif + +#ifndef GL_NV_float_buffer +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E +#endif + +#ifndef GL_NV_fragment_program +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 +#endif + +#ifndef GL_NV_half_float +#define GL_HALF_FLOAT_NV 0x140B +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D +#endif + +#ifndef GL_NV_primitive_restart +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F +#endif + +#ifndef GL_NV_vertex_program2 +#endif + +#ifndef GL_ATI_map_object_buffer +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#endif + +#ifndef GL_OES_read_format +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D +#endif + +#ifndef GL_MESA_pack_invert +#define GL_PACK_INVERT_MESA 0x8758 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF +#endif + +#ifndef GL_NV_fragment_program_option +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 +#endif + +#ifndef GL_NV_vertex_program2_option +/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ +/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ +#endif + +#ifndef GL_NV_vertex_program3 +/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 +#endif + +#ifndef GL_GREMEDY_string_marker +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT GL_FRAMEBUFFER_BINDING_EXT +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E +#endif + +#ifndef GL_EXT_timer_query +#define GL_TIME_ELAPSED_EXT 0x88BF +#endif + +#ifndef GL_EXT_gpu_program_parameters +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_LINES_ADJACENCY_EXT 0x000A +#define GL_LINE_STRIP_ADJACENCY_EXT 0x000B +#define GL_TRIANGLES_ADJACENCY_EXT 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0x000D +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +/* reuse GL_GEOMETRY_VERTICES_OUT_EXT */ +/* reuse GL_GEOMETRY_INPUT_TYPE_EXT */ +/* reuse GL_GEOMETRY_OUTPUT_TYPE_EXT */ +/* reuse GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT */ +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 +/* reuse GL_LINES_ADJACENCY_EXT */ +/* reuse GL_LINE_STRIP_ADJACENCY_EXT */ +/* reuse GL_TRIANGLES_ADJACENCY_EXT */ +/* reuse GL_TRIANGLE_STRIP_ADJACENCY_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT */ +/* reuse GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT */ +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +/* reuse GL_PROGRAM_POINT_SIZE_EXT */ +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 +#endif + +#ifndef GL_EXT_draw_instanced +#endif + +#ifndef GL_EXT_packed_float +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C +#endif + +#ifndef GL_EXT_texture_array +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +/* reuse GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF +#endif + +#ifndef GL_NV_fragment_program4 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA +#endif + +#ifndef GL_NV_geometry_shader4 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 +#endif + +#ifndef GL_EXT_draw_buffers2 +#endif + +#ifndef GL_NV_transform_feedback +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_ATTRIBS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F +#define GL_LAYER_NV 0x8DAA +#define GL_NEXT_BUFFER_NV -2 +#define GL_SKIP_COMPONENTS4_NV -3 +#define GL_SKIP_COMPONENTS3_NV -4 +#define GL_SKIP_COMPONENTS2_NV -5 +#define GL_SKIP_COMPONENTS1_NV -6 +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF +#endif + +#ifndef GL_EXT_texture_integer +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E +#endif + +#ifndef GL_GREMEDY_frame_terminator +#endif + +#ifndef GL_NV_conditional_render +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 +#endif + +#ifndef GL_NV_present_video +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F +#endif + +#ifndef GL_EXT_vertex_array_bgra +/* reuse GL_BGRA */ +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 +#endif + +#ifndef GL_ATI_meminfo +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 +#endif + +#ifndef GL_AMD_texture_texture4 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B +/* reuse GL_RED_SNORM */ +/* reuse GL_RG_SNORM */ +/* reuse GL_RGB_SNORM */ +/* reuse GL_RGBA_SNORM */ +/* reuse GL_R8_SNORM */ +/* reuse GL_RG8_SNORM */ +/* reuse GL_RGB8_SNORM */ +/* reuse GL_RGBA8_SNORM */ +/* reuse GL_R16_SNORM */ +/* reuse GL_RG16_SNORM */ +/* reuse GL_RGB16_SNORM */ +/* reuse GL_RGBA16_SNORM */ +/* reuse GL_SIGNED_NORMALIZED */ +#endif + +#ifndef GL_AMD_draw_buffers_blend +#endif + +#ifndef GL_APPLE_texture_range +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +/* reuse GL_STORAGE_CACHED_APPLE */ +/* reuse GL_STORAGE_SHARED_APPLE */ +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 +#endif + +#ifndef GL_APPLE_rgb_422 +#define GL_RGB_422_APPLE 0x8A1F +/* reuse GL_UNSIGNED_SHORT_8_8_APPLE */ +/* reuse GL_UNSIGNED_SHORT_8_8_REV_APPLE */ +#endif + +#ifndef GL_NV_video_capture +#define GL_VIDEO_BUFFER_NV 0x9020 +#define GL_VIDEO_BUFFER_BINDING_NV 0x9021 +#define GL_FIELD_UPPER_NV 0x9022 +#define GL_FIELD_LOWER_NV 0x9023 +#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024 +#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025 +#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026 +#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027 +#define GL_VIDEO_BUFFER_PITCH_NV 0x9028 +#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029 +#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A +#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B +#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C +#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D +#define GL_PARTIAL_SUCCESS_NV 0x902E +#define GL_SUCCESS_NV 0x902F +#define GL_FAILURE_NV 0x9030 +#define GL_YCBYCR8_422_NV 0x9031 +#define GL_YCBAYCR8A_4224_NV 0x9032 +#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033 +#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034 +#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035 +#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036 +#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037 +#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038 +#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039 +#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A +#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B +#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C +#endif + +#ifndef GL_NV_copy_image +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 +#endif + +#ifndef GL_NV_texture_barrier +#endif + +#ifndef GL_AMD_shader_stencil_export +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +/* reuse GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB */ +#endif + +#ifndef GL_AMD_conservative_depth +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +/* reuse GL_DOUBLE */ +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MAX_PROGRAM_SUBROUTINE_PARAMETERS_NV 0x8F44 +#define GL_MAX_PROGRAM_SUBROUTINE_NUM_NV 0x8F45 +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB +/* reuse GL_PATCHES */ +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV 0x00000010 +/* reuse GL_READ_WRITE */ +/* reuse GL_WRITE_ONLY */ +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +/* reuse GL_INT64_NV */ +/* reuse GL_UNSIGNED_INT64_NV */ +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 +#endif + +#ifndef GL_AMD_debug_output +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#endif + + +/*************************************************************/ + +#include +#ifndef GL_VERSION_2_0 +/* GL type for program/shader text */ +typedef char GLchar; +#endif + +#ifndef GL_VERSION_1_5 +/* GL types for handling large vertex buffer objects */ +#if defined(__APPLE__) +typedef long GLintptr; +typedef long GLsizeiptr; +#else +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; +#endif +#endif + +#ifndef GL_ARB_vertex_buffer_object +/* GL types for handling large vertex buffer objects */ +#if defined(__APPLE__) +typedef long GLintptrARB; +typedef long GLsizeiptrARB; +#else +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; +#endif +#endif + +#ifndef GL_ARB_shader_objects +/* GL types for program/shader text and shader object handles */ +typedef char GLcharARB; +#if defined(__APPLE__) +typedef void *GLhandleARB; +#else +typedef unsigned int GLhandleARB; +#endif +#endif + +/* GL type for "half" precision (s10e5) float data in host memory */ +#ifndef GL_ARB_half_float_pixel +typedef unsigned short GLhalfARB; +#endif + +#ifndef GL_NV_half_float +typedef unsigned short GLhalfNV; +#endif + +#ifndef GLEXT_64_TYPES_DEFINED +/* This code block is duplicated in glxext.h, so must be protected */ +#define GLEXT_64_TYPES_DEFINED +/* Define int32_t, int64_t, and uint64_t types for UST/MSC */ +/* (as used in the GL_EXT_timer_query extension). */ +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +#include +#elif defined(__sun__) || defined(__digital__) +#include +#if defined(__STDC__) +#if defined(__arch64__) || defined(_LP64) +typedef long int int64_t; +typedef unsigned long int uint64_t; +#else +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#endif /* __arch64__ */ +#endif /* __STDC__ */ +#elif defined( __VMS ) || defined(__sgi) +#include +#elif defined(__SCO__) || defined(__USLC__) +#include +#elif defined(__UNIXOS2__) || defined(__SOL64__) +typedef long int int32_t; +typedef long long int int64_t; +typedef unsigned long long int uint64_t; +#elif defined(_WIN32) && defined(__GNUC__) +#include +#elif defined(_WIN32) +typedef __int32 int32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +#else +/* Fallback if nothing above works */ +#include +#endif +#endif + +#ifndef GL_EXT_timer_query +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif + +#ifndef GL_ARB_sync +typedef int64_t GLint64; +typedef uint64_t GLuint64; +typedef struct __GLsync *GLsync; +#endif + +#ifndef GL_ARB_cl_event +/* These incomplete types let us declare types compatible with OpenCL's cl_context and cl_event */ +struct _cl_context; +struct _cl_event; +#endif + +#ifndef GL_ARB_debug_output +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_AMD_debug_output +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam); +#endif + +#ifndef GL_NV_vdpau_interop +typedef GLintptr GLvdpauSurfaceNV; +#endif + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void APIENTRY glBlendEquation (GLenum mode); +GLAPI void APIENTRY glDrawRangeElements (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void APIENTRY glTexImage3D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_VERSION_1_2_DEPRECATED +#define GL_VERSION_1_2_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTable (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTable (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTable (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glColorSubTable (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTable (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glConvolutionFilter1D (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterf (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteri (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilter (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilter (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2D (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +GLAPI void APIENTRY glGetHistogram (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmax (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogram (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmax (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogram (GLenum target); +GLAPI void APIENTRY glResetMinmax (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); +#endif + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTexture (GLenum texture); +GLAPI void APIENTRY glSampleCoverage (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_VERSION_1_3_DEPRECATED +#define GL_VERSION_1_3_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientActiveTexture (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1d (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1f (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1i (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1s (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2d (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2f (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2i (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2s (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3d (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3f (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3i (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3s (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4d (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dv (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fv (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4i (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4iv (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4s (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4sv (GLenum target, const GLshort *v); +GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *m); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); +#endif + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +GLAPI void APIENTRY glMultiDrawArrays (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElements (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +GLAPI void APIENTRY glPointParameterf (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glPointParameteri (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameteriv (GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_VERSION_1_4_DEPRECATED +#define GL_VERSION_1_4_DEPRECATED 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordf (GLfloat coord); +GLAPI void APIENTRY glFogCoordfv (const GLfloat *coord); +GLAPI void APIENTRY glFogCoordd (GLdouble coord); +GLAPI void APIENTRY glFogCoorddv (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glSecondaryColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3i (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3iv (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glWindowPos2d (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2f (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2i (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2iv (const GLint *v); +GLAPI void APIENTRY glWindowPos2s (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2sv (const GLshort *v); +GLAPI void APIENTRY glWindowPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dv (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fv (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3i (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3iv (const GLint *v); +GLAPI void APIENTRY glWindowPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3sv (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); +#endif + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueries (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueries (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQuery (GLuint id); +GLAPI void APIENTRY glBeginQuery (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQuery (GLenum target); +GLAPI void APIENTRY glGetQueryiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectiv (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuiv (GLuint id, GLenum pname, GLuint *params); +GLAPI void APIENTRY glBindBuffer (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffers (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBuffer (GLuint buffer); +GLAPI void APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBuffer (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum target); +GLAPI void APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointerv (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glDrawBuffers (GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask); +GLAPI void APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask); +GLAPI void APIENTRY glAttachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name); +GLAPI void APIENTRY glCompileShader (GLuint shader); +GLAPI GLuint APIENTRY glCreateProgram (void); +GLAPI GLuint APIENTRY glCreateShader (GLenum type); +GLAPI void APIENTRY glDeleteProgram (GLuint program); +GLAPI void APIENTRY glDeleteShader (GLuint shader); +GLAPI void APIENTRY glDetachShader (GLuint program, GLuint shader); +GLAPI void APIENTRY glDisableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glEnableVertexAttribArray (GLuint index); +GLAPI void APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +GLAPI GLint APIENTRY glGetAttribLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +GLAPI void APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +GLAPI GLint APIENTRY glGetUniformLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdv (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgram (GLuint program); +GLAPI GLboolean APIENTRY glIsShader (GLuint shader); +GLAPI void APIENTRY glLinkProgram (GLuint program); +GLAPI void APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +GLAPI void APIENTRY glUseProgram (GLuint program); +GLAPI void APIENTRY glUniform1f (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1i (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2i (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glValidateProgram (GLuint program); +GLAPI void APIENTRY glVertexAttrib1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1f (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1s (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2s (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3s (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4Niv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4Nub (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4s (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask); +typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); +typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); +typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); +typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformMatrix2x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix2x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3x4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4x3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +#endif + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 +/* OpenGL 3.0 also reuses entry points from these extensions: */ +/* ARB_framebuffer_object */ +/* ARB_map_buffer_range */ +/* ARB_vertex_array_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaski (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleani_v (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegeri_v (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnablei (GLenum target, GLuint index); +GLAPI void APIENTRY glDisablei (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledi (GLenum target, GLuint index); +GLAPI void APIENTRY glBeginTransformFeedback (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedback (void); +GLAPI void APIENTRY glBindBufferRange (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferBase (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryings (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVarying (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glClampColor (GLenum target, GLenum clamp); +GLAPI void APIENTRY glBeginConditionalRender (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRender (void); +GLAPI void APIENTRY glVertexAttribIPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIiv (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuiv (GLuint index, GLenum pname, GLuint *params); +GLAPI void APIENTRY glVertexAttribI1i (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2i (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3i (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4i (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1ui (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2ui (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3ui (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4ui (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4iv (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uiv (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bv (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4sv (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubv (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usv (GLuint index, const GLushort *v); +GLAPI void APIENTRY glGetUniformuiv (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocation (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocation (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1ui (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2ui (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3ui (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4ui (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uiv (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glTexParameterIiv (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuiv (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIiv (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuiv (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value); +GLAPI void APIENTRY glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value); +GLAPI void APIENTRY glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value); +GLAPI void APIENTRY glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +GLAPI const GLubyte * APIENTRY glGetStringi (GLenum name, GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKIPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANI_VPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEIPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDIPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLCLAMPCOLORPROC) (GLenum target, GLenum clamp); +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLGETUNIFORMUIVPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat *value); +typedef void (APIENTRYP PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil); +typedef const GLubyte * (APIENTRYP PFNGLGETSTRINGIPROC) (GLenum name, GLuint index); +#endif + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 +/* OpenGL 3.1 also reuses entry points from these extensions: */ +/* ARB_copy_buffer */ +/* ARB_uniform_buffer_object */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstanced (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstanced (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +GLAPI void APIENTRY glTexBuffer (GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glPrimitiveRestartIndex (GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +typedef void (APIENTRYP PFNGLTEXBUFFERPROC) (GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint index); +#endif + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 +/* OpenGL 3.2 also reuses entry points from these extensions: */ +/* ARB_draw_elements_base_vertex */ +/* ARB_provoking_vertex */ +/* ARB_sync */ +/* ARB_texture_multisample */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetInteger64i_v (GLenum target, GLuint index, GLint64 *data); +GLAPI void APIENTRY glGetBufferParameteri64v (GLenum target, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glFramebufferTexture (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETINTEGER64I_VPROC) (GLenum target, GLuint index, GLint64 *data); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum target, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +#endif + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 +/* OpenGL 3.3 also reuses entry points from these extensions: */ +/* ARB_blend_func_extended */ +/* ARB_sampler_objects */ +/* ARB_explicit_attrib_location, but it has none */ +/* ARB_occlusion_query2 (no entry points) */ +/* ARB_shader_bit_encoding (no entry points) */ +/* ARB_texture_rgb10_a2ui (no entry points) */ +/* ARB_texture_swizzle (no entry points) */ +/* ARB_timer_query */ +/* ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisor (GLuint index, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 +/* OpenGL 4.0 also reuses entry points from these extensions: */ +/* ARB_texture_query_lod (no entry points) */ +/* ARB_draw_indirect */ +/* ARB_gpu_shader5 (no entry points) */ +/* ARB_gpu_shader_fp64 */ +/* ARB_shader_subroutine */ +/* ARB_tessellation_shader */ +/* ARB_texture_buffer_object_rgb32 (no entry points) */ +/* ARB_texture_cube_map_array (no entry points) */ +/* ARB_texture_gather (no entry points) */ +/* ARB_transform_feedback2 */ +/* ARB_transform_feedback3 */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShading (GLclampf value); +GLAPI void APIENTRY glBlendEquationi (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparatei (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunci (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparatei (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGPROC) (GLclampf value); +typedef void (APIENTRYP PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 +/* OpenGL 4.1 also reuses entry points from these extensions: */ +/* ARB_ES2_compatibility */ +/* ARB_get_program_binary */ +/* ARB_separate_shader_objects */ +/* ARB_shader_precision (no entry points) */ +/* ARB_vertex_attrib_64bit */ +/* ARB_viewport_array */ +#endif + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glClientActiveTextureARB (GLenum texture); +GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum target, GLdouble s); +GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum target, GLfloat s); +GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum target, GLint s); +GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum target, GLshort s); +GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum target, GLdouble s, GLdouble t); +GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum target, GLfloat s, GLfloat t); +GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum target, GLint s, GLint t); +GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum target, GLshort s, GLshort t); +GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r); +GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r); +GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum target, GLint s, GLint t, GLint r); +GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum target, GLshort s, GLshort t, GLshort r); +GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum target, const GLshort *v); +GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum target, const GLdouble *v); +GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum target, const GLfloat *v); +GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum target, GLint s, GLint t, GLint r, GLint q); +GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum target, const GLint *v); +GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum target, const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); +#endif + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *m); +GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *m); +GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *m); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); +typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); +#endif + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleCoverageARB (GLclampf value, GLboolean invert); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); +#endif + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 +#endif + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 +#endif + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); +#endif + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 +#endif + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfARB (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvARB (GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWeightbvARB (GLint size, const GLbyte *weights); +GLAPI void APIENTRY glWeightsvARB (GLint size, const GLshort *weights); +GLAPI void APIENTRY glWeightivARB (GLint size, const GLint *weights); +GLAPI void APIENTRY glWeightfvARB (GLint size, const GLfloat *weights); +GLAPI void APIENTRY glWeightdvARB (GLint size, const GLdouble *weights); +GLAPI void APIENTRY glWeightubvARB (GLint size, const GLubyte *weights); +GLAPI void APIENTRY glWeightusvARB (GLint size, const GLushort *weights); +GLAPI void APIENTRY glWeightuivARB (GLint size, const GLuint *weights); +GLAPI void APIENTRY glWeightPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexBlendARB (GLint count); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); +typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); +typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); +typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); +typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); +typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); +typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); +typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); +#endif + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint index); +GLAPI void APIENTRY glMatrixIndexubvARB (GLint size, const GLubyte *indices); +GLAPI void APIENTRY glMatrixIndexusvARB (GLint size, const GLushort *indices); +GLAPI void APIENTRY glMatrixIndexuivARB (GLint size, const GLuint *indices); +GLAPI void APIENTRY glMatrixIndexPointerARB (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); +typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 +#endif + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 +#endif + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 +#endif + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 +#endif + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 +#endif + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 +#endif + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 +#endif + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dARB (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fARB (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iARB (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos2sARB (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svARB (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dARB (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fARB (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iARB (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivARB (const GLint *v); +GLAPI void APIENTRY glWindowPos3sARB (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svARB (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); +#endif + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttrib1dARB (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fARB (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sARB (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dARB (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fARB (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sARB (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sARB (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttrib4dARB (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fARB (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttrib4sARB (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svARB (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribPointerARB (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint index); +GLAPI void APIENTRY glProgramStringARB (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glBindProgramARB (GLenum target, GLuint program); +GLAPI void APIENTRY glDeleteProgramsARB (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glGenProgramsARB (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetProgramivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringARB (GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivARB (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramARB (GLuint program); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); +#endif + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 +/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ +#endif + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindBufferARB (GLenum target, GLuint buffer); +GLAPI void APIENTRY glDeleteBuffersARB (GLsizei n, const GLuint *buffers); +GLAPI void APIENTRY glGenBuffersARB (GLsizei n, GLuint *buffers); +GLAPI GLboolean APIENTRY glIsBufferARB (GLuint buffer); +GLAPI void APIENTRY glBufferDataARB (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +GLAPI void APIENTRY glGetBufferSubDataARB (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum target, GLenum access); +GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum target); +GLAPI void APIENTRY glGetBufferParameterivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetBufferPointervARB (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); +typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); +typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); +typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenQueriesARB (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteQueriesARB (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsQueryARB (GLuint id); +GLAPI void APIENTRY glBeginQueryARB (GLenum target, GLuint id); +GLAPI void APIENTRY glEndQueryARB (GLenum target); +GLAPI void APIENTRY glGetQueryivARB (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectivARB (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint id, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB obj); +GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum pname); +GLAPI void APIENTRY glDetachObjectARB (GLhandleARB containerObj, GLhandleARB attachedObj); +GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum shaderType); +GLAPI void APIENTRY glShaderSourceARB (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +GLAPI void APIENTRY glCompileShaderARB (GLhandleARB shaderObj); +GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); +GLAPI void APIENTRY glAttachObjectARB (GLhandleARB containerObj, GLhandleARB obj); +GLAPI void APIENTRY glLinkProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB programObj); +GLAPI void APIENTRY glValidateProgramARB (GLhandleARB programObj); +GLAPI void APIENTRY glUniform1fARB (GLint location, GLfloat v0); +GLAPI void APIENTRY glUniform2fARB (GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glUniform3fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glUniform4fARB (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glUniform1iARB (GLint location, GLint v0); +GLAPI void APIENTRY glUniform2iARB (GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glUniform3iARB (GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glUniform4iARB (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glUniform1fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform2fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform3fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform4fvARB (GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glUniform1ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform2ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform3ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniform4ivARB (GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glUniformMatrix2fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix3fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glUniformMatrix4fvARB (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB obj, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB obj, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB programObj, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB programObj, GLint location, GLfloat *params); +GLAPI void APIENTRY glGetUniformivARB (GLhandleARB programObj, GLint location, GLint *params); +GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); +typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); +typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); +typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); +typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); +typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); +#endif + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB programObj, GLuint index, const GLcharARB *name); +GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB programObj, const GLcharARB *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); +typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); +#endif + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 +#endif + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 +#endif + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 +#endif + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 +#endif + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 +#endif + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersARB (GLsizei n, const GLenum *bufs); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 +#endif + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClampColorARB (GLenum target, GLenum clamp); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); +#endif + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 +#endif + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 +#endif + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 +#endif + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 +#endif + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedARB (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedARB (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbuffer (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebuffer (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatus (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmap (GLenum target); +GLAPI void APIENTRY glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +GLAPI void APIENTRY glRenderbufferStorageMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glFramebufferTextureLayer (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +#endif + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 +#endif + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriARB (GLuint program, GLenum pname, GLint value); +GLAPI void APIENTRY glFramebufferTextureARB (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceARB (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 +#endif + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribDivisorARB (GLuint index, GLuint divisor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); +#endif + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +#endif + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferARB (GLenum target, GLenum internalformat, GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 +#endif + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 +#endif + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArray (GLuint array); +GLAPI void APIENTRY glDeleteVertexArrays (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArrays (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArray (GLuint array); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYPROC) (GLuint array); +#endif + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformIndices (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); +GLAPI void APIENTRY glGetActiveUniformsiv (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformName (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +GLAPI GLuint APIENTRY glGetUniformBlockIndex (GLuint program, const GLchar *uniformBlockName); +GLAPI void APIENTRY glGetActiveUniformBlockiv (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetActiveUniformBlockName (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +GLAPI void APIENTRY glUniformBlockBinding (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar* *uniformNames, GLuint *uniformIndices); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformName); +typedef GLuint (APIENTRYP PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName); +typedef void (APIENTRYP PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); +#endif + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 +#endif + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyBufferSubData (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +#endif + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 +#endif + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 +#endif + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawElementsBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawRangeElementsBaseVertex (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +GLAPI void APIENTRY glDrawElementsInstancedBaseVertex (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +GLAPI void APIENTRY glMultiDrawElementsBaseVertex (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount, const GLint *basevertex); +#endif + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 +#endif + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertex (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXPROC) (GLenum mode); +#endif + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 +#endif + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glFenceSync (GLenum condition, GLbitfield flags); +GLAPI GLboolean APIENTRY glIsSync (GLsync sync); +GLAPI void APIENTRY glDeleteSync (GLsync sync); +GLAPI GLenum APIENTRY glClientWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glWaitSync (GLsync sync, GLbitfield flags, GLuint64 timeout); +GLAPI void APIENTRY glGetInteger64v (GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetSynciv (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLFENCESYNCPROC) (GLenum condition, GLbitfield flags); +typedef GLboolean (APIENTRYP PFNGLISSYNCPROC) (GLsync sync); +typedef void (APIENTRYP PFNGLDELETESYNCPROC) (GLsync sync); +typedef GLenum (APIENTRYP PFNGLCLIENTWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLWAITSYNCPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout); +typedef void (APIENTRYP PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETSYNCIVPROC) (GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +#endif + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage2DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +GLAPI void APIENTRY glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaski (GLuint index, GLbitfield mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +#endif + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 +#endif + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationiARB (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateiARB (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +GLAPI void APIENTRY glBlendFunciARB (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateiARB (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (APIENTRYP PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +#endif + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMinSampleShadingARB (GLclampf value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); +#endif + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 +#endif + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 +#endif + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 +#endif + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glNamedStringARB (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +GLAPI void APIENTRY glDeleteNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glCompileShaderIncludeARB (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +GLAPI GLboolean APIENTRY glIsNamedStringARB (GLint namelen, const GLchar *name); +GLAPI void APIENTRY glGetNamedStringARB (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +GLAPI void APIENTRY glGetNamedStringivARB (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar *name, GLint stringlen, const GLchar *string); +typedef void (APIENTRYP PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* *path, const GLint *length); +typedef GLboolean (APIENTRYP PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar *name, GLsizei bufSize, GLint *stringlen, GLchar *string); +typedef void (APIENTRYP PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar *name, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 +#endif + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindFragDataLocationIndexed (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataIndex (GLuint program, const GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar *name); +#endif + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 +#endif + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 +#endif + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenSamplers (GLsizei count, GLuint *samplers); +GLAPI void APIENTRY glDeleteSamplers (GLsizei count, const GLuint *samplers); +GLAPI GLboolean APIENTRY glIsSampler (GLuint sampler); +GLAPI void APIENTRY glBindSampler (GLuint unit, GLuint sampler); +GLAPI void APIENTRY glSamplerParameteri (GLuint sampler, GLenum pname, GLint param); +GLAPI void APIENTRY glSamplerParameteriv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterf (GLuint sampler, GLenum pname, GLfloat param); +GLAPI void APIENTRY glSamplerParameterfv (GLuint sampler, GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glSamplerParameterIiv (GLuint sampler, GLenum pname, const GLint *param); +GLAPI void APIENTRY glSamplerParameterIuiv (GLuint sampler, GLenum pname, const GLuint *param); +GLAPI void APIENTRY glGetSamplerParameteriv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterIiv (GLuint sampler, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSamplerParameterfv (GLuint sampler, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetSamplerParameterIuiv (GLuint sampler, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint *samplers); +typedef void (APIENTRYP PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint *samplers); +typedef GLboolean (APIENTRYP PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (APIENTRYP PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint *param); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params); +#endif + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 +#endif + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 +#endif + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glQueryCounter (GLuint id, GLenum target); +GLAPI void APIENTRY glGetQueryObjecti64v (GLuint id, GLenum pname, GLint64 *params); +GLAPI void APIENTRY glGetQueryObjectui64v (GLuint id, GLenum pname, GLuint64 *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64 *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64 *params); +#endif + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexP2ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP2uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP3ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP3uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glVertexP4ui (GLenum type, GLuint value); +GLAPI void APIENTRY glVertexP4uiv (GLenum type, const GLuint *value); +GLAPI void APIENTRY glTexCoordP1ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP1uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP2ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP2uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glTexCoordP4ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glTexCoordP4uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP1ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP1uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP2ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP2uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP3ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP3uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glMultiTexCoordP4ui (GLenum texture, GLenum type, GLuint coords); +GLAPI void APIENTRY glMultiTexCoordP4uiv (GLenum texture, GLenum type, const GLuint *coords); +GLAPI void APIENTRY glNormalP3ui (GLenum type, GLuint coords); +GLAPI void APIENTRY glNormalP3uiv (GLenum type, const GLuint *coords); +GLAPI void APIENTRY glColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glColorP4ui (GLenum type, GLuint color); +GLAPI void APIENTRY glColorP4uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glSecondaryColorP3ui (GLenum type, GLuint color); +GLAPI void APIENTRY glSecondaryColorP3uiv (GLenum type, const GLuint *color); +GLAPI void APIENTRY glVertexAttribP1ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP1uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP2ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP2uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP3ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP3uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +GLAPI void APIENTRY glVertexAttribP4ui (GLuint index, GLenum type, GLboolean normalized, GLuint value); +GLAPI void APIENTRY glVertexAttribP4uiv (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint *value); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (APIENTRYP PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint *coords); +typedef void (APIENTRYP PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (APIENTRYP PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint *color); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (APIENTRYP PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint *value); +#endif + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysIndirect (GLenum mode, const GLvoid *indirect); +GLAPI void APIENTRY glDrawElementsIndirect (GLenum mode, GLenum type, const GLvoid *indirect); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect); +#endif + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 +#endif + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1d (GLint location, GLdouble x); +GLAPI void APIENTRY glUniform2d (GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glUniform3d (GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glUniform4d (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glUniform1dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform2dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform3dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniform4dv (GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix2x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix3x4dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x2dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glUniformMatrix4x3dv (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glGetUniformdv (GLuint program, GLint location, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetSubroutineUniformLocation (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI GLuint APIENTRY glGetSubroutineIndex (GLuint program, GLenum shadertype, const GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineUniformiv (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +GLAPI void APIENTRY glGetActiveSubroutineUniformName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glGetActiveSubroutineName (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +GLAPI void APIENTRY glUniformSubroutinesuiv (GLenum shadertype, GLsizei count, const GLuint *indices); +GLAPI void APIENTRY glGetUniformSubroutineuiv (GLenum shadertype, GLint location, GLuint *params); +GLAPI void APIENTRY glGetProgramStageiv (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef GLuint (APIENTRYP PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint *values); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei *length, GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint *indices); +typedef void (APIENTRYP PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint *values); +#endif + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPatchParameteri (GLenum pname, GLint value); +GLAPI void APIENTRY glPatchParameterfv (GLenum pname, const GLfloat *values); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); +typedef void (APIENTRYP PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat *values); +#endif + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 +#endif + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedback (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacks (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacks (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedback (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedback (void); +GLAPI void APIENTRY glResumeTransformFeedback (void); +GLAPI void APIENTRY glDrawTransformFeedback (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawTransformFeedbackStream (GLenum mode, GLuint id, GLuint stream); +GLAPI void APIENTRY glBeginQueryIndexed (GLenum target, GLuint index, GLuint id); +GLAPI void APIENTRY glEndQueryIndexed (GLenum target, GLuint index); +GLAPI void APIENTRY glGetQueryIndexediv (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (APIENTRYP PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (APIENTRYP PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReleaseShaderCompiler (void); +GLAPI void APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +GLAPI void APIENTRY glDepthRangef (GLclampf n, GLclampf f); +GLAPI void APIENTRY glClearDepthf (GLclampf d); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision); +typedef void (APIENTRYP PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (APIENTRYP PFNGLCLEARDEPTHFPROC) (GLclampf d); +#endif + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetProgramBinary (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +GLAPI void APIENTRY glProgramBinary (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +GLAPI void APIENTRY glProgramParameteri (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary); +typedef void (APIENTRYP PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseProgramStages (GLuint pipeline, GLbitfield stages, GLuint program); +GLAPI void APIENTRY glActiveShaderProgram (GLuint pipeline, GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramv (GLenum type, GLsizei count, const GLchar* *strings); +GLAPI void APIENTRY glBindProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glDeleteProgramPipelines (GLsizei n, const GLuint *pipelines); +GLAPI void APIENTRY glGenProgramPipelines (GLsizei n, GLuint *pipelines); +GLAPI GLboolean APIENTRY glIsProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineiv (GLuint pipeline, GLenum pname, GLint *params); +GLAPI void APIENTRY glProgramUniform1i (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform1iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform1f (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform1fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1d (GLuint program, GLint location, GLdouble v0); +GLAPI void APIENTRY glProgramUniform1dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform1ui (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform1uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2i (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform2iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2f (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform2fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2d (GLuint program, GLint location, GLdouble v0, GLdouble v1); +GLAPI void APIENTRY glProgramUniform2dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2ui (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform2uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform3iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform3fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +GLAPI void APIENTRY glProgramUniform3dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform3uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4i (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform4iv (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4f (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform4fv (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4d (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +GLAPI void APIENTRY glProgramUniform4dv (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4ui (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform4uiv (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dv (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glValidateProgramPipeline (GLuint pipeline); +GLAPI void APIENTRY glGetProgramPipelineInfoLog (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (APIENTRYP PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar* *strings); +typedef void (APIENTRYP PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint *pipelines); +typedef void (APIENTRYP PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint *pipelines); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble v0, GLdouble v1, GLdouble v2, GLdouble v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (APIENTRYP PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog); +#endif + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1d (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2d (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3d (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4d (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dv (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointer (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdv (GLuint index, GLenum pname, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble *params); +#endif + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glViewportArrayv (GLuint first, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glViewportIndexedf (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +GLAPI void APIENTRY glViewportIndexedfv (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glScissorArrayv (GLuint first, GLsizei count, const GLint *v); +GLAPI void APIENTRY glScissorIndexed (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +GLAPI void APIENTRY glScissorIndexedv (GLuint index, const GLint *v); +GLAPI void APIENTRY glDepthRangeArrayv (GLuint first, GLsizei count, const GLclampd *v); +GLAPI void APIENTRY glDepthRangeIndexed (GLuint index, GLclampd n, GLclampd f); +GLAPI void APIENTRY glGetFloati_v (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoublei_v (GLenum target, GLuint index, GLdouble *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (APIENTRYP PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint *v); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd *v); +typedef void (APIENTRYP PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (APIENTRYP PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble *data); +#endif + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLsync APIENTRY glCreateSyncFromCLeventARB (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLsync (APIENTRYP PFNGLCREATESYNCFROMCLEVENTARBPROC) (struct _cl_context * context, struct _cl_event * event, GLbitfield flags); +#endif + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageControlARB (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertARB (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackARB (GLDEBUGPROCARB callback, const GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogARB (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); +#endif + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glGetGraphicsResetStatusARB (void); +GLAPI void APIENTRY glGetnMapdvARB (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +GLAPI void APIENTRY glGetnMapfvARB (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +GLAPI void APIENTRY glGetnMapivARB (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +GLAPI void APIENTRY glGetnPixelMapfvARB (GLenum map, GLsizei bufSize, GLfloat *values); +GLAPI void APIENTRY glGetnPixelMapuivARB (GLenum map, GLsizei bufSize, GLuint *values); +GLAPI void APIENTRY glGetnPixelMapusvARB (GLenum map, GLsizei bufSize, GLushort *values); +GLAPI void APIENTRY glGetnPolygonStippleARB (GLsizei bufSize, GLubyte *pattern); +GLAPI void APIENTRY glGetnColorTableARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +GLAPI void APIENTRY glGetnConvolutionFilterARB (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +GLAPI void APIENTRY glGetnSeparableFilterARB (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glGetnHistogramARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnMinmaxARB (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +GLAPI void APIENTRY glGetnTexImageARB (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +GLAPI void APIENTRY glGetnCompressedTexImageARB (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +GLAPI void APIENTRY glGetnUniformfvARB (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +GLAPI void APIENTRY glGetnUniformivARB (GLuint program, GLint location, GLsizei bufSize, GLint *params); +GLAPI void APIENTRY glGetnUniformuivARB (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +GLAPI void APIENTRY glGetnUniformdvARB (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void); +typedef void (APIENTRYP PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble *v); +typedef void (APIENTRYP PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat *v); +typedef void (APIENTRYP PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint *v); +typedef void (APIENTRYP PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint *values); +typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort *values); +typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte *pattern); +typedef void (APIENTRYP PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *table); +typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid *image); +typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid *row, GLsizei columnBufSize, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid *values); +typedef void (APIENTRYP PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data); +typedef void (APIENTRYP PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, GLvoid *img); +typedef void (APIENTRYP PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint *params); +typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble *params); +#endif + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 +#endif + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 +#endif + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendColorEXT (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +#endif + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat factor, GLfloat bias); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); +#endif + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 +#endif + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum target, GLenum filter, GLfloat *weights); +GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); +typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); +#endif + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetHistogramEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMinmaxEXT (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glHistogramEXT (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glMinmaxEXT (GLenum target, GLenum internalformat, GLboolean sink); +GLAPI void APIENTRY glResetHistogramEXT (GLenum target); +GLAPI void APIENTRY glResetMinmaxEXT (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); +#endif + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum target, GLenum pname, GLfloat params); +GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum target, GLenum pname, GLint params); +GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *image); +GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); +typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); +#endif + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 +#endif + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableSGI (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glColorTableParameterivSGI (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glCopyColorTableSGI (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glGetColorTableSGI (GLenum target, GLenum format, GLenum type, GLvoid *table); +GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum target, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); +#endif + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenSGIX (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); +#endif + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum pname, GLint *params); +GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); +#endif + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 +#endif + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 +#endif + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void APIENTRY glBindTextureEXT (GLenum target, GLuint texture); +GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei n, const GLuint *textures); +GLAPI void APIENTRY glGenTexturesEXT (GLsizei n, GLuint *textures); +GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint texture); +GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); +typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); +typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); +#endif + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum target, GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum target, GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum target, GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); +#endif + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 +#endif + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 +#endif + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskSGIS (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternSGIS (GLenum pattern); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); +#endif + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 +#endif + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glArrayElementEXT (GLint i); +GLAPI void APIENTRY glColorPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glDrawArraysEXT (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei stride, GLsizei count, const GLboolean *pointer); +GLAPI void APIENTRY glGetPointervEXT (GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glIndexPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glNormalPointerEXT (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glTexCoordPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +GLAPI void APIENTRY glVertexPointerEXT (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); +typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 +#endif + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 +#endif + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 +#endif + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 +#endif + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 +#endif + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 +#endif + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 +#endif + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 +#endif + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 +#endif + +#ifndef GL_SGIX_pixel_tiles +#define GL_SGIX_pixel_tiles 1 +#endif + +#ifndef GL_SGIX_texture_select +#define GL_SGIX_texture_select 1 +#endif + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 +#endif + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfEXT (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvEXT (GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIS_point_parameters +#define GL_SGIS_point_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameterfSGIS (GLenum pname, GLfloat param); +GLAPI void APIENTRY glPointParameterfvSGIS (GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_SGIX_instruments +#define GL_SGIX_instruments 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); +GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei size, GLint *buffer); +GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *marker_p); +GLAPI void APIENTRY glReadInstrumentsSGIX (GLint marker); +GLAPI void APIENTRY glStartInstrumentsSGIX (void); +GLAPI void APIENTRY glStopInstrumentsSGIX (GLint marker); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); +typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); +typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); +typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); +typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); +#endif + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 +#endif + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameZoomSGIX (GLint factor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); +#endif + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTagSampleBufferSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_polynomial_ffd +#define GL_SGIX_polynomial_ffd 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +GLAPI void APIENTRY glDeformSGIX (GLbitfield mask); +GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); +typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); +typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); +#endif + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *equation); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); +#endif + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushRasterSGIX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); +#endif + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 +#endif + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogFuncSGIS (GLsizei n, const GLfloat *points); +GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); +typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); +#endif + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 +#endif + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glImageTransformParameteriHP (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glImageTransformParameterfHP (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glImageTransformParameterivHP (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum target, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 +#endif + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 +#endif + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorSubTableEXT (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +#endif + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 +#endif + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glHintPGI (GLenum target, GLint mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); +#endif + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorTableEXT (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +GLAPI void APIENTRY glGetColorTableEXT (GLenum target, GLenum format, GLenum type, GLvoid *data); +GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum target, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 +#endif + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint list, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetListParameterivSGIX (GLuint list, GLenum pname, GLint *params); +GLAPI void APIENTRY glListParameterfSGIX (GLuint list, GLenum pname, GLfloat param); +GLAPI void APIENTRY glListParameterfvSGIX (GLuint list, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glListParameteriSGIX (GLuint list, GLenum pname, GLint param); +GLAPI void APIENTRY glListParameterivSGIX (GLuint list, GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); +#endif + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 +#endif + +#ifndef GL_SGIX_calligraphic_fragment +#define GL_SGIX_calligraphic_fragment 1 +#endif + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 +#endif + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 +#endif + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 +#endif + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexMaterialEXT (GLenum face, GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIndexFuncEXT (GLenum func, GLclampf ref); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); +#endif + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 +#endif + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glLockArraysEXT (GLint first, GLsizei count); +GLAPI void APIENTRY glUnlockArraysEXT (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); +#endif + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCullParameterdvEXT (GLenum pname, GLdouble *params); +GLAPI void APIENTRY glCullParameterfvEXT (GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); +#endif + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 +#endif + +#ifndef GL_SGIX_fragment_lighting +#define GL_SGIX_fragment_lighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum face, GLenum mode); +GLAPI void APIENTRY glFragmentLightfSGIX (GLenum light, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightiSGIX (GLenum light, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightivSGIX (GLenum light, GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum pname, const GLint *params); +GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum face, GLenum pname, GLfloat param); +GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum face, GLenum pname, GLint param); +GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum face, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum light, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum light, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum face, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum face, GLenum pname, GLint *params); +GLAPI void APIENTRY glLightEnviSGIX (GLenum pname, GLint param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 +#endif + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 +#endif + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +#endif + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 +#endif + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 +#endif + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glApplyTextureEXT (GLenum mode); +GLAPI void APIENTRY glTextureLightEXT (GLenum pname); +GLAPI void APIENTRY glTextureMaterialEXT (GLenum face, GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); +#endif + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 +#endif + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 +#endif + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint marker); +GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *markerp); +GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *markerp); +GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei range); +GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint marker, GLsizei range); +GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint marker); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); +typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); +typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +#endif + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 +#endif + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 +#endif + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glNormalPointervINTEL (GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glColorPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +GLAPI void APIENTRY glTexCoordPointervINTEL (GLint size, GLenum type, const GLvoid* *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); +#endif + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 +#endif + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum target, GLenum pname, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); +#endif + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 +#endif + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 +#endif + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 +#endif + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glSecondaryColor3iEXT (GLint red, GLint green, GLint blue); +GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *v); +GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue); +GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v); +GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v); +GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue); +GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v); +GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue); +GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v); +GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureNormalEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFogCoordfEXT (GLfloat coord); +GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *coord); +GLAPI void APIENTRY glFogCoorddEXT (GLdouble coord); +GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *coord); +GLAPI void APIENTRY glFogCoordPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); +typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 +#endif + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTangent3bEXT (GLbyte tx, GLbyte ty, GLbyte tz); +GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glTangent3dEXT (GLdouble tx, GLdouble ty, GLdouble tz); +GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glTangent3fEXT (GLfloat tx, GLfloat ty, GLfloat tz); +GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glTangent3iEXT (GLint tx, GLint ty, GLint tz); +GLAPI void APIENTRY glTangent3ivEXT (const GLint *v); +GLAPI void APIENTRY glTangent3sEXT (GLshort tx, GLshort ty, GLshort tz); +GLAPI void APIENTRY glTangent3svEXT (const GLshort *v); +GLAPI void APIENTRY glBinormal3bEXT (GLbyte bx, GLbyte by, GLbyte bz); +GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *v); +GLAPI void APIENTRY glBinormal3dEXT (GLdouble bx, GLdouble by, GLdouble bz); +GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *v); +GLAPI void APIENTRY glBinormal3fEXT (GLfloat bx, GLfloat by, GLfloat bz); +GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *v); +GLAPI void APIENTRY glBinormal3iEXT (GLint bx, GLint by, GLint bz); +GLAPI void APIENTRY glBinormal3ivEXT (const GLint *v); +GLAPI void APIENTRY glBinormal3sEXT (GLshort bx, GLshort by, GLshort bz); +GLAPI void APIENTRY glBinormal3svEXT (const GLshort *v); +GLAPI void APIENTRY glTangentPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glBinormalPointerEXT (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); +typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); +typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); +typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); +typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); +typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); +typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); +typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); +typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); +typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); +typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); +typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 +#endif + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 +#endif + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 +#endif + +#ifndef GL_SGIX_fog_scale +#define GL_SGIX_fog_scale 1 +#endif + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFinishTextureSUNX (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); +#endif + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort factor); +GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint factor); +GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat factor); +GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble factor); +GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte factor); +GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort factor); +GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint factor); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); +typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +#endif + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint code); +GLAPI void APIENTRY glReplacementCodeusSUN (GLushort code); +GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte code); +GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *code); +GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *code); +GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *code); +GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); +#endif + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *rc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *rc, const GLubyte *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +#endif + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_blend_func_separate +#define GL_INGR_blend_func_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +#endif + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 +#endif + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 +#endif + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 +#endif + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 +#endif + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 +#endif + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 +#endif + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 +#endif + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 +#endif + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 +#endif + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexWeightfEXT (GLfloat weight); +GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *weight); +GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); +#endif + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 +#endif + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); +GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei length, const GLvoid *pointer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); +#endif + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerParameterfvNV (GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glCombinerParameterfNV (GLenum pname, GLfloat param); +GLAPI void APIENTRY glCombinerParameterivNV (GLenum pname, const GLint *params); +GLAPI void APIENTRY glCombinerParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glCombinerInputNV (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glCombinerOutputNV (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +GLAPI void APIENTRY glFinalCombinerInputNV (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum stage, GLenum portion, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum variable, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum variable, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); +#endif + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 +#endif + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 +#endif + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 +#endif + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 +#endif + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glResizeBuffersMESA (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); +#endif + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glWindowPos2dMESA (GLdouble x, GLdouble y); +GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos2fMESA (GLfloat x, GLfloat y); +GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos2iMESA (GLint x, GLint y); +GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos2sMESA (GLshort x, GLshort y); +GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos3dMESA (GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos3fMESA (GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos3iMESA (GLint x, GLint y, GLint z); +GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos3sMESA (GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *v); +GLAPI void APIENTRY glWindowPos4dMESA (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *v); +GLAPI void APIENTRY glWindowPos4fMESA (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *v); +GLAPI void APIENTRY glWindowPos4iMESA (GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *v); +GLAPI void APIENTRY glWindowPos4sMESA (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); +typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); +#endif + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 +#endif + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); +#endif + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint stride, const GLboolean* *pointer, GLint ptrstride); +GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glIndexPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glNormalPointerListIBM (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glTexCoordPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +GLAPI void APIENTRY glVertexPointerListIBM (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); +#endif + +#ifndef GL_SGIX_subsample +#define GL_SGIX_subsample 1 +#endif + +#ifndef GL_SGIX_ycrcba +#define GL_SGIX_ycrcba 1 +#endif + +#ifndef GL_SGIX_ycrcb_subsample +#define GL_SGIX_ycrcb_subsample 1 +#endif + +#ifndef GL_SGIX_depth_pass_instrument +#define GL_SGIX_depth_pass_instrument 1 +#endif + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 +#endif + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 +#endif + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTbufferMask3DFX (GLuint mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); +#endif + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glSampleMaskEXT (GLclampf value, GLboolean invert); +GLAPI void APIENTRY glSamplePatternEXT (GLenum pattern); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); +#endif + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 +#endif + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 +#endif + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 +#endif + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 +#endif + +#ifndef GL_SGIS_texture_color_mask +#define GL_SGIS_texture_color_mask 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +#endif + +#ifndef GL_SGIX_igloo_interface +#define GL_SGIX_igloo_interface 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum pname, const GLvoid *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); +#endif + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 +#endif + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 +#endif + +#ifndef GL_NV_fence +#define GL_NV_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glGenFencesNV (GLsizei n, GLuint *fences); +GLAPI GLboolean APIENTRY glIsFenceNV (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceNV (GLuint fence); +GLAPI void APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params); +GLAPI void APIENTRY glFinishFenceNV (GLuint fence); +GLAPI void APIENTRY glSetFenceNV (GLuint fence, GLenum condition); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); +typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +#endif + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +GLAPI void APIENTRY glMapParameterivNV (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMapParameterfvNV (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetMapControlPointsNV (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +GLAPI void APIENTRY glGetMapParameterivNV (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapParameterfvNV (GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum target, GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glEvalMapsNV (GLenum target, GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); +typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +#endif + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 +#endif + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum stage, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname, GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); +#endif + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 +#endif + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 +#endif + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 +#endif + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 +#endif + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 +#endif + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei n, const GLuint *programs, GLboolean *residences); +GLAPI void APIENTRY glBindProgramNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glExecuteProgramNV (GLenum target, GLuint id, const GLfloat *params); +GLAPI void APIENTRY glGenProgramsNV (GLsizei n, GLuint *programs); +GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum target, GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum target, GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetProgramivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetProgramStringNV (GLuint id, GLenum pname, GLubyte *program); +GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum target, GLuint address, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribivNV (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint index, GLenum pname, GLvoid* *pointer); +GLAPI GLboolean APIENTRY glIsProgramNV (GLuint id); +GLAPI void APIENTRY glLoadProgramNV (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +GLAPI void APIENTRY glProgramParameter4dNV (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramParameter4dvNV (GLenum target, GLuint index, const GLdouble *v); +GLAPI void APIENTRY glProgramParameter4fNV (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramParameter4fvNV (GLenum target, GLuint index, const GLfloat *v); +GLAPI void APIENTRY glProgramParameters4dvNV (GLenum target, GLuint index, GLuint count, const GLdouble *v); +GLAPI void APIENTRY glProgramParameters4fvNV (GLenum target, GLuint index, GLuint count, const GLfloat *v); +GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei n, const GLuint *programs); +GLAPI void APIENTRY glTrackMatrixNV (GLenum target, GLuint address, GLenum matrix, GLenum transform); +GLAPI void APIENTRY glVertexAttribPointerNV (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glVertexAttrib1dNV (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib1fNV (GLuint index, GLfloat x); +GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib1sNV (GLuint index, GLshort x); +GLAPI void APIENTRY glVertexAttrib1svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib2dNV (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib2fNV (GLuint index, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib2sNV (GLuint index, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexAttrib2svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib3dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib3fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib3sNV (GLuint index, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexAttrib3svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4dNV (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttrib4fNV (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint index, const GLfloat *v); +GLAPI void APIENTRY glVertexAttrib4sNV (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexAttrib4svNV (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs1svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs2svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs3svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint index, GLsizei count, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint index, GLsizei count, const GLfloat *v); +GLAPI void APIENTRY glVertexAttribs4svNV (GLuint index, GLsizei count, const GLshort *v); +GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint index, GLsizei count, const GLubyte *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); +typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); +typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); +typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); +typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); +typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); +typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); +#endif + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 +#endif + +#ifndef GL_SGIX_scalebias_hint +#define GL_SGIX_scalebias_hint 1 +#endif + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 +#endif + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 +#endif + +#ifndef GL_OML_resample +#define GL_OML_resample 1 +#endif + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 +#endif + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBumpParameterivATI (GLenum pname, const GLint *param); +GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum pname, const GLfloat *param); +GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum pname, GLint *param); +GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum pname, GLfloat *param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); +typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +#endif + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint range); +GLAPI void APIENTRY glBindFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint id); +GLAPI void APIENTRY glBeginFragmentShaderATI (void); +GLAPI void APIENTRY glEndFragmentShaderATI (void); +GLAPI void APIENTRY glPassTexCoordATI (GLuint dst, GLuint coord, GLenum swizzle); +GLAPI void APIENTRY glSampleMapATI (GLuint dst, GLuint interp, GLenum swizzle); +GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint dst, const GLfloat *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); +#endif + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPNTrianglesiATI (GLenum pname, GLint param); +GLAPI void APIENTRY glPNTrianglesfATI (GLenum pname, GLfloat param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei size, const GLvoid *pointer, GLenum usage); +GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint buffer, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetObjectBufferivATI (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glFreeObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glArrayObjectATI (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum array, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetArrayObjectivATI (GLenum array, GLenum pname, GLint *params); +GLAPI void APIENTRY glVariantArrayObjectATI (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint id, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint id, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); +typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); +#endif + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVertexShaderEXT (void); +GLAPI void APIENTRY glEndVertexShaderEXT (void); +GLAPI void APIENTRY glBindVertexShaderEXT (GLuint id); +GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint range); +GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint id); +GLAPI void APIENTRY glShaderOp1EXT (GLenum op, GLuint res, GLuint arg1); +GLAPI void APIENTRY glShaderOp2EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +GLAPI void APIENTRY glShaderOp3EXT (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +GLAPI void APIENTRY glSwizzleEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glWriteMaskEXT (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +GLAPI void APIENTRY glInsertComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI void APIENTRY glExtractComponentEXT (GLuint res, GLuint src, GLuint num); +GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +GLAPI void APIENTRY glSetInvariantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glSetLocalConstantEXT (GLuint id, GLenum type, const GLvoid *addr); +GLAPI void APIENTRY glVariantbvEXT (GLuint id, const GLbyte *addr); +GLAPI void APIENTRY glVariantsvEXT (GLuint id, const GLshort *addr); +GLAPI void APIENTRY glVariantivEXT (GLuint id, const GLint *addr); +GLAPI void APIENTRY glVariantfvEXT (GLuint id, const GLfloat *addr); +GLAPI void APIENTRY glVariantdvEXT (GLuint id, const GLdouble *addr); +GLAPI void APIENTRY glVariantubvEXT (GLuint id, const GLubyte *addr); +GLAPI void APIENTRY glVariantusvEXT (GLuint id, const GLushort *addr); +GLAPI void APIENTRY glVariantuivEXT (GLuint id, const GLuint *addr); +GLAPI void APIENTRY glVariantPointerEXT (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint id); +GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint id); +GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum light, GLenum value); +GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum face, GLenum value); +GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum unit, GLenum coord, GLenum value); +GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum unit, GLenum value); +GLAPI GLuint APIENTRY glBindParameterEXT (GLenum value); +GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint id, GLenum cap); +GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetVariantPointervEXT (GLuint id, GLenum value, GLvoid* *data); +GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint id, GLenum value, GLboolean *data); +GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint id, GLenum value, GLint *data); +GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint id, GLenum value, GLfloat *data); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); +typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); +typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); +typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); +typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); +typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); +typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); +typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); +typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); +typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); +typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); +typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); +typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +#endif + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexStream1sATI (GLenum stream, GLshort x); +GLAPI void APIENTRY glVertexStream1svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream1iATI (GLenum stream, GLint x); +GLAPI void APIENTRY glVertexStream1ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream1fATI (GLenum stream, GLfloat x); +GLAPI void APIENTRY glVertexStream1fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream1dATI (GLenum stream, GLdouble x); +GLAPI void APIENTRY glVertexStream1dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream2sATI (GLenum stream, GLshort x, GLshort y); +GLAPI void APIENTRY glVertexStream2svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream2iATI (GLenum stream, GLint x, GLint y); +GLAPI void APIENTRY glVertexStream2ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream2fATI (GLenum stream, GLfloat x, GLfloat y); +GLAPI void APIENTRY glVertexStream2fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream2dATI (GLenum stream, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexStream2dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream3sATI (GLenum stream, GLshort x, GLshort y, GLshort z); +GLAPI void APIENTRY glVertexStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream3iATI (GLenum stream, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream3fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glVertexStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream3dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glVertexStream4sATI (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void APIENTRY glVertexStream4svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glVertexStream4iATI (GLenum stream, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexStream4ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glVertexStream4fATI (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glVertexStream4fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glVertexStream4dATI (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexStream4dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glNormalStream3bATI (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void APIENTRY glNormalStream3bvATI (GLenum stream, const GLbyte *coords); +GLAPI void APIENTRY glNormalStream3sATI (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +GLAPI void APIENTRY glNormalStream3svATI (GLenum stream, const GLshort *coords); +GLAPI void APIENTRY glNormalStream3iATI (GLenum stream, GLint nx, GLint ny, GLint nz); +GLAPI void APIENTRY glNormalStream3ivATI (GLenum stream, const GLint *coords); +GLAPI void APIENTRY glNormalStream3fATI (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void APIENTRY glNormalStream3fvATI (GLenum stream, const GLfloat *coords); +GLAPI void APIENTRY glNormalStream3dATI (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void APIENTRY glNormalStream3dvATI (GLenum stream, const GLdouble *coords); +GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum stream); +GLAPI void APIENTRY glVertexBlendEnviATI (GLenum pname, GLint param); +GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum pname, GLfloat param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); +typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); +typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +#endif + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerATI (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayATI (GLenum mode, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +#endif + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); +#endif + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 +#endif + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 +#endif + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 +#endif + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei n, GLuint *ids); +GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei n, const GLuint *ids); +GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint id); +GLAPI void APIENTRY glEndOcclusionQueryNV (void); +GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint id, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint id, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); +typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); +#endif + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPointParameteriNV (GLenum pname, GLint param); +GLAPI void APIENTRY glPointParameterivNV (GLenum pname, const GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); +#endif + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 +#endif + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 +#endif + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 +#endif + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); +#endif + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 +#endif + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 +#endif + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glElementPointerAPPLE (GLenum type, const GLvoid *pointer); +GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum mode, GLint first, GLsizei count); +GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); +typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); +#endif + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenFencesAPPLE (GLsizei n, GLuint *fences); +GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei n, const GLuint *fences); +GLAPI void APIENTRY glSetFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint fence); +GLAPI void APIENTRY glFinishFenceAPPLE (GLuint fence); +GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum object, GLuint name); +GLAPI void APIENTRY glFinishObjectAPPLE (GLenum object, GLint name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); +typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); +typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); +typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +#endif + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint array); +GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei n, const GLuint *arrays); +GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei n, GLuint *arrays); +GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint array); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); +typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, GLuint *arrays); +typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); +#endif + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum pname, GLint param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +#endif + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 +#endif + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 +#endif + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawBuffersATI (GLsizei n, const GLenum *bufs); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); +#endif + +#ifndef GL_ATI_pixel_format_float +#define GL_ATI_pixel_format_float 1 +/* This is really a WGL extension, but defines some associated GL enums. + * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. + */ +#endif + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 +#endif + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 +#endif + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 +#endif + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 +/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); +typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); +typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +#endif + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertex2hNV (GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex3hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertex4hNV (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glNormal3hNV (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glColor4hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV s); +GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum target, GLhalfNV s); +GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum target, GLhalfNV s, GLhalfNV t); +GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum target, const GLhalfNV *v); +GLAPI void APIENTRY glFogCoordhNV (GLhalfNV fog); +GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *fog); +GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *v); +GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV weight); +GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *weight); +GLAPI void APIENTRY glVertexAttrib1hNV (GLuint index, GLhalfNV x); +GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib2hNV (GLuint index, GLhalfNV x, GLhalfNV y); +GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib3hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttrib4hNV (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint index, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint index, GLsizei n, const GLhalfNV *v); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); +typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); +typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); +typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); +typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); +typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); +typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); +typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); +typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); +typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); +typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); +typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); +typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); +typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); +typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); +#endif + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPixelDataRangeNV (GLenum target, GLsizei length, GLvoid *pointer); +GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); +typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +#endif + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPrimitiveRestartNV (void); +GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); +typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +#endif + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 +#endif + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 +#endif + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint buffer); +GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); +#endif + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilOpSeparateATI (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +#endif + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint index, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint index, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); +#endif + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 +#endif + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthBoundsEXT (GLclampd zmin, GLclampd zmax); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); +#endif + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 +#endif + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum modeRGB, GLenum modeAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 +#endif + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 +#endif + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 +#endif + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 +#endif + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 +#endif + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 +#endif + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 +#endif + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint renderbuffer); +GLAPI void APIENTRY glBindRenderbufferEXT (GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei n, const GLuint *renderbuffers); +GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei n, GLuint *renderbuffers); +GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint framebuffer); +GLAPI void APIENTRY glBindFramebufferEXT (GLenum target, GLuint framebuffer); +GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei n, const GLuint *framebuffers); +GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei n, GLuint *framebuffers); +GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum target); +GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum target, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateMipmapEXT (GLenum target); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); +typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); +typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +#endif + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei len, const GLvoid *string); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); +#endif + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 +#endif + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glStencilClearTagEXT (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLSTENCILCLEARTAGEXTPROC) (GLsizei stencilTagBits, GLuint stencilClearTag); +#endif + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 +#endif + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +#endif + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 +#endif + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetQueryObjecti64vEXT (GLuint id, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetQueryObjectui64vEXT (GLuint id, GLenum pname, GLuint64EXT *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramEnvParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramLocalParameters4fvEXT (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat *params); +#endif + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferParameteriAPPLE (GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); +#endif + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramLocalParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramLocalParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramLocalParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramLocalParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramLocalParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramLocalParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParameterI4iNV (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glProgramEnvParameterI4ivNV (GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glProgramEnvParametersI4ivNV (GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramEnvParameterI4uiNV (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glProgramEnvParameterI4uivNV (GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glProgramEnvParametersI4uivNV (GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramLocalParameterIuivNV (GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIivNV (GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetProgramEnvParameterIuivNV (GLenum target, GLuint index, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIIVNVPROC) (GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERIUIVNVPROC) (GLenum target, GLuint index, GLuint *params); +#endif + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramVertexLimitNV (GLenum target, GLint limit); +GLAPI void APIENTRY glFramebufferTextureEXT (GLenum target, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glFramebufferTextureLayerEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glFramebufferTextureFaceEXT (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +#endif + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramParameteriEXT (GLuint program, GLenum pname, GLint value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); +#endif + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribI1iEXT (GLuint index, GLint x); +GLAPI void APIENTRY glVertexAttribI2iEXT (GLuint index, GLint x, GLint y); +GLAPI void APIENTRY glVertexAttribI3iEXT (GLuint index, GLint x, GLint y, GLint z); +GLAPI void APIENTRY glVertexAttribI4iEXT (GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glVertexAttribI1uiEXT (GLuint index, GLuint x); +GLAPI void APIENTRY glVertexAttribI2uiEXT (GLuint index, GLuint x, GLuint y); +GLAPI void APIENTRY glVertexAttribI3uiEXT (GLuint index, GLuint x, GLuint y, GLuint z); +GLAPI void APIENTRY glVertexAttribI4uiEXT (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glVertexAttribI1ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI2ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI3ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI4ivEXT (GLuint index, const GLint *v); +GLAPI void APIENTRY glVertexAttribI1uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI2uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI3uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4uivEXT (GLuint index, const GLuint *v); +GLAPI void APIENTRY glVertexAttribI4bvEXT (GLuint index, const GLbyte *v); +GLAPI void APIENTRY glVertexAttribI4svEXT (GLuint index, const GLshort *v); +GLAPI void APIENTRY glVertexAttribI4ubvEXT (GLuint index, const GLubyte *v); +GLAPI void APIENTRY glVertexAttribI4usvEXT (GLuint index, const GLushort *v); +GLAPI void APIENTRY glVertexAttribIPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribIivEXT (GLuint index, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVertexAttribIuivEXT (GLuint index, GLenum pname, GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +#endif + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetUniformuivEXT (GLuint program, GLint location, GLuint *params); +GLAPI void APIENTRY glBindFragDataLocationEXT (GLuint program, GLuint color, const GLchar *name); +GLAPI GLint APIENTRY glGetFragDataLocationEXT (GLuint program, const GLchar *name); +GLAPI void APIENTRY glUniform1uiEXT (GLint location, GLuint v0); +GLAPI void APIENTRY glUniform2uiEXT (GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glUniform3uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glUniform4uiEXT (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glUniform1uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform2uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform3uivEXT (GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glUniform4uivEXT (GLint location, GLsizei count, const GLuint *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (APIENTRYP PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +#endif + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDrawArraysInstancedEXT (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +GLAPI void APIENTRY glDrawElementsInstancedEXT (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); +#endif + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 +#endif + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 +#endif + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexBufferEXT (GLenum target, GLenum internalformat, GLuint buffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); +#endif + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 +#endif + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 +#endif + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 +#endif + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDepthRangedNV (GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glClearDepthdNV (GLdouble depth); +GLAPI void APIENTRY glDepthBoundsdNV (GLdouble zmin, GLdouble zmax); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (APIENTRYP PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +#endif + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 +#endif + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glRenderbufferStorageMultisampleCoverageNV (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +#endif + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 +#endif + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 +#endif + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramBufferParametersfvNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glProgramBufferParametersIivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glProgramBufferParametersIuivNV (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +#endif + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glColorMaskIndexedEXT (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +GLAPI void APIENTRY glGetBooleanIndexedvEXT (GLenum target, GLuint index, GLboolean *data); +GLAPI void APIENTRY glGetIntegerIndexedvEXT (GLenum target, GLuint index, GLint *data); +GLAPI void APIENTRY glEnableIndexedEXT (GLenum target, GLuint index); +GLAPI void APIENTRY glDisableIndexedEXT (GLenum target, GLuint index); +GLAPI GLboolean APIENTRY glIsEnabledIndexedEXT (GLenum target, GLuint index); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (APIENTRYP PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum target, GLuint index, GLboolean *data); +typedef void (APIENTRYP PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLint *data); +typedef void (APIENTRYP PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (APIENTRYP PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef GLboolean (APIENTRYP PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); +#endif + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackNV (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackNV (void); +GLAPI void APIENTRY glTransformFeedbackAttribsNV (GLuint count, const GLint *attribs, GLenum bufferMode); +GLAPI void APIENTRY glBindBufferRangeNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetNV (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseNV (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsNV (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +GLAPI void APIENTRY glActiveVaryingNV (GLuint program, const GLchar *name); +GLAPI GLint APIENTRY glGetVaryingLocationNV (GLuint program, const GLchar *name); +GLAPI void APIENTRY glGetActiveVaryingNV (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +GLAPI void APIENTRY glGetTransformFeedbackVaryingNV (GLuint program, GLuint index, GLint *location); +GLAPI void APIENTRY glTransformFeedbackStreamAttribsNV (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); +typedef void (APIENTRYP PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef GLint (APIENTRYP PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (APIENTRYP PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKSTREAMATTRIBSNVPROC) (GLsizei count, const GLint *attribs, GLsizei nbuffers, const GLint *bufstreams, GLenum bufferMode); +#endif + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniformBufferEXT (GLuint program, GLint location, GLuint buffer); +GLAPI GLint APIENTRY glGetUniformBufferSizeEXT (GLuint program, GLint location); +GLAPI GLintptr APIENTRY glGetUniformOffsetEXT (GLuint program, GLint location); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); +typedef GLint (APIENTRYP PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (APIENTRYP PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +#endif + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTexParameterIivEXT (GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTexParameterIuivEXT (GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTexParameterIivEXT (GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTexParameterIuivEXT (GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glClearColorIiEXT (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void APIENTRY glClearColorIuiEXT (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (APIENTRYP PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +#endif + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glFrameTerminatorGREMEDY (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLFRAMETERMINATORGREMEDYPROC) (void); +#endif + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginConditionalRenderNV (GLuint id, GLenum mode); +GLAPI void APIENTRY glEndConditionalRenderNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void); +#endif + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glPresentFrameKeyedNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +GLAPI void APIENTRY glPresentFrameDualFillNV (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +GLAPI void APIENTRY glGetVideoivNV (GLuint video_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideouivNV (GLuint video_slot, GLenum pname, GLuint *params); +GLAPI void APIENTRY glGetVideoi64vNV (GLuint video_slot, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVideoui64vNV (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); +typedef void (APIENTRYP PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (APIENTRYP PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT *params); +#endif + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginTransformFeedbackEXT (GLenum primitiveMode); +GLAPI void APIENTRY glEndTransformFeedbackEXT (void); +GLAPI void APIENTRY glBindBufferRangeEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +GLAPI void APIENTRY glBindBufferOffsetEXT (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +GLAPI void APIENTRY glBindBufferBaseEXT (GLenum target, GLuint index, GLuint buffer); +GLAPI void APIENTRY glTransformFeedbackVaryingsEXT (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +GLAPI void APIENTRY glGetTransformFeedbackVaryingEXT (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (APIENTRYP PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (APIENTRYP PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (APIENTRYP PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar* *varyings, GLenum bufferMode); +typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +#endif + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glPushClientAttribDefaultEXT (GLbitfield mask); +GLAPI void APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixLoadIdentityEXT (GLenum mode); +GLAPI void APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +GLAPI void APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void APIENTRY glMatrixPopEXT (GLenum mode); +GLAPI void APIENTRY glMatrixPushEXT (GLenum mode); +GLAPI void APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m); +GLAPI void APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m); +GLAPI void APIENTRY glTextureParameterfEXT (GLuint texture, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glTextureParameteriEXT (GLuint texture, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetTextureImageEXT (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetTextureParameterfvEXT (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureParameterivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureLevelParameterfvEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetTextureLevelParameterivEXT (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glMultiTexParameterfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexParameteriEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void APIENTRY glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void APIENTRY glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void APIENTRY glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void APIENTRY glGetMultiTexParameterfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexParameterivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterfvEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexLevelParameterivEXT (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void APIENTRY glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void APIENTRY glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void APIENTRY glBindMultiTextureEXT (GLenum texunit, GLenum target, GLuint texture); +GLAPI void APIENTRY glEnableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glDisableClientStateIndexedEXT (GLenum array, GLuint index); +GLAPI void APIENTRY glMultiTexCoordPointerEXT (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glMultiTexEnvfEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexEnviEXT (GLenum texunit, GLenum target, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexGendEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +GLAPI void APIENTRY glMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void APIENTRY glMultiTexGenfEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +GLAPI void APIENTRY glMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glMultiTexGeniEXT (GLenum texunit, GLenum coord, GLenum pname, GLint param); +GLAPI void APIENTRY glMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +GLAPI void APIENTRY glGetMultiTexEnvfvEXT (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexEnvivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexGendvEXT (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glGetMultiTexGenfvEXT (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetMultiTexGenivEXT (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetFloatIndexedvEXT (GLenum target, GLuint index, GLfloat *data); +GLAPI void APIENTRY glGetDoubleIndexedvEXT (GLenum target, GLuint index, GLdouble *data); +GLAPI void APIENTRY glGetPointerIndexedvEXT (GLenum target, GLuint index, GLvoid* *data); +GLAPI void APIENTRY glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedTextureImageEXT (GLuint texture, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +GLAPI void APIENTRY glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +GLAPI void APIENTRY glNamedProgramStringEXT (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameter4dEXT (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glNamedProgramLocalParameter4dvEXT (GLuint program, GLenum target, GLuint index, const GLdouble *params); +GLAPI void APIENTRY glNamedProgramLocalParameter4fEXT (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void APIENTRY glNamedProgramLocalParameter4fvEXT (GLuint program, GLenum target, GLuint index, const GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterdvEXT (GLuint program, GLenum target, GLuint index, GLdouble *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterfvEXT (GLuint program, GLenum target, GLuint index, GLfloat *params); +GLAPI void APIENTRY glGetNamedProgramivEXT (GLuint program, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedProgramStringEXT (GLuint program, GLenum target, GLenum pname, GLvoid *string); +GLAPI void APIENTRY glNamedProgramLocalParameters4fvEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4iEXT (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4ivEXT (GLuint program, GLenum target, GLuint index, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4ivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uiEXT (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +GLAPI void APIENTRY glNamedProgramLocalParameterI4uivEXT (GLuint program, GLenum target, GLuint index, const GLuint *params); +GLAPI void APIENTRY glNamedProgramLocalParametersI4uivEXT (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIivEXT (GLuint program, GLenum target, GLuint index, GLint *params); +GLAPI void APIENTRY glGetNamedProgramLocalParameterIuivEXT (GLuint program, GLenum target, GLuint index, GLuint *params); +GLAPI void APIENTRY glTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetTextureParameterIivEXT (GLuint texture, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetTextureParameterIuivEXT (GLuint texture, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +GLAPI void APIENTRY glMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +GLAPI void APIENTRY glGetMultiTexParameterIivEXT (GLenum texunit, GLenum target, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetMultiTexParameterIuivEXT (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +GLAPI void APIENTRY glProgramUniform1fEXT (GLuint program, GLint location, GLfloat v0); +GLAPI void APIENTRY glProgramUniform2fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1); +GLAPI void APIENTRY glProgramUniform3fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +GLAPI void APIENTRY glProgramUniform4fEXT (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +GLAPI void APIENTRY glProgramUniform1iEXT (GLuint program, GLint location, GLint v0); +GLAPI void APIENTRY glProgramUniform2iEXT (GLuint program, GLint location, GLint v0, GLint v1); +GLAPI void APIENTRY glProgramUniform3iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +GLAPI void APIENTRY glProgramUniform4iEXT (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +GLAPI void APIENTRY glProgramUniform1fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform2fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform3fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform4fvEXT (GLuint program, GLint location, GLsizei count, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform2ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform3ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniform4ivEXT (GLuint program, GLint location, GLsizei count, const GLint *value); +GLAPI void APIENTRY glProgramUniformMatrix2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3fvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +GLAPI void APIENTRY glProgramUniform1uiEXT (GLuint program, GLint location, GLuint v0); +GLAPI void APIENTRY glProgramUniform2uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1); +GLAPI void APIENTRY glProgramUniform3uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +GLAPI void APIENTRY glProgramUniform4uiEXT (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +GLAPI void APIENTRY glProgramUniform1uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform2uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform3uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glProgramUniform4uivEXT (GLuint program, GLint location, GLsizei count, const GLuint *value); +GLAPI void APIENTRY glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +GLAPI void APIENTRY glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +GLAPI GLvoid* APIENTRY glMapNamedBufferEXT (GLuint buffer, GLenum access); +GLAPI GLboolean APIENTRY glUnmapNamedBufferEXT (GLuint buffer); +GLAPI GLvoid* APIENTRY glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +GLAPI void APIENTRY glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length); +GLAPI void APIENTRY glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +GLAPI void APIENTRY glGetNamedBufferParameterivEXT (GLuint buffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetNamedBufferPointervEXT (GLuint buffer, GLenum pname, GLvoid* *params); +GLAPI void APIENTRY glGetNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +GLAPI void APIENTRY glTextureBufferEXT (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glMultiTexBufferEXT (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +GLAPI void APIENTRY glNamedRenderbufferStorageEXT (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glGetNamedRenderbufferParameterivEXT (GLuint renderbuffer, GLenum pname, GLint *params); +GLAPI GLenum APIENTRY glCheckNamedFramebufferStatusEXT (GLuint framebuffer, GLenum target); +GLAPI void APIENTRY glNamedFramebufferTexture1DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture2DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTexture3DEXT (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +GLAPI void APIENTRY glNamedFramebufferRenderbufferEXT (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +GLAPI void APIENTRY glGetNamedFramebufferAttachmentParameterivEXT (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +GLAPI void APIENTRY glGenerateTextureMipmapEXT (GLuint texture, GLenum target); +GLAPI void APIENTRY glGenerateMultiTexMipmapEXT (GLenum texunit, GLenum target); +GLAPI void APIENTRY glFramebufferDrawBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glFramebufferDrawBuffersEXT (GLuint framebuffer, GLsizei n, const GLenum *bufs); +GLAPI void APIENTRY glFramebufferReadBufferEXT (GLuint framebuffer, GLenum mode); +GLAPI void APIENTRY glGetFramebufferParameterivEXT (GLuint framebuffer, GLenum pname, GLint *params); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleEXT (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedRenderbufferStorageMultisampleCoverageEXT (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +GLAPI void APIENTRY glNamedFramebufferTextureEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +GLAPI void APIENTRY glNamedFramebufferTextureLayerEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +GLAPI void APIENTRY glNamedFramebufferTextureFaceEXT (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +GLAPI void APIENTRY glTextureRenderbufferEXT (GLuint texture, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glMultiTexRenderbufferEXT (GLenum texunit, GLenum target, GLuint renderbuffer); +GLAPI void APIENTRY glProgramUniform1dEXT (GLuint program, GLint location, GLdouble x); +GLAPI void APIENTRY glProgramUniform2dEXT (GLuint program, GLint location, GLdouble x, GLdouble y); +GLAPI void APIENTRY glProgramUniform3dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glProgramUniform4dEXT (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glProgramUniform1dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform2dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform3dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniform4dvEXT (GLuint program, GLint location, GLsizei count, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix2x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix3x4dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x2dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +GLAPI void APIENTRY glProgramUniformMatrix4x3dvEXT (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z); +typedef void (APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +typedef void (APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m); +typedef void (APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (APIENTRYP PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (APIENTRYP PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (APIENTRYP PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble *params); +typedef void (APIENTRYP PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (APIENTRYP PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (APIENTRYP PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat *data); +typedef void (APIENTRYP PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble *data); +typedef void (APIENTRYP PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid* *data); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits); +typedef void (APIENTRYP PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint lod, GLvoid *img); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint *params); +typedef void (APIENTRYP PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint *value); +typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage); +typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLboolean (APIENTRYP PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef GLvoid* (APIENTRYP PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (APIENTRYP PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (APIENTRYP PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, GLvoid* *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data); +typedef void (APIENTRYP PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint *params); +typedef GLenum (APIENTRYP PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (APIENTRYP PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum *bufs); +typedef void (APIENTRYP PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (APIENTRYP PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (APIENTRYP PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (APIENTRYP PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble *value); +#endif + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 +#endif + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 +#endif + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetMultisamplefvNV (GLenum pname, GLuint index, GLfloat *val); +GLAPI void APIENTRY glSampleMaskIndexedNV (GLuint index, GLbitfield mask); +GLAPI void APIENTRY glTexRenderbufferNV (GLenum target, GLuint renderbuffer); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat *val); +typedef void (APIENTRYP PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (APIENTRYP PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); +#endif + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindTransformFeedbackNV (GLenum target, GLuint id); +GLAPI void APIENTRY glDeleteTransformFeedbacksNV (GLsizei n, const GLuint *ids); +GLAPI void APIENTRY glGenTransformFeedbacksNV (GLsizei n, GLuint *ids); +GLAPI GLboolean APIENTRY glIsTransformFeedbackNV (GLuint id); +GLAPI void APIENTRY glPauseTransformFeedbackNV (void); +GLAPI void APIENTRY glResumeTransformFeedbackNV (void); +GLAPI void APIENTRY glDrawTransformFeedbackNV (GLenum mode, GLuint id); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (APIENTRYP PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint *ids); +typedef void (APIENTRYP PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint *ids); +typedef GLboolean (APIENTRYP PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (APIENTRYP PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); +typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +#endif + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 +#endif + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGetPerfMonitorGroupsAMD (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +GLAPI void APIENTRY glGetPerfMonitorCountersAMD (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +GLAPI void APIENTRY glGetPerfMonitorGroupStringAMD (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +GLAPI void APIENTRY glGetPerfMonitorCounterStringAMD (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +GLAPI void APIENTRY glGetPerfMonitorCounterInfoAMD (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +GLAPI void APIENTRY glGenPerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glDeletePerfMonitorsAMD (GLsizei n, GLuint *monitors); +GLAPI void APIENTRY glSelectPerfMonitorCountersAMD (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +GLAPI void APIENTRY glBeginPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glEndPerfMonitorAMD (GLuint monitor); +GLAPI void APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint *numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint *numCounters, GLint *maxActiveCounters, GLsizei counterSize, GLuint *counters); +typedef void (APIENTRYP PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei *length, GLchar *groupString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei *length, GLchar *counterString); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data); +typedef void (APIENTRYP PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint *monitors); +typedef void (APIENTRYP PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint *counterList); +typedef void (APIENTRYP PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint *data, GLint *bytesWritten); +#endif + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 +#endif + +#ifndef GL_AMD_vertex_shader_tesselator +#define GL_AMD_vertex_shader_tesselator 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTessellationFactorAMD (GLfloat factor); +GLAPI void APIENTRY glTessellationModeAMD (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (APIENTRYP PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProvokingVertexEXT (GLenum mode); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); +#endif + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 +#endif + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBlendFuncIndexedAMD (GLuint buf, GLenum src, GLenum dst); +GLAPI void APIENTRY glBlendFuncSeparateIndexedAMD (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +GLAPI void APIENTRY glBlendEquationIndexedAMD (GLuint buf, GLenum mode); +GLAPI void APIENTRY glBlendEquationSeparateIndexedAMD (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (APIENTRYP PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +#endif + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureRangeAPPLE (GLenum target, GLsizei length, const GLvoid *pointer); +GLAPI void APIENTRY glGetTexParameterPointervAPPLE (GLenum target, GLenum pname, GLvoid* *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid* *params); +#endif + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 +#endif + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glEnableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glDisableVertexAttribAPPLE (GLuint index, GLenum pname); +GLAPI GLboolean APIENTRY glIsVertexAttribEnabledAPPLE (GLuint index, GLenum pname); +GLAPI void APIENTRY glMapVertexAttrib1dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib1fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void APIENTRY glMapVertexAttrib2dAPPLE (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void APIENTRY glMapVertexAttrib2fAPPLE (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (APIENTRYP PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +typedef void (APIENTRYP PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +#endif + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 +#endif + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI GLenum APIENTRY glObjectPurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI GLenum APIENTRY glObjectUnpurgeableAPPLE (GLenum objectType, GLuint name, GLenum option); +GLAPI void APIENTRY glGetObjectParameterivAPPLE (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef GLenum (APIENTRYP PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (APIENTRYP PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint *params); +#endif + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 +#endif + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 +#endif + +#ifndef GL_NV_video_capture +#define GL_NV_video_capture 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBeginVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glBindVideoCaptureStreamBufferNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +GLAPI void APIENTRY glBindVideoCaptureStreamTextureNV (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +GLAPI void APIENTRY glEndVideoCaptureNV (GLuint video_capture_slot); +GLAPI void APIENTRY glGetVideoCaptureivNV (GLuint video_capture_slot, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +GLAPI void APIENTRY glGetVideoCaptureStreamfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +GLAPI void APIENTRY glGetVideoCaptureStreamdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +GLAPI GLenum APIENTRY glVideoCaptureNV (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +GLAPI void APIENTRY glVideoCaptureStreamParameterivNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterfvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset); +typedef void (APIENTRYP PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture); +typedef void (APIENTRYP PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat *params); +typedef void (APIENTRYP PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble *params); +typedef GLenum (APIENTRYP PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint *sequence_num, GLuint64EXT *capture_time); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat *params); +typedef void (APIENTRYP PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble *params); +#endif + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glCopyImageSubDataNV (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); +#endif + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program); +GLAPI void APIENTRY glActiveProgramEXT (GLuint program); +GLAPI GLuint APIENTRY glCreateShaderProgramEXT (GLenum type, const GLchar *string); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); +typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string); +#endif + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 +#endif + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glMakeBufferResidentNV (GLenum target, GLenum access); +GLAPI void APIENTRY glMakeBufferNonResidentNV (GLenum target); +GLAPI GLboolean APIENTRY glIsBufferResidentNV (GLenum target); +GLAPI void APIENTRY glMakeNamedBufferResidentNV (GLuint buffer, GLenum access); +GLAPI void APIENTRY glMakeNamedBufferNonResidentNV (GLuint buffer); +GLAPI GLboolean APIENTRY glIsNamedBufferResidentNV (GLuint buffer); +GLAPI void APIENTRY glGetBufferParameterui64vNV (GLenum target, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetNamedBufferParameterui64vNV (GLuint buffer, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glGetIntegerui64vNV (GLenum value, GLuint64EXT *result); +GLAPI void APIENTRY glUniformui64NV (GLint location, GLuint64EXT value); +GLAPI void APIENTRY glUniformui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformui64vNV (GLuint program, GLint location, GLuint64EXT *params); +GLAPI void APIENTRY glProgramUniformui64NV (GLuint program, GLint location, GLuint64EXT value); +GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (APIENTRYP PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef GLboolean (APIENTRYP PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (APIENTRYP PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef GLboolean (APIENTRYP PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT *result); +typedef void (APIENTRYP PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBufferAddressRangeNV (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +GLAPI void APIENTRY glVertexFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glNormalFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glIndexFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glTexCoordFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glEdgeFlagFormatNV (GLsizei stride); +GLAPI void APIENTRY glSecondaryColorFormatNV (GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glFogCoordFormatNV (GLenum type, GLsizei stride); +GLAPI void APIENTRY glVertexAttribFormatNV (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +GLAPI void APIENTRY glVertexAttribIFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +GLAPI void APIENTRY glGetIntegerui64i_vNV (GLenum value, GLuint index, GLuint64EXT *result); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (APIENTRYP PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (APIENTRYP PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (APIENTRYP PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (APIENTRYP PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT *result); +#endif + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glTextureBarrierNV (void); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLTEXTUREBARRIERNVPROC) (void); +#endif + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 +#endif + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 +#endif + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 +#endif + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glBindImageTextureEXT (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +GLAPI void APIENTRY glMemoryBarrierEXT (GLbitfield barriers); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (APIENTRYP PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); +#endif + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1dEXT (GLuint index, GLdouble x); +GLAPI void APIENTRY glVertexAttribL2dEXT (GLuint index, GLdouble x, GLdouble y); +GLAPI void APIENTRY glVertexAttribL3dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z); +GLAPI void APIENTRY glVertexAttribL4dEXT (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void APIENTRY glVertexAttribL1dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL2dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL3dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribL4dvEXT (GLuint index, const GLdouble *v); +GLAPI void APIENTRY glVertexAttribLPointerEXT (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void APIENTRY glGetVertexAttribLdvEXT (GLuint index, GLenum pname, GLdouble *params); +GLAPI void APIENTRY glVertexArrayVertexAttribLOffsetEXT (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble *params); +typedef void (APIENTRYP PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +#endif + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glProgramSubroutineParametersuivNV (GLenum target, GLsizei count, const GLuint *params); +GLAPI void APIENTRY glGetProgramSubroutineParameteruivNV (GLenum target, GLuint index, GLuint *param); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLPROGRAMSUBROUTINEPARAMETERSUIVNVPROC) (GLenum target, GLsizei count, const GLuint *params); +typedef void (APIENTRYP PFNGLGETPROGRAMSUBROUTINEPARAMETERUIVNVPROC) (GLenum target, GLuint index, GLuint *param); +#endif + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glUniform1i64NV (GLint location, GLint64EXT x); +GLAPI void APIENTRY glUniform2i64NV (GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glUniform3i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glUniform4i64NV (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glUniform1i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform2i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform3i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform4i64vNV (GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glUniform1ui64NV (GLint location, GLuint64EXT x); +GLAPI void APIENTRY glUniform2ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glUniform3ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glUniform4ui64NV (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glUniform1ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform2ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform3ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glUniform4ui64vNV (GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glGetUniformi64vNV (GLuint program, GLint location, GLint64EXT *params); +GLAPI void APIENTRY glProgramUniform1i64NV (GLuint program, GLint location, GLint64EXT x); +GLAPI void APIENTRY glProgramUniform2i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glProgramUniform3i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glProgramUniform4i64NV (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glProgramUniform1i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform2i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform3i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform4i64vNV (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +GLAPI void APIENTRY glProgramUniform1ui64NV (GLuint program, GLint location, GLuint64EXT x); +GLAPI void APIENTRY glProgramUniform2ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glProgramUniform3ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glProgramUniform4ui64NV (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glProgramUniform1ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform2ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform3ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +GLAPI void APIENTRY glProgramUniform4ui64vNV (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT *params); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +typedef void (APIENTRYP PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT *value); +#endif + +#ifndef GL_NV_shader_buffer_store +#define GL_NV_shader_buffer_store 1 +#endif + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 +#endif + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVertexAttribL1i64NV (GLuint index, GLint64EXT x); +GLAPI void APIENTRY glVertexAttribL2i64NV (GLuint index, GLint64EXT x, GLint64EXT y); +GLAPI void APIENTRY glVertexAttribL3i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +GLAPI void APIENTRY glVertexAttribL4i64NV (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +GLAPI void APIENTRY glVertexAttribL1i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4i64vNV (GLuint index, const GLint64EXT *v); +GLAPI void APIENTRY glVertexAttribL1ui64NV (GLuint index, GLuint64EXT x); +GLAPI void APIENTRY glVertexAttribL2ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y); +GLAPI void APIENTRY glVertexAttribL3ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +GLAPI void APIENTRY glVertexAttribL4ui64NV (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +GLAPI void APIENTRY glVertexAttribL1ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL2ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL3ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glVertexAttribL4ui64vNV (GLuint index, const GLuint64EXT *v); +GLAPI void APIENTRY glGetVertexAttribLi64vNV (GLuint index, GLenum pname, GLint64EXT *params); +GLAPI void APIENTRY glGetVertexAttribLui64vNV (GLuint index, GLenum pname, GLuint64EXT *params); +GLAPI void APIENTRY glVertexAttribLFormatNV (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT *v); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT *params); +typedef void (APIENTRYP PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT *params); +typedef void (APIENTRYP PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +#endif + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 +#endif + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glGenNamesAMD (GLenum identifier, GLuint num, GLuint *names); +GLAPI void APIENTRY glDeleteNamesAMD (GLenum identifier, GLuint num, const GLuint *names); +GLAPI GLboolean APIENTRY glIsNameAMD (GLenum identifier, GLuint name); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint *names); +typedef void (APIENTRYP PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint *names); +typedef GLboolean (APIENTRYP PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); +#endif + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glDebugMessageEnableAMD (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +GLAPI void APIENTRY glDebugMessageInsertAMD (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +GLAPI void APIENTRY glDebugMessageCallbackAMD (GLDEBUGPROCAMD callback, GLvoid *userParam); +GLAPI GLuint APIENTRY glGetDebugMessageLogAMD (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); +typedef void (APIENTRYP PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar *buf); +typedef void (APIENTRYP PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam); +typedef GLuint (APIENTRYP PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum *categories, GLuint *severities, GLuint *ids, GLsizei *lengths, GLchar *message); +#endif + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 +#ifdef GL_GLEXT_PROTOTYPES +GLAPI void APIENTRY glVDPAUInitNV (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +GLAPI void APIENTRY glVDPAUFiniNV (void); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterVideoSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI GLvdpauSurfaceNV APIENTRY glVDPAURegisterOutputSurfaceNV (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +GLAPI void APIENTRY glVDPAUIsSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUUnregisterSurfaceNV (GLvdpauSurfaceNV surface); +GLAPI void APIENTRY glVDPAUGetSurfaceivNV (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +GLAPI void APIENTRY glVDPAUSurfaceAccessNV (GLvdpauSurfaceNV surface, GLenum access); +GLAPI void APIENTRY glVDPAUMapSurfacesNV (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +GLAPI void APIENTRY glVDPAUUnmapSurfacesNV (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif /* GL_GLEXT_PROTOTYPES */ +typedef void (APIENTRYP PFNGLVDPAUINITNVPROC) (const GLvoid *vdpDevice, const GLvoid *getProcAddress); +typedef void (APIENTRYP PFNGLVDPAUFININVPROC) (void); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (APIENTRYP PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (GLvoid *vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (APIENTRYP PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (APIENTRYP PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); +typedef void (APIENTRYP PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (APIENTRYP PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV *surfaces); +typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV *surfaces); +#endif + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 +#endif + + +#ifdef __cplusplus +} +#endif + +#endif +#endif /* NO_SDL_GLEXT */ + +#endif /* !__IPHONEOS__ */ + +#endif /* _SDL_opengl_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_opengles.h b/SDL/include/SDL_opengles.h new file mode 100644 index 0000000..00e60f5 --- /dev/null +++ b/SDL/include/SDL_opengles.h @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 1.X API headers. + */ + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/SDL/include/SDL_opengles2.h b/SDL/include/SDL_opengles2.h new file mode 100644 index 0000000..7697626 --- /dev/null +++ b/SDL/include/SDL_opengles2.h @@ -0,0 +1,38 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_opengles.h + * + * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. + */ + +#ifdef __IPHONEOS__ +#include +#include +#else +#include +#include +#endif + +#ifndef APIENTRY +#define APIENTRY +#endif diff --git a/SDL/include/SDL_p2p.h b/SDL/include/SDL_p2p.h new file mode 100644 index 0000000..06778ff --- /dev/null +++ b/SDL/include/SDL_p2p.h @@ -0,0 +1,78 @@ + +#ifndef _SDL_p2p_h +#define _SDL_p2p_h + +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" +{ +#endif + + typedef enum + { + SDL_P2P_PEERCONNECTED = 0, + SDL_P2P_PEERDISCONNECTED = 1, + SDL_P2P_PEERREQUESTEDCONNECTION = 2, + SDL_P2P_PICKERDIDCANCEL = 3, + SDL_P2P_RECIEVEDDATA = 4 + } SDL_P2P_EventType; + + struct SDL_P2P_PeerInfo + { + char*peerID; + char*peerDisplayName; + }; + + struct SDL_P2P_DataInfo + { + void*data; + unsigned int size; + }; + + typedef struct + { + SDL_P2P_EventType type; + SDL_Window*window; + struct SDL_P2P_PeerInfo peer; + struct SDL_P2P_DataInfo data; + } SDL_P2P_Event; + + typedef void (*SDL_P2P_EventHandler)(SDL_P2P_Event*); + + typedef enum + { + SDL_P2P_SENDDATA_RELIABLE, + SDL_P2P_SENDDATA_UNRELIABLE + } SDL_P2P_SendDataMode; + + extern DECLSPEC void SDLCALL SDL_P2P_setEventHandler(SDL_P2P_EventHandler callback); + + extern DECLSPEC void SDLCALL SDL_P2P_searchForPeersBluetooth(SDL_Window*parent, const char*sessionID); + + extern DECLSPEC SDL_bool SDLCALL SDL_P2P_isConnected(SDL_Window*parent); + extern DECLSPEC SDL_bool SDLCALL SDL_P2P_isConnectedToPeer(SDL_Window*parent, const char*peerID); + + extern DECLSPEC SDL_bool SDLCALL SDL_P2P_acceptConnectionRequest(SDL_Window*parent, const char*peerID); + extern DECLSPEC void SDLCALL SDL_P2P_denyConnectionRequest(SDL_Window*parent, const char*peerID); + + extern DECLSPEC void SDLCALL SDL_P2P_getPeerDisplayName(SDL_Window*parent, const char*peerID, char*dispName); + extern DECLSPEC void SDLCALL SDL_P2P_getSelfDisplayName(SDL_Window*parent, char*dispName); + extern DECLSPEC void SDLCALL SDL_P2P_getSelfID(SDL_Window*parent, char*selfID); + extern DECLSPEC void SDLCALL SDL_P2P_getSessionID(SDL_Window*parent, char*sessionID); + + extern DECLSPEC void SDLCALL SDL_P2P_sendData(SDL_Window*parent, void*data, unsigned int size, SDL_P2P_SendDataMode mode); + extern DECLSPEC void SDLCALL SDL_P2P_sendDataToPeers(SDL_Window*parent, char**peers, unsigned int numPeers, void*data, unsigned int size, SDL_P2P_SendDataMode mode); + + extern DECLSPEC void SDLCALL SDL_P2P_disconnectPeer(SDL_Window*parent, const char*peerID); + extern DECLSPEC void SDLCALL SDL_P2P_endSession(SDL_Window*parent); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_p2p_h */ \ No newline at end of file diff --git a/SDL/include/SDL_pixels.h b/SDL/include/SDL_pixels.h new file mode 100644 index 0000000..99fcd9a --- /dev/null +++ b/SDL/include/SDL_pixels.h @@ -0,0 +1,427 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_pixels.h + * + * Header for the enumerated pixel format definitions. + */ + +#ifndef _SDL_pixels_h +#define _SDL_pixels_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Transparency definitions + * + * These define alpha as the opacity of a surface. + */ +/* @{ */ +#define SDL_ALPHA_OPAQUE 255 +#define SDL_ALPHA_TRANSPARENT 0 +/* @} */ + +/** Pixel type. */ +enum +{ + SDL_PIXELTYPE_UNKNOWN, + SDL_PIXELTYPE_INDEX1, + SDL_PIXELTYPE_INDEX4, + SDL_PIXELTYPE_INDEX8, + SDL_PIXELTYPE_PACKED8, + SDL_PIXELTYPE_PACKED16, + SDL_PIXELTYPE_PACKED32, + SDL_PIXELTYPE_ARRAYU8, + SDL_PIXELTYPE_ARRAYU16, + SDL_PIXELTYPE_ARRAYU32, + SDL_PIXELTYPE_ARRAYF16, + SDL_PIXELTYPE_ARRAYF32 +}; + +/** Bitmap pixel order, high bit -> low bit. */ +enum +{ + SDL_BITMAPORDER_NONE, + SDL_BITMAPORDER_4321, + SDL_BITMAPORDER_1234 +}; + +/** Packed component order, high bit -> low bit. */ +enum +{ + SDL_PACKEDORDER_NONE, + SDL_PACKEDORDER_XRGB, + SDL_PACKEDORDER_RGBX, + SDL_PACKEDORDER_ARGB, + SDL_PACKEDORDER_RGBA, + SDL_PACKEDORDER_XBGR, + SDL_PACKEDORDER_BGRX, + SDL_PACKEDORDER_ABGR, + SDL_PACKEDORDER_BGRA +}; + +/** Array component order, low byte -> high byte. */ +enum +{ + SDL_ARRAYORDER_NONE, + SDL_ARRAYORDER_RGB, + SDL_ARRAYORDER_RGBA, + SDL_ARRAYORDER_ARGB, + SDL_ARRAYORDER_BGR, + SDL_ARRAYORDER_BGRA, + SDL_ARRAYORDER_ABGR +}; + +/** Packed component layout. */ +enum +{ + SDL_PACKEDLAYOUT_NONE, + SDL_PACKEDLAYOUT_332, + SDL_PACKEDLAYOUT_4444, + SDL_PACKEDLAYOUT_1555, + SDL_PACKEDLAYOUT_5551, + SDL_PACKEDLAYOUT_565, + SDL_PACKEDLAYOUT_8888, + SDL_PACKEDLAYOUT_2101010, + SDL_PACKEDLAYOUT_1010102 +}; + +#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D) + +#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \ + ((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \ + ((bits) << 8) | ((bytes) << 0)) + +#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F) +#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) +#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) +#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) +#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) +#define SDL_BYTESPERPIXEL(X) \ + (SDL_ISPIXELFORMAT_FOURCC(X) ? \ + ((((X) == SDL_PIXELFORMAT_YUY2) || \ + ((X) == SDL_PIXELFORMAT_UYVY) || \ + ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF)) + +#define SDL_ISPIXELFORMAT_INDEXED(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \ + (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))) + +#define SDL_ISPIXELFORMAT_ALPHA(format) \ + (!SDL_ISPIXELFORMAT_FOURCC(format) && \ + ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \ + (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) + +/* The flag is set to 1 because 0x1? is not in the printable ASCII range */ +#define SDL_ISPIXELFORMAT_FOURCC(format) \ + ((format) && (SDL_PIXELFLAG(format) != 1)) + +/* Note: If you modify this list, update SDL_GetPixelFormatName() */ +enum +{ + SDL_PIXELFORMAT_UNKNOWN, + SDL_PIXELFORMAT_INDEX1LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX1MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, + 1, 0), + SDL_PIXELFORMAT_INDEX4LSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX4MSB = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, + 4, 0), + SDL_PIXELFORMAT_INDEX8 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), + SDL_PIXELFORMAT_RGB332 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_332, 8, 1), + SDL_PIXELFORMAT_RGB444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_4444, 12, 2), + SDL_PIXELFORMAT_RGB555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_BGR555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_1555, 15, 2), + SDL_PIXELFORMAT_ARGB4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_RGBA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ABGR4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_BGRA4444 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_4444, 16, 2), + SDL_PIXELFORMAT_ARGB1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_RGBA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_ABGR1555 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_1555, 16, 2), + SDL_PIXELFORMAT_BGRA5551 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_5551, 16, 2), + SDL_PIXELFORMAT_RGB565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_BGR565 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_565, 16, 2), + SDL_PIXELFORMAT_RGB24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, + 24, 3), + SDL_PIXELFORMAT_BGR24 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, + 24, 3), + SDL_PIXELFORMAT_RGB888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_RGBX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGR888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_BGRX8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, + SDL_PACKEDLAYOUT_8888, 24, 4), + SDL_PIXELFORMAT_ARGB8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_RGBA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ABGR8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_BGRA8888 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, + SDL_PACKEDLAYOUT_8888, 32, 4), + SDL_PIXELFORMAT_ARGB2101010 = + SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, + SDL_PACKEDLAYOUT_2101010, 32, 4), + + SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), + SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ + SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), + SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), + SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), + SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U') +}; + +typedef struct SDL_Color +{ + Uint8 r; + Uint8 g; + Uint8 b; + Uint8 a; +} SDL_Color; +#define SDL_Colour SDL_Color + +typedef struct SDL_Palette +{ + int ncolors; + SDL_Color *colors; + Uint32 version; + int refcount; +} SDL_Palette; + +/** + * \note Everything in the pixel format structure is read-only. + */ +typedef struct SDL_PixelFormat +{ + Uint32 format; + SDL_Palette *palette; + Uint8 BitsPerPixel; + Uint8 BytesPerPixel; + Uint8 padding[2]; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; + Uint8 Rshift; + Uint8 Gshift; + Uint8 Bshift; + Uint8 Ashift; + int refcount; + struct SDL_PixelFormat *next; +} SDL_PixelFormat; + +/** + * \brief Get the human readable name of a pixel format + */ +extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format); + +/** + * \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks. + * + * \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible. + * + * \sa SDL_MasksToPixelFormatEnum() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format, + int *bpp, + Uint32 * Rmask, + Uint32 * Gmask, + Uint32 * Bmask, + Uint32 * Amask); + +/** + * \brief Convert a bpp and RGBA masks to an enumerated pixel format. + * + * \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion + * wasn't possible. + * + * \sa SDL_PixelFormatEnumToMasks() + */ +extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); + +/** + * \brief Create an SDL_PixelFormat structure from a pixel format enum. + */ +extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format); + +/** + * \brief Free an SDL_PixelFormat structure. + */ +extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format); + +/** + * \brief Create a palette structure with the specified number of color + * entries. + * + * \return A new palette, or NULL if there wasn't enough memory. + * + * \note The palette entries are initialized to white. + * + * \sa SDL_FreePalette() + */ +extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors); + +/** + * \brief Set the palette for a pixel format structure. + */ +extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, + SDL_Palette *palette); + +/** + * \brief Set a range of colors in a palette. + * + * \param palette The palette to modify. + * \param colors An array of colors to copy into the palette. + * \param firstcolor The index of the first palette entry to modify. + * \param ncolors The number of entries to modify. + * + * \return 0 on success, or -1 if not all of the colors could be set. + */ +extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, + const SDL_Color * colors, + int firstcolor, int ncolors); + +/** + * \brief Free a palette created with SDL_AllocPalette(). + * + * \sa SDL_AllocPalette() + */ +extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette); + +/** + * \brief Maps an RGB triple to an opaque pixel value for a given pixel format. + * + * \sa SDL_MapRGBA + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b); + +/** + * \brief Maps an RGBA quadruple to a pixel value for a given pixel format. + * + * \sa SDL_MapRGB + */ +extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the RGB components from a pixel of the specified format. + * + * \sa SDL_GetRGBA + */ +extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b); + +/** + * \brief Get the RGBA components from a pixel of the specified format. + * + * \sa SDL_GetRGB + */ +extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, + const SDL_PixelFormat * format, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Calculate a 256 entry gamma ramp for a gamma value. + */ +extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_pixels_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_platform.h b/SDL/include/SDL_platform.h new file mode 100644 index 0000000..a40c41e --- /dev/null +++ b/SDL/include/SDL_platform.h @@ -0,0 +1,155 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_platform.h + * + * Try to get a standard set of platform defines. + */ + +#ifndef _SDL_platform_h +#define _SDL_platform_h + +#if defined(_AIX) +#undef __AIX__ +#define __AIX__ 1 +#endif +#if defined(__BEOS__) +#undef __BEOS__ +#define __BEOS__ 1 +#endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#undef __BSDI__ +#define __BSDI__ 1 +#endif +#if defined(_arch_dreamcast) +#undef __DREAMCAST__ +#define __DREAMCAST__ 1 +#endif +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) +#undef __FREEBSD__ +#define __FREEBSD__ 1 +#endif +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#undef __HPUX__ +#define __HPUX__ 1 +#endif +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#undef __IRIX__ +#define __IRIX__ 1 +#endif +#if defined(linux) || defined(__linux) || defined(__linux__) +#undef __LINUX__ +#define __LINUX__ 1 +#endif +#if defined(ANDROID) +#undef __ANDROID__ +#undef __LINUX__ /* do we need to do this? */ +#define __ANDROID__ 1 +#endif + +#if defined(__APPLE__) +/* lets us know what version of Mac OS X we're compiling on */ +#include "AvailabilityMacros.h" +#include "TargetConditionals.h" +#if TARGET_OS_IPHONE +/* if compiling for iPhone */ +#undef __IPHONEOS__ +#define __IPHONEOS__ 1 +#undef __MACOSX__ +#else +/* if not compiling for iPhone */ +#undef __MACOSX__ +#define __MACOSX__ 1 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050 +# error SDL for Mac OS X only supports deploying on 10.5 and above. +#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */ +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 +# error SDL for Mac OS X must be built with a 10.6 SDK or above. +#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1060 */ +#endif /* TARGET_OS_IPHONE */ +#endif /* defined(__APPLE__) */ + +#if defined(__NetBSD__) +#undef __NETBSD__ +#define __NETBSD__ 1 +#endif +#if defined(__OpenBSD__) +#undef __OPENBSD__ +#define __OPENBSD__ 1 +#endif +#if defined(__OS2__) +#undef __OS2__ +#define __OS2__ 1 +#endif +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#undef __OSF__ +#define __OSF__ 1 +#endif +#if defined(__QNXNTO__) +#undef __QNXNTO__ +#define __QNXNTO__ 1 +#endif +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#undef __RISCOS__ +#define __RISCOS__ 1 +#endif +#if defined(__SVR4) +#undef __SOLARIS__ +#define __SOLARIS__ 1 +#endif +#if defined(WIN32) || defined(_WIN32) || defined(__CYGWIN__) +#undef __WINDOWS__ +#define __WINDOWS__ 1 +#endif +#if defined(__WINDOWS__) +#undef __WIN32__ +#define __WIN32__ 1 +#endif +#if defined(__PSP__) +#undef __PSP__ +#define __PSP__ 1 +#endif + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Gets the name of the platform. + */ +extern DECLSPEC const char * SDLCALL SDL_GetPlatform (void); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_platform_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_power.h b/SDL/include/SDL_power.h new file mode 100644 index 0000000..4f70c5b --- /dev/null +++ b/SDL/include/SDL_power.h @@ -0,0 +1,75 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_power_h +#define _SDL_power_h + +/** + * \file SDL_power.h + * + * Header for the SDL power management routines. + */ + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The basic state for the system's power supply. + */ +typedef enum +{ + SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ + SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ + SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ + SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ + SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ +} SDL_PowerState; + + +/** + * \brief Get the current power supply details. + * + * \param secs Seconds of battery life left. You can pass a NULL here if + * you don't care. Will return -1 if we can't determine a + * value, or we're not running on a battery. + * + * \param pct Percentage of battery life left, between 0 and 100. You can + * pass a NULL here if you don't care. Will return -1 if we + * can't determine a value, or we're not running on a battery. + * + * \return The state of the battery (if any). + */ +extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_power_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_quit.h b/SDL/include/SDL_quit.h new file mode 100644 index 0000000..485e42d --- /dev/null +++ b/SDL/include/SDL_quit.h @@ -0,0 +1,58 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_quit.h + * + * Include file for SDL quit event handling. + */ + +#ifndef _SDL_quit_h +#define _SDL_quit_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/** + * \file SDL_quit.h + * + * An ::SDL_QUIT event is generated when the user tries to close the application + * window. If it is ignored or filtered out, the window will remain open. + * If it is not ignored or filtered, it is queued normally and the window + * is allowed to close. When the window is closed, screen updates will + * complete, but have no effect. + * + * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) + * and SIGTERM (system termination request), if handlers do not already + * exist, that generate ::SDL_QUIT events as well. There is no way + * to determine the cause of an ::SDL_QUIT event, but setting a signal + * handler in your application will override the default generation of + * quit events for that signal. + * + * \sa SDL_Quit() + */ + +/* There are no functions directly affecting the quit event */ + +#define SDL_QuitRequested() \ + (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) + +#endif /* _SDL_quit_h */ diff --git a/SDL/include/SDL_rect.h b/SDL/include/SDL_rect.h new file mode 100644 index 0000000..7132e1b --- /dev/null +++ b/SDL/include/SDL_rect.h @@ -0,0 +1,138 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rect.h + * + * Header file for SDL_rect definition and management functions. + */ + +#ifndef _SDL_rect_h +#define _SDL_rect_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_pixels.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a point + * + * \sa SDL_EnclosePoints + */ +typedef struct SDL_Point +{ + int x; + int y; +} SDL_Point; + +/** + * \brief A rectangle, with the origin at the upper left. + * + * \sa SDL_RectEmpty + * \sa SDL_RectEquals + * \sa SDL_HasIntersection + * \sa SDL_IntersectRect + * \sa SDL_UnionRect + * \sa SDL_EnclosePoints + */ +typedef struct SDL_Rect +{ + int x, y; + int w, h; +} SDL_Rect; + +/** + * \brief Returns true if the rectangle has no area. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) +{ + return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Returns true if the two rectangles are equal. + */ +SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) +{ + return (a && b && (a->x == b->x) && (a->y == b->y) && + (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; +} + +/** + * \brief Determine whether two rectangles intersect. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, + const SDL_Rect * B); + +/** + * \brief Calculate the intersection of two rectangles. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate the union of two rectangles. + */ +extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, + const SDL_Rect * B, + SDL_Rect * result); + +/** + * \brief Calculate a minimal rectangle enclosing a set of points + * + * \return SDL_TRUE if any points were within the clipping rect + */ +extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, + int count, + const SDL_Rect * clip, + SDL_Rect * result); + +/** + * \brief Calculate the intersection of a rectangle and line segment. + * + * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * + rect, int *X1, + int *Y1, int *X2, + int *Y2); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rect_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_render.h b/SDL/include/SDL_render.h new file mode 100644 index 0000000..a765dc7 --- /dev/null +++ b/SDL/include/SDL_render.h @@ -0,0 +1,870 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_render.h + * + * Header file for SDL 2D rendering functions. + * + * This API supports the following features: + * * single pixel points + * * single pixel lines + * * filled rectangles + * * texture images + * + * The primitives may be drawn in opaque, blended, or additive modes. + * + * The texture images may be drawn in opaque, blended, or additive modes. + * They can have an additional color tint or alpha modulation applied to + * them, and may also be stretched with linear interpolation. + * + * This API is designed to accelerate simple 2D operations. You may + * want more functionality such as polygons and particle effects and + * in that case you should use SDL's OpenGL/Direct3D support or one + * of the many good 3D engines. + * + * These functions must be called from the main thread. + * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995 + */ + +#ifndef _SDL_render_h +#define _SDL_render_h + +#include "SDL_stdinc.h" +#include "SDL_rect.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Flags used when creating a rendering context + */ +typedef enum +{ + SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */ + SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware + acceleration */ + SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized + with the refresh rate */ + SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports + rendering to texture */ +} SDL_RendererFlags; + +/** + * \brief Information on the capabilities of a render driver or context. + */ +typedef struct SDL_RendererInfo +{ + const char *name; /**< The name of the renderer */ + Uint32 flags; /**< Supported ::SDL_RendererFlags */ + Uint32 num_texture_formats; /**< The number of available texture formats */ + Uint32 texture_formats[16]; /**< The available texture formats */ + int max_texture_width; /**< The maximimum texture width */ + int max_texture_height; /**< The maximimum texture height */ +} SDL_RendererInfo; + +/** + * \brief The access pattern allowed for a texture. + */ +typedef enum +{ + SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */ + SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */ + SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */ +} SDL_TextureAccess; + +/** + * \brief The texture channel modulation used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */ + SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */ + SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ +} SDL_TextureModulate; + +/** + * \brief Flip constants for SDL_RenderCopyEx + */ +typedef enum +{ + SDL_FLIP_NONE = 0x00000000, /**< Do not flip */ + SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */ + SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */ +} SDL_RendererFlip; + +/** + * \brief A structure representing rendering state + */ +struct SDL_Renderer; +typedef struct SDL_Renderer SDL_Renderer; + +/** + * \brief An efficient driver-specific representation of pixel data + */ +struct SDL_Texture; +typedef struct SDL_Texture SDL_Texture; + + +/* Function prototypes */ + +/** + * \brief Get the number of 2D rendering drivers available for the current + * display. + * + * A render driver is a set of code that handles rendering and texture + * management on a particular display. Normally there is only one, but + * some drivers may have several available with different capabilities. + * + * \sa SDL_GetRenderDriverInfo() + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); + +/** + * \brief Get information about a specific 2D rendering driver for the current + * display. + * + * \param index The index of the driver to query information about. + * \param info A pointer to an SDL_RendererInfo struct to be filled with + * information on the rendering driver. + * + * \return 0 on success, -1 if the index was out of range. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index, + SDL_RendererInfo * info); + +/** + * \brief Create a window and default renderer + * + * \param width The width of the window + * \param height The height of the window + * \param window_flags The flags used to create the window + * \param window A pointer filled with the window, or NULL on error + * \param renderer A pointer filled with the renderer, or NULL on error + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer( + int width, int height, Uint32 window_flags, + SDL_Window **window, SDL_Renderer **renderer); + + +/** + * \brief Create a 2D rendering context for a window. + * + * \param window The window where rendering is displayed. + * \param index The index of the rendering driver to initialize, or -1 to + * initialize the first one supporting the requested flags. + * \param flags ::SDL_RendererFlags. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateSoftwareRenderer() + * \sa SDL_GetRendererInfo() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window, + int index, Uint32 flags); + +/** + * \brief Create a 2D software rendering context for a surface. + * + * \param surface The surface where rendering is done. + * + * \return A valid rendering context or NULL if there was an error. + * + * \sa SDL_CreateRenderer() + * \sa SDL_DestroyRenderer() + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface); + +/** + * \brief Get the renderer associated with a window. + */ +extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window); + +/** + * \brief Get information about a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer, + SDL_RendererInfo * info); + +/** + * \brief Get the output size of a rendering context. + */ +extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer, + int *w, int *h); + +/** + * \brief Create a texture for a rendering context. + * + * \param renderer The renderer. + * \param format The format of the texture. + * \param access One of the enumerated values in ::SDL_TextureAccess. + * \param w The width of the texture in pixels. + * \param h The height of the texture in pixels. + * + * \return The created texture is returned, or 0 if no rendering context was + * active, the format was unsupported, or the width or height were out + * of range. + * + * \sa SDL_QueryTexture() + * \sa SDL_UpdateTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer, + Uint32 format, + int access, int w, + int h); + +/** + * \brief Create a texture from an existing surface. + * + * \param renderer The renderer. + * \param surface The surface containing pixel data used to fill the texture. + * + * \return The created texture is returned, or 0 on error. + * + * \note The surface is not modified or freed by this function. + * + * \sa SDL_QueryTexture() + * \sa SDL_DestroyTexture() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface); + +/** + * \brief Query the attributes of a texture + * + * \param texture A texture to be queried. + * \param format A pointer filled in with the raw format of the texture. The + * actual format may differ, but pixel transfers will use this + * format. + * \param access A pointer filled in with the actual access to the texture. + * \param w A pointer filled in with the width of the texture in pixels. + * \param h A pointer filled in with the height of the texture in pixels. + * + * \return 0 on success, or -1 if the texture is not valid. + */ +extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture, + Uint32 * format, int *access, + int *w, int *h); + +/** + * \brief Set an additional color value used in render copy operations. + * + * \param texture The texture to update. + * \param r The red color value multiplied into copy operations. + * \param g The green color value multiplied into copy operations. + * \param b The blue color value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or color modulation + * is not supported. + * + * \sa SDL_GetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in render copy operations. + * + * \param texture The texture to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in render copy operations. + * + * \param texture The texture to update. + * \param alpha The alpha value multiplied into copy operations. + * + * \return 0 on success, or -1 if the texture is not valid or alpha modulation + * is not supported. + * + * \sa SDL_GetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in render copy operations. + * + * \param texture The texture to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for texture copy operations. + * + * \param texture The texture to update. + * \param blendMode ::SDL_BlendMode to use for texture blending. + * + * \return 0 on success, or -1 if the texture is not valid or the blend mode is + * not supported. + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for texture copy operations. + * + * \param texture The texture to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \sa SDL_SetTextureBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, + SDL_BlendMode *blendMode); + +/** + * \brief Update the given texture rectangle with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param pixels The raw pixel data. + * \param pitch The number of bytes between rows of pixel data. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note This is a fairly slow function. + */ +extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const void *pixels, int pitch); + +/** + * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data. + * + * \param texture The texture to update + * \param rect A pointer to the rectangle of pixels to update, or NULL to + * update the entire texture. + * \param Yplane The raw pixel data for the Y plane. + * \param Ypitch The number of bytes between rows of pixel data for the Y plane. + * \param Uplane The raw pixel data for the U plane. + * \param Upitch The number of bytes between rows of pixel data for the U plane. + * \param Vplane The raw pixel data for the V plane. + * \param Vpitch The number of bytes between rows of pixel data for the V plane. + * + * \return 0 on success, or -1 if the texture is not valid. + * + * \note You can use SDL_UpdateTexture() as long as your pixel data is + * a contiguous block of Y and U/V planes in the proper order, but + * this function is available if your pixel data is not contiguous. + */ +extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture, + const SDL_Rect * rect, + const Uint8 *Yplane, int Ypitch, + const Uint8 *Uplane, int Upitch, + const Uint8 *Vplane, int Vpitch); + +/** + * \brief Lock a portion of the texture for write-only pixel access. + * + * \param texture The texture to lock for access, which was created with + * ::SDL_TEXTUREACCESS_STREAMING. + * \param rect A pointer to the rectangle to lock for access. If the rect + * is NULL, the entire texture will be locked. + * \param pixels This is filled in with a pointer to the locked pixels, + * appropriately offset by the locked area. + * \param pitch This is filled in with the pitch of the locked pixels. + * + * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING. + * + * \sa SDL_UnlockTexture() + */ +extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture, + const SDL_Rect * rect, + void **pixels, int *pitch); + +/** + * \brief Unlock a texture, uploading the changes to video memory, if needed. + * + * \sa SDL_LockTexture() + */ +extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture); + +/** + * \brief Determines whether a window supports the use of render targets + * + * \param renderer The renderer that will be checked + * + * \return SDL_TRUE if supported, SDL_FALSE if not. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer); + +/** + * \brief Set a texture as the current rendering target. + * + * \param renderer The renderer. + * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target + * + * \return 0 on success, or -1 on error + * + * \sa SDL_GetRenderTarget() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, + SDL_Texture *texture); + +/** + * \brief Get the current render target or NULL for the default render target. + * + * \return The current render target + * + * \sa SDL_SetRenderTarget() + */ +extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); + +/** + * \brief Set device independent resolution for rendering + * + * \param renderer The renderer for which resolution should be set. + * \param w The width of the logical resolution + * \param h The height of the logical resolution + * + * This function uses the viewport and scaling functionality to allow a fixed logical + * resolution for rendering, regardless of the actual output resolution. If the actual + * output resolution doesn't have the same aspect ratio the output rendering will be + * centered within the output display. + * + * If the output display is a window, mouse events in the window will be filtered + * and scaled so they seem to arrive within the logical resolution. + * + * \note If this function results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. + * + * \sa SDL_RenderGetLogicalSize() + * \sa SDL_RenderSetScale() + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h); + +/** + * \brief Get device independent resolution for rendering + * + * \param renderer The renderer from which resolution should be queried. + * \param w A pointer filled with the width of the logical resolution + * \param h A pointer filled with the height of the logical resolution + * + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h); + +/** + * \brief Set the drawing area for rendering on the current target. + * + * \param renderer The renderer for which the drawing area should be set. + * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target. + * + * The x,y of the viewport rect represents the origin for rendering. + * + * \return 0 on success, or -1 on error + * + * \note If the window associated with the renderer is resized, the viewport is automatically reset. + * + * \sa SDL_RenderGetViewport() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the drawing area for the current target. + * + * \sa SDL_RenderSetViewport() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Set the clip rectangle for the current target. + * + * \param renderer The renderer for which clip rectangle should be set. + * \param rect A pointer to the rectangle to set as the clip rectangle, or + * NULL to disable clipping. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_RenderGetClipRect() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Get the clip rectangle for the current target. + * + * \param renderer The renderer from which clip rectangle should be queried. + * \param rect A pointer filled in with the current clip rectangle, or + * an empty rectangle if clipping is disabled. + * + * \sa SDL_RenderSetClipRect() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer, + SDL_Rect * rect); + +/** + * \brief Set the drawing scale for rendering on the current target. + * + * \param renderer The renderer for which the drawing scale should be set. + * \param scaleX The horizontal scaling factor + * \param scaleY The vertical scaling factor + * + * The drawing coordinates are scaled by the x/y scaling factors + * before they are used by the renderer. This allows resolution + * independent drawing with a single coordinate system. + * + * \note If this results in scaling or subpixel drawing by the + * rendering backend, it will be handled using the appropriate + * quality hints. For best results use integer scaling factors. + * + * \sa SDL_RenderGetScale() + * \sa SDL_RenderSetLogicalSize() + */ +extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer, + float scaleX, float scaleY); + +/** + * \brief Get the drawing scale for the current target. + * + * \param renderer The renderer from which drawing scale should be queried. + * \param scaleX A pointer filled in with the horizontal scaling factor + * \param scaleY A pointer filled in with the vertical scaling factor + * + * \sa SDL_RenderSetScale() + */ +extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer, + float *scaleX, float *scaleY); + +/** + * \brief Set the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer for which drawing color should be set. + * \param r The red value used to draw on the rendering target. + * \param g The green value used to draw on the rendering target. + * \param b The blue value used to draw on the rendering target. + * \param a The alpha value used to draw on the rendering target, usually + * ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer, + Uint8 r, Uint8 g, Uint8 b, + Uint8 a); + +/** + * \brief Get the color used for drawing operations (Rect, Line and Clear). + * + * \param renderer The renderer from which drawing color should be queried. + * \param r A pointer to the red value used to draw on the rendering target. + * \param g A pointer to the green value used to draw on the rendering target. + * \param b A pointer to the blue value used to draw on the rendering target. + * \param a A pointer to the alpha value used to draw on the rendering target, + * usually ::SDL_ALPHA_OPAQUE (255). + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer, + Uint8 * r, Uint8 * g, Uint8 * b, + Uint8 * a); + +/** + * \brief Set the blend mode used for drawing operations (Fill and Line). + * + * \param renderer The renderer for which blend mode should be set. + * \param blendMode ::SDL_BlendMode to use for blending. + * + * \return 0 on success, or -1 on error + * + * \note If the blend mode is not supported, the closest supported mode is + * chosen. + * + * \sa SDL_GetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for drawing operations. + * + * \param renderer The renderer from which blend mode should be queried. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 on error + * + * \sa SDL_SetRenderDrawBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer, + SDL_BlendMode *blendMode); + +/** + * \brief Clear the current rendering target with the drawing color + * + * This function clears the entire rendering target, ignoring the viewport. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer); + +/** + * \brief Draw a point on the current rendering target. + * + * \param renderer The renderer which should draw a point. + * \param x The x coordinate of the point. + * \param y The y coordinate of the point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer, + int x, int y); + +/** + * \brief Draw multiple points on the current rendering target. + * + * \param renderer The renderer which should draw multiple points. + * \param points The points to draw + * \param count The number of points to draw + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a line on the current rendering target. + * + * \param renderer The renderer which should draw a line. + * \param x1 The x coordinate of the start point. + * \param y1 The y coordinate of the start point. + * \param x2 The x coordinate of the end point. + * \param y2 The y coordinate of the end point. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer, + int x1, int y1, int x2, int y2); + +/** + * \brief Draw a series of connected lines on the current rendering target. + * + * \param renderer The renderer which should draw multiple lines. + * \param points The points along the lines + * \param count The number of points, drawing count-1 lines + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer, + const SDL_Point * points, + int count); + +/** + * \brief Draw a rectangle on the current rendering target. + * + * \param renderer The renderer which should draw a rectangle. + * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Draw some number of rectangles on the current rendering target. + * + * \param renderer The renderer which should draw multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Fill a rectangle on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill a rectangle. + * \param rect A pointer to the destination rectangle, or NULL for the entire + * rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer, + const SDL_Rect * rect); + +/** + * \brief Fill some number of rectangles on the current rendering target with the drawing color. + * + * \param renderer The renderer which should fill multiple rectangles. + * \param rects A pointer to an array of destination rectangles. + * \param count The number of rectangles. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer, + const SDL_Rect * rects, + int count); + +/** + * \brief Copy a portion of the texture to the current rendering target. + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect); + +/** + * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center + * + * \param renderer The renderer which should copy parts of a texture. + * \param texture The source texture. + * \param srcrect A pointer to the source rectangle, or NULL for the entire + * texture. + * \param dstrect A pointer to the destination rectangle, or NULL for the + * entire rendering target. + * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect + * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done aroud dstrect.w/2, dstrect.h/2) + * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture + * + * \return 0 on success, or -1 on error + */ +extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer, + SDL_Texture * texture, + const SDL_Rect * srcrect, + const SDL_Rect * dstrect, + const double angle, + const SDL_Point *center, + const SDL_RendererFlip flip); + +/** + * \brief Read pixels from the current rendering target. + * + * \param renderer The renderer from which pixels should be read. + * \param rect A pointer to the rectangle to read, or NULL for the entire + * render target. + * \param format The desired format of the pixel data, or 0 to use the format + * of the rendering target + * \param pixels A pointer to be filled in with the pixel data + * \param pitch The pitch of the pixels parameter. + * + * \return 0 on success, or -1 if pixel reading is not supported. + * + * \warning This is a very slow operation, and should not be used frequently. + */ +extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer, + const SDL_Rect * rect, + Uint32 format, + void *pixels, int pitch); + +/** + * \brief Update the screen with rendering performed. + */ +extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer); + +/** + * \brief Destroy the specified texture. + * + * \sa SDL_CreateTexture() + * \sa SDL_CreateTextureFromSurface() + */ +extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture); + +/** + * \brief Destroy the rendering context for a window and free associated + * textures. + * + * \sa SDL_CreateRenderer() + */ +extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer); + + +/** + * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with + * OpenGL instructions. + * + * \param texture The SDL texture to bind + * \param texw A pointer to a float that will be filled with the texture width + * \param texh A pointer to a float that will be filled with the texture height + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh); + +/** + * \brief Unbind a texture from the current OpenGL/ES/ES2 context. + * + * \param texture The SDL texture to unbind + * + * \return 0 on success, or -1 if the operation is not supported + */ +extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_render_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_revision.h b/SDL/include/SDL_revision.h new file mode 100644 index 0000000..fe3a9fc --- /dev/null +++ b/SDL/include/SDL_revision.h @@ -0,0 +1,2 @@ +#define SDL_REVISION "hg-7890:c031abe0b287" +#define SDL_REVISION_NUMBER 7890 diff --git a/SDL/include/SDL_rwops.h b/SDL/include/SDL_rwops.h new file mode 100644 index 0000000..d257442 --- /dev/null +++ b/SDL/include/SDL_rwops.h @@ -0,0 +1,232 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_rwops.h + * + * This file provides a general interface for SDL to read and write + * data streams. It can easily be extended to files, memory, etc. + */ + +#ifndef _SDL_rwops_h +#define _SDL_rwops_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* RWops Types */ +#define SDL_RWOPS_UNKNOWN 0 /* Unknown stream type */ +#define SDL_RWOPS_WINFILE 1 /* Win32 file */ +#define SDL_RWOPS_STDFILE 2 /* Stdio file */ +#define SDL_RWOPS_JNIFILE 3 /* Android asset */ +#define SDL_RWOPS_MEMORY 4 /* Memory stream */ +#define SDL_RWOPS_MEMORY_RO 5 /* Read-Only memory stream */ + +/** + * This is the read/write operation structure -- very basic. + */ +typedef struct SDL_RWops +{ + /** + * Return the size of the file in this rwops, or -1 if unknown + */ + Sint64 (SDLCALL * size) (struct SDL_RWops * context); + + /** + * Seek to \c offset relative to \c whence, one of stdio's whence values: + * RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END + * + * \return the final offset in the data stream, or -1 on error. + */ + Sint64 (SDLCALL * seek) (struct SDL_RWops * context, Sint64 offset, + int whence); + + /** + * Read up to \c maxnum objects each of size \c size from the data + * stream to the area pointed at by \c ptr. + * + * \return the number of objects read, or 0 at error or end of file. + */ + size_t (SDLCALL * read) (struct SDL_RWops * context, void *ptr, + size_t size, size_t maxnum); + + /** + * Write exactly \c num objects each of size \c size from the area + * pointed at by \c ptr to data stream. + * + * \return the number of objects written, or 0 at error or end of file. + */ + size_t (SDLCALL * write) (struct SDL_RWops * context, const void *ptr, + size_t size, size_t num); + + /** + * Close and free an allocated SDL_RWops structure. + * + * \return 0 if successful or -1 on write error when flushing data. + */ + int (SDLCALL * close) (struct SDL_RWops * context); + + Uint32 type; + union + { +#if defined(ANDROID) + struct + { + void *fileNameRef; + void *inputStreamRef; + void *readableByteChannelRef; + void *readMethod; + void *assetFileDescriptorRef; + long position; + long size; + long offset; + int fd; + } androidio; +#elif defined(__WIN32__) + struct + { + SDL_bool append; + void *h; + struct + { + void *data; + size_t size; + size_t left; + } buffer; + } windowsio; +#endif + +#ifdef HAVE_STDIO_H + struct + { + SDL_bool autoclose; + FILE *fp; + } stdio; +#endif + struct + { + Uint8 *base; + Uint8 *here; + Uint8 *stop; + } mem; + struct + { + void *data1; + void *data2; + } unknown; + } hidden; + +} SDL_RWops; + + +/** + * \name RWFrom functions + * + * Functions to create SDL_RWops structures from various data streams. + */ +/* @{ */ + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file, + const char *mode); + +#ifdef HAVE_STDIO_H +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(FILE * fp, + SDL_bool autoclose); +#else +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFP(void * fp, + SDL_bool autoclose); +#endif + +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size); +extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem, + int size); + +/* @} *//* RWFrom functions */ + + +extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void); +extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area); + +#define RW_SEEK_SET 0 /**< Seek from the beginning of data */ +#define RW_SEEK_CUR 1 /**< Seek relative to current read point */ +#define RW_SEEK_END 2 /**< Seek relative to the end of data */ + +/** + * \name Read/write macros + * + * Macros to easily read and write from an SDL_RWops structure. + */ +/* @{ */ +#define SDL_RWsize(ctx) (ctx)->size(ctx) +#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence) +#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR) +#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n) +#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n) +#define SDL_RWclose(ctx) (ctx)->close(ctx) +/* @} *//* Read/write macros */ + + +/** + * \name Read endian functions + * + * Read an item of the specified endianness and return in native format. + */ +/* @{ */ +extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src); +extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src); +extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src); +extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src); +/* @} *//* Read endian functions */ + +/** + * \name Write endian functions + * + * Write an item of native format to the specified endianness. + */ +/* @{ */ +extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value); +extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value); +extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value); +/* @} *//* Write endian functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_rwops_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_scancode.h b/SDL/include/SDL_scancode.h new file mode 100644 index 0000000..00b47a3 --- /dev/null +++ b/SDL/include/SDL_scancode.h @@ -0,0 +1,401 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_scancode.h + * + * Defines keyboard scancodes. + */ + +#ifndef _SDL_scancode_h +#define _SDL_scancode_h + +#include "SDL_stdinc.h" + +/** + * \brief The SDL keyboard scancode representation. + * + * Values of this type are used to represent keyboard keys, among other places + * in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the + * SDL_Event structure. + * + * The values in this enumeration are based on the USB usage page standard: + * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf + */ +typedef enum +{ + SDL_SCANCODE_UNKNOWN = 0, + + /** + * \name Usage page 0x07 + * + * These values are from usage page 0x07 (USB keyboard page). + */ + /* @{ */ + + SDL_SCANCODE_A = 4, + SDL_SCANCODE_B = 5, + SDL_SCANCODE_C = 6, + SDL_SCANCODE_D = 7, + SDL_SCANCODE_E = 8, + SDL_SCANCODE_F = 9, + SDL_SCANCODE_G = 10, + SDL_SCANCODE_H = 11, + SDL_SCANCODE_I = 12, + SDL_SCANCODE_J = 13, + SDL_SCANCODE_K = 14, + SDL_SCANCODE_L = 15, + SDL_SCANCODE_M = 16, + SDL_SCANCODE_N = 17, + SDL_SCANCODE_O = 18, + SDL_SCANCODE_P = 19, + SDL_SCANCODE_Q = 20, + SDL_SCANCODE_R = 21, + SDL_SCANCODE_S = 22, + SDL_SCANCODE_T = 23, + SDL_SCANCODE_U = 24, + SDL_SCANCODE_V = 25, + SDL_SCANCODE_W = 26, + SDL_SCANCODE_X = 27, + SDL_SCANCODE_Y = 28, + SDL_SCANCODE_Z = 29, + + SDL_SCANCODE_1 = 30, + SDL_SCANCODE_2 = 31, + SDL_SCANCODE_3 = 32, + SDL_SCANCODE_4 = 33, + SDL_SCANCODE_5 = 34, + SDL_SCANCODE_6 = 35, + SDL_SCANCODE_7 = 36, + SDL_SCANCODE_8 = 37, + SDL_SCANCODE_9 = 38, + SDL_SCANCODE_0 = 39, + + SDL_SCANCODE_RETURN = 40, + SDL_SCANCODE_ESCAPE = 41, + SDL_SCANCODE_BACKSPACE = 42, + SDL_SCANCODE_TAB = 43, + SDL_SCANCODE_SPACE = 44, + + SDL_SCANCODE_MINUS = 45, + SDL_SCANCODE_EQUALS = 46, + SDL_SCANCODE_LEFTBRACKET = 47, + SDL_SCANCODE_RIGHTBRACKET = 48, + SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return + * key on ISO keyboards and at the right end + * of the QWERTY row on ANSI keyboards. + * Produces REVERSE SOLIDUS (backslash) and + * VERTICAL LINE in a US layout, REVERSE + * SOLIDUS and VERTICAL LINE in a UK Mac + * layout, NUMBER SIGN and TILDE in a UK + * Windows layout, DOLLAR SIGN and POUND SIGN + * in a Swiss German layout, NUMBER SIGN and + * APOSTROPHE in a German layout, GRAVE + * ACCENT and POUND SIGN in a French Mac + * layout, and ASTERISK and MICRO SIGN in a + * French Windows layout. + */ + SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code + * instead of 49 for the same key, but all + * OSes I've seen treat the two codes + * identically. So, as an implementor, unless + * your keyboard generates both of those + * codes and your OS treats them differently, + * you should generate SDL_SCANCODE_BACKSLASH + * instead of this code. As a user, you + * should not rely on this code because SDL + * will never generate it with most (all?) + * keyboards. + */ + SDL_SCANCODE_SEMICOLON = 51, + SDL_SCANCODE_APOSTROPHE = 52, + SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI + * and ISO keyboards). Produces GRAVE ACCENT and + * TILDE in a US Windows layout and in US and UK + * Mac layouts on ANSI keyboards, GRAVE ACCENT + * and NOT SIGN in a UK Windows layout, SECTION + * SIGN and PLUS-MINUS SIGN in US and UK Mac + * layouts on ISO keyboards, SECTION SIGN and + * DEGREE SIGN in a Swiss German layout (Mac: + * only on ISO keyboards), CIRCUMFLEX ACCENT and + * DEGREE SIGN in a German layout (Mac: only on + * ISO keyboards), SUPERSCRIPT TWO and TILDE in a + * French Windows layout, COMMERCIAL AT and + * NUMBER SIGN in a French Mac layout on ISO + * keyboards, and LESS-THAN SIGN and GREATER-THAN + * SIGN in a Swiss German, German, or French Mac + * layout on ANSI keyboards. + */ + SDL_SCANCODE_COMMA = 54, + SDL_SCANCODE_PERIOD = 55, + SDL_SCANCODE_SLASH = 56, + + SDL_SCANCODE_CAPSLOCK = 57, + + SDL_SCANCODE_F1 = 58, + SDL_SCANCODE_F2 = 59, + SDL_SCANCODE_F3 = 60, + SDL_SCANCODE_F4 = 61, + SDL_SCANCODE_F5 = 62, + SDL_SCANCODE_F6 = 63, + SDL_SCANCODE_F7 = 64, + SDL_SCANCODE_F8 = 65, + SDL_SCANCODE_F9 = 66, + SDL_SCANCODE_F10 = 67, + SDL_SCANCODE_F11 = 68, + SDL_SCANCODE_F12 = 69, + + SDL_SCANCODE_PRINTSCREEN = 70, + SDL_SCANCODE_SCROLLLOCK = 71, + SDL_SCANCODE_PAUSE = 72, + SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but + does send code 73, not 117) */ + SDL_SCANCODE_HOME = 74, + SDL_SCANCODE_PAGEUP = 75, + SDL_SCANCODE_DELETE = 76, + SDL_SCANCODE_END = 77, + SDL_SCANCODE_PAGEDOWN = 78, + SDL_SCANCODE_RIGHT = 79, + SDL_SCANCODE_LEFT = 80, + SDL_SCANCODE_DOWN = 81, + SDL_SCANCODE_UP = 82, + + SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards + */ + SDL_SCANCODE_KP_DIVIDE = 84, + SDL_SCANCODE_KP_MULTIPLY = 85, + SDL_SCANCODE_KP_MINUS = 86, + SDL_SCANCODE_KP_PLUS = 87, + SDL_SCANCODE_KP_ENTER = 88, + SDL_SCANCODE_KP_1 = 89, + SDL_SCANCODE_KP_2 = 90, + SDL_SCANCODE_KP_3 = 91, + SDL_SCANCODE_KP_4 = 92, + SDL_SCANCODE_KP_5 = 93, + SDL_SCANCODE_KP_6 = 94, + SDL_SCANCODE_KP_7 = 95, + SDL_SCANCODE_KP_8 = 96, + SDL_SCANCODE_KP_9 = 97, + SDL_SCANCODE_KP_0 = 98, + SDL_SCANCODE_KP_PERIOD = 99, + + SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO + * keyboards have over ANSI ones, + * located between left shift and Y. + * Produces GRAVE ACCENT and TILDE in a + * US or UK Mac layout, REVERSE SOLIDUS + * (backslash) and VERTICAL LINE in a + * US or UK Windows layout, and + * LESS-THAN SIGN and GREATER-THAN SIGN + * in a Swiss German, German, or French + * layout. */ + SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */ + SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, + * not a physical key - but some Mac keyboards + * do have a power key. */ + SDL_SCANCODE_KP_EQUALS = 103, + SDL_SCANCODE_F13 = 104, + SDL_SCANCODE_F14 = 105, + SDL_SCANCODE_F15 = 106, + SDL_SCANCODE_F16 = 107, + SDL_SCANCODE_F17 = 108, + SDL_SCANCODE_F18 = 109, + SDL_SCANCODE_F19 = 110, + SDL_SCANCODE_F20 = 111, + SDL_SCANCODE_F21 = 112, + SDL_SCANCODE_F22 = 113, + SDL_SCANCODE_F23 = 114, + SDL_SCANCODE_F24 = 115, + SDL_SCANCODE_EXECUTE = 116, + SDL_SCANCODE_HELP = 117, + SDL_SCANCODE_MENU = 118, + SDL_SCANCODE_SELECT = 119, + SDL_SCANCODE_STOP = 120, + SDL_SCANCODE_AGAIN = 121, /**< redo */ + SDL_SCANCODE_UNDO = 122, + SDL_SCANCODE_CUT = 123, + SDL_SCANCODE_COPY = 124, + SDL_SCANCODE_PASTE = 125, + SDL_SCANCODE_FIND = 126, + SDL_SCANCODE_MUTE = 127, + SDL_SCANCODE_VOLUMEUP = 128, + SDL_SCANCODE_VOLUMEDOWN = 129, +/* not sure whether there's a reason to enable these */ +/* SDL_SCANCODE_LOCKINGCAPSLOCK = 130, */ +/* SDL_SCANCODE_LOCKINGNUMLOCK = 131, */ +/* SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */ + SDL_SCANCODE_KP_COMMA = 133, + SDL_SCANCODE_KP_EQUALSAS400 = 134, + + SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see + footnotes in USB doc */ + SDL_SCANCODE_INTERNATIONAL2 = 136, + SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */ + SDL_SCANCODE_INTERNATIONAL4 = 138, + SDL_SCANCODE_INTERNATIONAL5 = 139, + SDL_SCANCODE_INTERNATIONAL6 = 140, + SDL_SCANCODE_INTERNATIONAL7 = 141, + SDL_SCANCODE_INTERNATIONAL8 = 142, + SDL_SCANCODE_INTERNATIONAL9 = 143, + SDL_SCANCODE_LANG1 = 144, /**< Hangul/English toggle */ + SDL_SCANCODE_LANG2 = 145, /**< Hanja conversion */ + SDL_SCANCODE_LANG3 = 146, /**< Katakana */ + SDL_SCANCODE_LANG4 = 147, /**< Hiragana */ + SDL_SCANCODE_LANG5 = 148, /**< Zenkaku/Hankaku */ + SDL_SCANCODE_LANG6 = 149, /**< reserved */ + SDL_SCANCODE_LANG7 = 150, /**< reserved */ + SDL_SCANCODE_LANG8 = 151, /**< reserved */ + SDL_SCANCODE_LANG9 = 152, /**< reserved */ + + SDL_SCANCODE_ALTERASE = 153, /**< Erase-Eaze */ + SDL_SCANCODE_SYSREQ = 154, + SDL_SCANCODE_CANCEL = 155, + SDL_SCANCODE_CLEAR = 156, + SDL_SCANCODE_PRIOR = 157, + SDL_SCANCODE_RETURN2 = 158, + SDL_SCANCODE_SEPARATOR = 159, + SDL_SCANCODE_OUT = 160, + SDL_SCANCODE_OPER = 161, + SDL_SCANCODE_CLEARAGAIN = 162, + SDL_SCANCODE_CRSEL = 163, + SDL_SCANCODE_EXSEL = 164, + + SDL_SCANCODE_KP_00 = 176, + SDL_SCANCODE_KP_000 = 177, + SDL_SCANCODE_THOUSANDSSEPARATOR = 178, + SDL_SCANCODE_DECIMALSEPARATOR = 179, + SDL_SCANCODE_CURRENCYUNIT = 180, + SDL_SCANCODE_CURRENCYSUBUNIT = 181, + SDL_SCANCODE_KP_LEFTPAREN = 182, + SDL_SCANCODE_KP_RIGHTPAREN = 183, + SDL_SCANCODE_KP_LEFTBRACE = 184, + SDL_SCANCODE_KP_RIGHTBRACE = 185, + SDL_SCANCODE_KP_TAB = 186, + SDL_SCANCODE_KP_BACKSPACE = 187, + SDL_SCANCODE_KP_A = 188, + SDL_SCANCODE_KP_B = 189, + SDL_SCANCODE_KP_C = 190, + SDL_SCANCODE_KP_D = 191, + SDL_SCANCODE_KP_E = 192, + SDL_SCANCODE_KP_F = 193, + SDL_SCANCODE_KP_XOR = 194, + SDL_SCANCODE_KP_POWER = 195, + SDL_SCANCODE_KP_PERCENT = 196, + SDL_SCANCODE_KP_LESS = 197, + SDL_SCANCODE_KP_GREATER = 198, + SDL_SCANCODE_KP_AMPERSAND = 199, + SDL_SCANCODE_KP_DBLAMPERSAND = 200, + SDL_SCANCODE_KP_VERTICALBAR = 201, + SDL_SCANCODE_KP_DBLVERTICALBAR = 202, + SDL_SCANCODE_KP_COLON = 203, + SDL_SCANCODE_KP_HASH = 204, + SDL_SCANCODE_KP_SPACE = 205, + SDL_SCANCODE_KP_AT = 206, + SDL_SCANCODE_KP_EXCLAM = 207, + SDL_SCANCODE_KP_MEMSTORE = 208, + SDL_SCANCODE_KP_MEMRECALL = 209, + SDL_SCANCODE_KP_MEMCLEAR = 210, + SDL_SCANCODE_KP_MEMADD = 211, + SDL_SCANCODE_KP_MEMSUBTRACT = 212, + SDL_SCANCODE_KP_MEMMULTIPLY = 213, + SDL_SCANCODE_KP_MEMDIVIDE = 214, + SDL_SCANCODE_KP_PLUSMINUS = 215, + SDL_SCANCODE_KP_CLEAR = 216, + SDL_SCANCODE_KP_CLEARENTRY = 217, + SDL_SCANCODE_KP_BINARY = 218, + SDL_SCANCODE_KP_OCTAL = 219, + SDL_SCANCODE_KP_DECIMAL = 220, + SDL_SCANCODE_KP_HEXADECIMAL = 221, + + SDL_SCANCODE_LCTRL = 224, + SDL_SCANCODE_LSHIFT = 225, + SDL_SCANCODE_LALT = 226, /**< alt, option */ + SDL_SCANCODE_LGUI = 227, /**< windows, command (apple), meta */ + SDL_SCANCODE_RCTRL = 228, + SDL_SCANCODE_RSHIFT = 229, + SDL_SCANCODE_RALT = 230, /**< alt gr, option */ + SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */ + + SDL_SCANCODE_MODE = 257, /**< I'm not sure if this is really not covered + * by any of the above, but since there's a + * special KMOD_MODE for it I'm adding it here + */ + + /* @} *//* Usage page 0x07 */ + + /** + * \name Usage page 0x0C + * + * These values are mapped from usage page 0x0C (USB consumer page). + */ + /* @{ */ + + SDL_SCANCODE_AUDIONEXT = 258, + SDL_SCANCODE_AUDIOPREV = 259, + SDL_SCANCODE_AUDIOSTOP = 260, + SDL_SCANCODE_AUDIOPLAY = 261, + SDL_SCANCODE_AUDIOMUTE = 262, + SDL_SCANCODE_MEDIASELECT = 263, + SDL_SCANCODE_WWW = 264, + SDL_SCANCODE_MAIL = 265, + SDL_SCANCODE_CALCULATOR = 266, + SDL_SCANCODE_COMPUTER = 267, + SDL_SCANCODE_AC_SEARCH = 268, + SDL_SCANCODE_AC_HOME = 269, + SDL_SCANCODE_AC_BACK = 270, + SDL_SCANCODE_AC_FORWARD = 271, + SDL_SCANCODE_AC_STOP = 272, + SDL_SCANCODE_AC_REFRESH = 273, + SDL_SCANCODE_AC_BOOKMARKS = 274, + + /* @} *//* Usage page 0x0C */ + + /** + * \name Walther keys + * + * These are values that Christian Walther added (for mac keyboard?). + */ + /* @{ */ + + SDL_SCANCODE_BRIGHTNESSDOWN = 275, + SDL_SCANCODE_BRIGHTNESSUP = 276, + SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display + switch, video mode switch */ + SDL_SCANCODE_KBDILLUMTOGGLE = 278, + SDL_SCANCODE_KBDILLUMDOWN = 279, + SDL_SCANCODE_KBDILLUMUP = 280, + SDL_SCANCODE_EJECT = 281, + SDL_SCANCODE_SLEEP = 282, + + SDL_SCANCODE_APP1 = 283, + SDL_SCANCODE_APP2 = 284, + + /* @} *//* Walther keys */ + + /* Add any other keys here. */ + + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes + for array bounds */ +} SDL_Scancode; + +#endif /* _SDL_scancode_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_shape.h b/SDL/include/SDL_shape.h new file mode 100644 index 0000000..63f850c --- /dev/null +++ b/SDL/include/SDL_shape.h @@ -0,0 +1,143 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_shape_h +#define _SDL_shape_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** \file SDL_shape.h + * + * Header file for the shaped window API. + */ + +#define SDL_NONSHAPEABLE_WINDOW -1 +#define SDL_INVALID_SHAPE_ARGUMENT -2 +#define SDL_WINDOW_LACKS_SHAPE -3 + +/** + * \brief Create a window that can be shaped with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of SDL_WINDOW_BORDERLESS with any of the following: + * ::SDL_WINDOW_OPENGL, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_RESIZABLE, + * ::SDL_WINDOW_MAXIMIZED, ::SDL_WINDOW_MINIMIZED, + * ::SDL_WINDOW_BORDERLESS is always set, and ::SDL_WINDOW_FULLSCREEN is always unset. + * + * \return The window created, or NULL if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned int w,unsigned int h,Uint32 flags); + +/** + * \brief Return whether the given window is a shaped window. + * + * \param window The window to query for being shaped. + * + * \return SDL_TRUE if the window is a window that can be shaped, SDL_FALSE if the window is unshaped or NULL. + * \sa SDL_CreateShapedWindow + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsShapedWindow(const SDL_Window *window); + +/** \brief An enum denoting the specific type of contents present in an SDL_WindowShapeParams union. */ +typedef enum { + /** \brief The default mode, a binarized alpha cutoff of 1. */ + ShapeModeDefault, + /** \brief A binarized alpha cutoff with a given integer value. */ + ShapeModeBinarizeAlpha, + /** \brief A binarized alpha cutoff with a given integer value, but with the opposite comparison. */ + ShapeModeReverseBinarizeAlpha, + /** \brief A color key is applied. */ + ShapeModeColorKey +} WindowShapeMode; + +#define SDL_SHAPEMODEALPHA(mode) (mode == ShapeModeDefault || mode == ShapeModeBinarizeAlpha || mode == ShapeModeReverseBinarizeAlpha) + +/** \brief A union containing parameters for shaped windows. */ +typedef union { + /** \brief a cutoff alpha value for binarization of the window shape's alpha channel. */ + Uint8 binarizationCutoff; + SDL_Color colorKey; +} SDL_WindowShapeParams; + +/** \brief A struct that tags the SDL_WindowShapeParams union with an enum describing the type of its contents. */ +typedef struct SDL_WindowShapeMode { + /** \brief The mode of these window-shape parameters. */ + WindowShapeMode mode; + /** \brief Window-shape parameters. */ + SDL_WindowShapeParams parameters; +} SDL_WindowShapeMode; + +/** + * \brief Set the shape and parameters of a shaped window. + * + * \param window The shaped window whose parameters should be set. + * \param shape A surface encoding the desired shape for the window. + * \param shape_mode The parameters to set for the shaped window. + * + * \return 0 on success, SDL_INVALID_SHAPE_ARGUMENT on invalid an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW + * if the SDL_Window* given does not reference a valid shaped window. + * + * \sa SDL_WindowShapeMode + * \sa SDL_GetShapedWindowMode. + */ +extern DECLSPEC int SDLCALL SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); + +/** + * \brief Get the shape parameters of a shaped window. + * + * \param window The shaped window whose parameters should be retrieved. + * \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape. + * + * \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode + * data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not a shaped window, or SDL_WINDOW_LACKS_SHAPE if + * the SDL_Window* given is a shapeable window currently lacking a shape. + * + * \sa SDL_WindowShapeMode + * \sa SDL_SetWindowShape + */ +extern DECLSPEC int SDLCALL SDL_GetShapedWindowMode(SDL_Window *window,SDL_WindowShapeMode *shape_mode); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_shape_h */ diff --git a/SDL/include/SDL_stdinc.h b/SDL/include/SDL_stdinc.h new file mode 100644 index 0000000..8f17d55 --- /dev/null +++ b/SDL/include/SDL_stdinc.h @@ -0,0 +1,392 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_stdinc.h + * + * This is a general header that includes C language support. + */ + +#ifndef _SDL_stdinc_h +#define _SDL_stdinc_h + +#include "SDL_config.h" + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_STDIO_H +#include +#endif +#if defined(STDC_HEADERS) +# include +# include +# include +#else +# if defined(HAVE_STDLIB_H) +# include +# elif defined(HAVE_MALLOC_H) +# include +# endif +# if defined(HAVE_STDDEF_H) +# include +# endif +# if defined(HAVE_STDARG_H) +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H) +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#if defined(HAVE_INTTYPES_H) +# include +#elif defined(HAVE_STDINT_H) +# include +#endif +#ifdef HAVE_CTYPE_H +# include +#endif +#ifdef HAVE_MATH_H +# include +#endif +#if defined(HAVE_ICONV) && defined(HAVE_ICONV_H) +# include +#endif + +/** + * The number of elements in an array. + */ +#define SDL_arraysize(array) (sizeof(array)/sizeof(array[0])) +#define SDL_TABLESIZE(table) SDL_arraysize(table) + +/** + * \name Cast operators + * + * Use proper C++ casts when compiled as C++ to be compatible with the option + * -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above). + */ +/* @{ */ +#ifdef __cplusplus +#define SDL_reinterpret_cast(type, expression) reinterpret_cast(expression) +#define SDL_static_cast(type, expression) static_cast(expression) +#define SDL_const_cast(type, expression) const_cast(expression) +#else +#define SDL_reinterpret_cast(type, expression) ((type)(expression)) +#define SDL_static_cast(type, expression) ((type)(expression)) +#define SDL_const_cast(type, expression) ((type)(expression)) +#endif +/* @} *//* Cast operators */ + +/* Define a four character code as a Uint32 */ +#define SDL_FOURCC(A, B, C, D) \ + ((SDL_static_cast(Uint32, SDL_static_cast(Uint8, (A))) << 0) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (B))) << 8) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ + (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) + +/** + * \name Basic data types + */ +/* @{ */ + +typedef enum +{ + SDL_FALSE = 0, + SDL_TRUE = 1 +} SDL_bool; + +/** + * \brief A signed 8-bit integer type. + */ +typedef int8_t Sint8; +/** + * \brief An unsigned 8-bit integer type. + */ +typedef uint8_t Uint8; +/** + * \brief A signed 16-bit integer type. + */ +typedef int16_t Sint16; +/** + * \brief An unsigned 16-bit integer type. + */ +typedef uint16_t Uint16; +/** + * \brief A signed 32-bit integer type. + */ +typedef int32_t Sint32; +/** + * \brief An unsigned 32-bit integer type. + */ +typedef uint32_t Uint32; + +/** + * \brief A signed 64-bit integer type. + */ +typedef int64_t Sint64; +/** + * \brief An unsigned 64-bit integer type. + */ +typedef uint64_t Uint64; + +/* @} *//* Basic data types */ + + +#define SDL_COMPILE_TIME_ASSERT(name, x) \ + typedef int SDL_dummy_ ## name[(x) * 2 - 1] +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +SDL_COMPILE_TIME_ASSERT(uint8, sizeof(Uint8) == 1); +SDL_COMPILE_TIME_ASSERT(sint8, sizeof(Sint8) == 1); +SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2); +SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2); +SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4); +SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4); +SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8); +SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8); +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +/* Check to make sure enums are the size of ints, for structure packing. + For both Watcom C/C++ and Borland C/C++ the compiler option that makes + enums having the size of an int must be enabled. + This is "-b" for Borland C/C++ and "-ei" for Watcom C/C++ (v11). +*/ + +/** \cond */ +#ifndef DOXYGEN_SHOULD_IGNORE_THIS +#if !defined(__ANDROID__) + /* TODO: include/SDL_stdinc.h:174: error: size of array 'SDL_dummy_enum' is negative */ +typedef enum +{ + DUMMY_ENUM_VALUE +} SDL_DUMMY_ENUM; + +SDL_COMPILE_TIME_ASSERT(enum, sizeof(SDL_DUMMY_ENUM) == sizeof(int)); +#endif +#endif /* DOXYGEN_SHOULD_IGNORE_THIS */ +/** \endcond */ + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(HAVE_ALLOCA) && !defined(alloca) +# if defined(HAVE_ALLOCA_H) +# include +# elif defined(__GNUC__) +# define alloca __builtin_alloca +# elif defined(_MSC_VER) +# include +# define alloca _alloca +# elif defined(__WATCOMC__) +# include +# elif defined(__BORLANDC__) +# include +# elif defined(__DMC__) +# include +# elif defined(__AIX__) +#pragma alloca +# elif defined(__MRC__) +void *alloca(unsigned); +# else +char *alloca(); +# endif +#endif +#ifdef HAVE_ALLOCA +#define SDL_stack_alloc(type, count) (type*)alloca(sizeof(type)*(count)) +#define SDL_stack_free(data) +#else +#define SDL_stack_alloc(type, count) (type*)SDL_malloc(sizeof(type)*(count)) +#define SDL_stack_free(data) SDL_free(data) +#endif + +extern DECLSPEC void *SDLCALL SDL_malloc(size_t size); +extern DECLSPEC void *SDLCALL SDL_calloc(size_t nmemb, size_t size); +extern DECLSPEC void *SDLCALL SDL_realloc(void *mem, size_t size); +extern DECLSPEC void SDLCALL SDL_free(void *mem); + +extern DECLSPEC char *SDLCALL SDL_getenv(const char *name); +extern DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); + +extern DECLSPEC void SDLCALL SDL_qsort(void *base, size_t nmemb, size_t size, int (*compare) (const void *, const void *)); + +extern DECLSPEC int SDLCALL SDL_abs(int x); + +/* !!! FIXME: these have side effects. You probably shouldn't use them. */ +/* !!! FIXME: Maybe we do forceinline functions of SDL_mini, SDL_minf, etc? */ +#define SDL_min(x, y) (((x) < (y)) ? (x) : (y)) +#define SDL_max(x, y) (((x) > (y)) ? (x) : (y)) + +extern DECLSPEC int SDLCALL SDL_isdigit(int x); +extern DECLSPEC int SDLCALL SDL_isspace(int x); +extern DECLSPEC int SDLCALL SDL_toupper(int x); +extern DECLSPEC int SDLCALL SDL_tolower(int x); + +extern DECLSPEC void *SDLCALL SDL_memset(void *dst, int c, size_t len); + +#define SDL_zero(x) SDL_memset(&(x), 0, sizeof((x))) +#define SDL_zerop(x) SDL_memset((x), 0, sizeof(*(x))) + +/* Note that memset() is a byte assignment and this is a 32-bit assignment, so they're not directly equivalent. */ +SDL_FORCE_INLINE void SDL_memset4(void *dst, int val, size_t dwords) +{ +#if defined(__GNUC__) && defined(i386) + int u0, u1, u2; + __asm__ __volatile__ ( + "cld \n\t" + "rep ; stosl \n\t" + : "=&D" (u0), "=&a" (u1), "=&c" (u2) + : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, dwords)) + : "memory" + ); +#else + size_t _n = (dwords + 3) / 4; + Uint32 *_p = SDL_static_cast(Uint32 *, dst); + Uint32 _val = (val); + if (dwords == 0) + return; + switch (dwords % 4) + { + case 0: do { *_p++ = _val; + case 3: *_p++ = _val; + case 2: *_p++ = _val; + case 1: *_p++ = _val; + } while ( --_n ); + } +#endif +} + + +extern DECLSPEC void *SDLCALL SDL_memcpy(void *dst, const void *src, size_t len); + +SDL_FORCE_INLINE void *SDL_memcpy4(void *dst, const void *src, size_t dwords) +{ + return SDL_memcpy(dst, src, dwords * 4); +} + +extern DECLSPEC void *SDLCALL SDL_memmove(void *dst, const void *src, size_t len); +extern DECLSPEC int SDLCALL SDL_memcmp(const void *s1, const void *s2, size_t len); + +extern DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); +extern DECLSPEC size_t SDLCALL SDL_wcslcpy(wchar_t *dst, const wchar_t *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_wcslcat(wchar_t *dst, const wchar_t *src, size_t maxlen); + +extern DECLSPEC size_t SDLCALL SDL_strlen(const char *str); +extern DECLSPEC size_t SDLCALL SDL_strlcpy(char *dst, const char *src, size_t maxlen); +extern DECLSPEC size_t SDLCALL SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes); +extern DECLSPEC size_t SDLCALL SDL_strlcat(char *dst, const char *src, size_t maxlen); +extern DECLSPEC char *SDLCALL SDL_strdup(const char *str); +extern DECLSPEC char *SDLCALL SDL_strrev(char *str); +extern DECLSPEC char *SDLCALL SDL_strupr(char *str); +extern DECLSPEC char *SDLCALL SDL_strlwr(char *str); +extern DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); +extern DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); + +extern DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); +extern DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); + +extern DECLSPEC int SDLCALL SDL_atoi(const char *str); +extern DECLSPEC double SDLCALL SDL_atof(const char *str); +extern DECLSPEC long SDLCALL SDL_strtol(const char *str, char **endp, int base); +extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *str, char **endp, int base); +extern DECLSPEC Sint64 SDLCALL SDL_strtoll(const char *str, char **endp, int base); +extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *str, char **endp, int base); +extern DECLSPEC double SDLCALL SDL_strtod(const char *str, char **endp); + +extern DECLSPEC int SDLCALL SDL_strcmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncmp(const char *str1, const char *str2, size_t maxlen); +extern DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str2); +extern DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t len); + +extern DECLSPEC int SDLCALL SDL_sscanf(const char *text, const char *fmt, ...); +extern DECLSPEC int SDLCALL SDL_snprintf(char *text, size_t maxlen, const char *fmt, ...); +extern DECLSPEC int SDLCALL SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap); + +#ifndef HAVE_M_PI +#ifndef M_PI +#define M_PI 3.14159265358979323846264338327950288 /* pi */ +#endif +#endif + +extern DECLSPEC double SDLCALL SDL_atan(double x); +extern DECLSPEC double SDLCALL SDL_atan2(double x, double y); +extern DECLSPEC double SDLCALL SDL_ceil(double x); +extern DECLSPEC double SDLCALL SDL_copysign(double x, double y); +extern DECLSPEC double SDLCALL SDL_cos(double x); +extern DECLSPEC float SDLCALL SDL_cosf(float x); +extern DECLSPEC double SDLCALL SDL_fabs(double x); +extern DECLSPEC double SDLCALL SDL_floor(double x); +extern DECLSPEC double SDLCALL SDL_log(double x); +extern DECLSPEC double SDLCALL SDL_pow(double x, double y); +extern DECLSPEC double SDLCALL SDL_scalbn(double x, int n); +extern DECLSPEC double SDLCALL SDL_sin(double x); +extern DECLSPEC float SDLCALL SDL_sinf(float x); +extern DECLSPEC double SDLCALL SDL_sqrt(double x); + +/* The SDL implementation of iconv() returns these error codes */ +#define SDL_ICONV_ERROR (size_t)-1 +#define SDL_ICONV_E2BIG (size_t)-2 +#define SDL_ICONV_EILSEQ (size_t)-3 +#define SDL_ICONV_EINVAL (size_t)-4 + +/* SDL_iconv_* are now always real symbols/types, not macros or inlined. */ +typedef struct _SDL_iconv_t *SDL_iconv_t; +extern DECLSPEC SDL_iconv_t SDLCALL SDL_iconv_open(const char *tocode, + const char *fromcode); +extern DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd); +extern DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, + size_t * inbytesleft, char **outbuf, + size_t * outbytesleft); +/** + * This function converts a string between encodings in one pass, returning a + * string that must be freed with SDL_free() or NULL on error. + */ +extern DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, + const char *fromcode, + const char *inbuf, + size_t inbytesleft); +#define SDL_iconv_utf8_locale(S) SDL_iconv_string("", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs2(S) (Uint16 *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) +#define SDL_iconv_utf8_ucs4(S) (Uint32 *)SDL_iconv_string("UCS-4-INTERNAL", "UTF-8", S, SDL_strlen(S)+1) + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_stdinc_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_surface.h b/SDL/include/SDL_surface.h new file mode 100644 index 0000000..e18153a --- /dev/null +++ b/SDL/include/SDL_surface.h @@ -0,0 +1,503 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_surface.h + * + * Header file for ::SDL_Surface definition and management functions. + */ + +#ifndef _SDL_surface_h +#define _SDL_surface_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_blendmode.h" +#include "SDL_rwops.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \name Surface flags + * + * These are the currently supported flags for the ::SDL_Surface. + * + * \internal + * Used internally (read-only). + */ +/* @{ */ +#define SDL_SWSURFACE 0 /**< Just here for compatibility */ +#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */ +#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */ +#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */ +/* @} *//* Surface flags */ + +/** + * Evaluates to true if the surface needs to be locked before access. + */ +#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) + +/** + * \brief A collection of pixels used in software blitting. + * + * \note This structure should be treated as read-only, except for \c pixels, + * which, if not NULL, contains the raw pixel data for the surface. + */ +typedef struct SDL_Surface +{ + Uint32 flags; /**< Read-only */ + SDL_PixelFormat *format; /**< Read-only */ + int w, h; /**< Read-only */ + int pitch; /**< Read-only */ + void *pixels; /**< Read-write */ + + /** Application data associated with the surface */ + void *userdata; /**< Read-write */ + + /** information needed for surfaces requiring locks */ + int locked; /**< Read-only */ + void *lock_data; /**< Read-only */ + + /** clipping information */ + SDL_Rect clip_rect; /**< Read-only */ + + /** info for fast blit mapping to other surfaces */ + struct SDL_BlitMap *map; /**< Private */ + + /** Reference count -- used when freeing surface */ + int refcount; /**< Read-mostly */ +} SDL_Surface; + +/** + * \brief The type of function used for surface blitting functions. + */ +typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, + struct SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * Allocate and free an RGB surface. + * + * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. + * If the depth is greater than 8 bits, the pixel format is set using the + * flags '[RGB]mask'. + * + * If the function runs out of memory, it will return NULL. + * + * \param flags The \c flags are obsolete and should be set to 0. + * \param width The width in pixels of the surface to create. + * \param height The height in pixels of the surface to create. + * \param depth The depth in bits of the surface to create. + * \param Rmask The red mask of the surface to create. + * \param Gmask The green mask of the surface to create. + * \param Bmask The blue mask of the surface to create. + * \param Amask The alpha mask of the surface to create. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface + (Uint32 flags, int width, int height, int depth, + Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); +extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, + int width, + int height, + int depth, + int pitch, + Uint32 Rmask, + Uint32 Gmask, + Uint32 Bmask, + Uint32 Amask); +extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface * surface); + +/** + * \brief Set the palette used by a surface. + * + * \return 0, or -1 if the surface format doesn't use a palette. + * + * \note A single palette can be shared with many surfaces. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, + SDL_Palette * palette); + +/** + * \brief Sets up a surface for directly accessing the pixels. + * + * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write + * to and read from \c surface->pixels, using the pixel format stored in + * \c surface->format. Once you are done accessing the surface, you should + * use SDL_UnlockSurface() to release it. + * + * Not all surfaces require locking. If SDL_MUSTLOCK(surface) evaluates + * to 0, then you can read and write to the surface at any time, and the + * pixel format of the surface will not change. + * + * No operating system or library calls should be made between lock/unlock + * pairs, as critical system locks may be held during this time. + * + * SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked. + * + * \sa SDL_UnlockSurface() + */ +extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface); +/** \sa SDL_LockSurface() */ +extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface); + +/** + * Load a surface from a seekable SDL data stream (memory or file). + * + * If \c freesrc is non-zero, the stream will be closed after being read. + * + * The new surface should be freed with SDL_FreeSurface(). + * + * \return the new surface, or NULL if there was an error. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src, + int freesrc); + +/** + * Load a surface from a file. + * + * Convenience macro. + */ +#define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1) + +/** + * Save a surface to a seekable SDL data stream (memory or file). + * + * If \c freedst is non-zero, the stream will be closed after being written. + * + * \return 0 if successful or -1 if there was an error. + */ +extern DECLSPEC int SDLCALL SDL_SaveBMP_RW + (SDL_Surface * surface, SDL_RWops * dst, int freedst); + +/** + * Save a surface to a file. + * + * Convenience macro. + */ +#define SDL_SaveBMP(surface, file) \ + SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1) + +/** + * \brief Sets the RLE acceleration hint for a surface. + * + * \return 0 on success, or -1 if the surface is not valid + * + * \note If RLE is enabled, colorkey and alpha blending blits are much faster, + * but the surface must be locked before directly accessing the pixels. + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, + int flag); + +/** + * \brief Sets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param flag Non-zero to enable colorkey and 0 to disable colorkey + * \param key The transparent pixel in the native surface format + * + * \return 0 on success, or -1 if the surface is not valid + * + * You can pass SDL_RLEACCEL to enable RLE accelerated blits. + */ +extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, + int flag, Uint32 key); + +/** + * \brief Gets the color key (transparent pixel) in a blittable surface. + * + * \param surface The surface to update + * \param key A pointer filled in with the transparent pixel in the native + * surface format + * + * \return 0 on success, or -1 if the surface is not valid or colorkey is not + * enabled. + */ +extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, + Uint32 * key); + +/** + * \brief Set an additional color value used in blit operations. + * + * \param surface The surface to update. + * \param r The red color value multiplied into blit operations. + * \param g The green color value multiplied into blit operations. + * \param b The blue color value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface, + Uint8 r, Uint8 g, Uint8 b); + + +/** + * \brief Get the additional color value used in blit operations. + * + * \param surface The surface to query. + * \param r A pointer filled in with the current red color value. + * \param g A pointer filled in with the current green color value. + * \param b A pointer filled in with the current blue color value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceColorMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface, + Uint8 * r, Uint8 * g, + Uint8 * b); + +/** + * \brief Set an additional alpha value used in blit operations. + * + * \param surface The surface to update. + * \param alpha The alpha value multiplied into blit operations. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_GetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 alpha); + +/** + * \brief Get the additional alpha value used in blit operations. + * + * \param surface The surface to query. + * \param alpha A pointer filled in with the current alpha value. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceAlphaMod() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface, + Uint8 * alpha); + +/** + * \brief Set the blend mode used for blit operations. + * + * \param surface The surface to update. + * \param blendMode ::SDL_BlendMode to use for blit blending. + * + * \return 0 on success, or -1 if the parameters are not valid. + * + * \sa SDL_GetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode blendMode); + +/** + * \brief Get the blend mode used for blit operations. + * + * \param surface The surface to query. + * \param blendMode A pointer filled in with the current blend mode. + * + * \return 0 on success, or -1 if the surface is not valid. + * + * \sa SDL_SetSurfaceBlendMode() + */ +extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, + SDL_BlendMode *blendMode); + +/** + * Sets the clipping rectangle for the destination surface in a blit. + * + * If the clip rectangle is NULL, clipping will be disabled. + * + * If the clip rectangle doesn't intersect the surface, the function will + * return SDL_FALSE and blits will be completely clipped. Otherwise the + * function returns SDL_TRUE and blits to the surface will be clipped to + * the intersection of the surface area and the clipping rectangle. + * + * Note that blits are automatically clipped to the edges of the source + * and destination surfaces. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface * surface, + const SDL_Rect * rect); + +/** + * Gets the clipping rectangle for the destination surface in a blit. + * + * \c rect must be a pointer to a valid rectangle which will be filled + * with the correct values. + */ +extern DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface * surface, + SDL_Rect * rect); + +/** + * Creates a new surface of the specified format, and then copies and maps + * the given surface to it so the blit of the converted surface will be as + * fast as possible. If this function fails, it returns NULL. + * + * The \c flags parameter is passed to SDL_CreateRGBSurface() and has those + * semantics. You can also pass ::SDL_RLEACCEL in the flags parameter and + * SDL will try to RLE accelerate colorkey and alpha blits in the resulting + * surface. + */ +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface + (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags); +extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat + (SDL_Surface * src, Uint32 pixel_format, Uint32 flags); + +/** + * \brief Copy a block of pixels of one format to another format + * + * \return 0 on success, or -1 if there was an error + */ +extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, + Uint32 src_format, + const void * src, int src_pitch, + Uint32 dst_format, + void * dst, int dst_pitch); + +/** + * Performs a fast fill of the given rectangle with \c color. + * + * If \c rect is NULL, the whole surface will be filled with \c color. + * + * The color should be a pixel of the format used by the surface, and + * can be generated by the SDL_MapRGB() function. + * + * \return 0 on success, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_FillRect + (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color); +extern DECLSPEC int SDLCALL SDL_FillRects + (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color); + +/** + * Performs a fast blit from the source surface to the destination surface. + * + * This assumes that the source and destination rectangles are + * the same size. If either \c srcrect or \c dstrect are NULL, the entire + * surface (\c src or \c dst) is copied. The final blit rectangles are saved + * in \c srcrect and \c dstrect after all clipping is performed. + * + * \return If the blit is successful, it returns 0, otherwise it returns -1. + * + * The blit function should not be called on a locked surface. + * + * The blit semantics for surfaces with and without blending and colorkey + * are defined as follows: + * \verbatim + RGBA->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB, set destination alpha to source per-surface alpha value. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + + RGBA->RGBA: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source alpha-channel and per-surface alpha) + SDL_SRCCOLORKEY ignored. + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy all of RGBA to the destination. + if SDL_SRCCOLORKEY set, only copy the pixels matching the + RGB values of the source color key, ignoring alpha in the + comparison. + + RGB->RGB: + Source surface blend mode set to SDL_BLENDMODE_BLEND: + alpha-blend (using the source per-surface alpha) + Source surface blend mode set to SDL_BLENDMODE_NONE: + copy RGB. + both: + if SDL_SRCCOLORKEY set, only copy the pixels matching the + source color key. + \endverbatim + * + * You should call SDL_BlitSurface() unless you know exactly how SDL + * blitting works internally and how to use the other blit functions. + */ +#define SDL_BlitSurface SDL_UpperBlit + +/** + * This is the public blit function, SDL_BlitSurface(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlit() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlit + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlit + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * \brief Perform a fast, low quality, stretch blit between two surfaces of the + * same pixel format. + * + * \note This function uses a static buffer, and is not thread-safe. + */ +extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src, + const SDL_Rect * srcrect, + SDL_Surface * dst, + const SDL_Rect * dstrect); + +#define SDL_BlitScaled SDL_UpperBlitScaled + +/** + * This is the public scaled blit function, SDL_BlitScaled(), and it performs + * rectangle validation and clipping before passing it to SDL_LowerBlitScaled() + */ +extern DECLSPEC int SDLCALL SDL_UpperBlitScaled + (SDL_Surface * src, const SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + +/** + * This is a semi-private blit function and it performs low-level surface + * scaled blitting only. + */ +extern DECLSPEC int SDLCALL SDL_LowerBlitScaled + (SDL_Surface * src, SDL_Rect * srcrect, + SDL_Surface * dst, SDL_Rect * dstrect); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_surface_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_system.h b/SDL/include/SDL_system.h new file mode 100644 index 0000000..9af2a4c --- /dev/null +++ b/SDL/include/SDL_system.h @@ -0,0 +1,121 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_system.h + * + * Include file for platform specific SDL API functions + */ + +#ifndef _SDL_system_h +#define _SDL_system_h + +#include "SDL_stdinc.h" +#include "SDL_keyboard.h" +#include "SDL_render.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* Platform specific functions for Windows */ +#ifdef __WIN32__ + +/* Returns the D3D9 adapter index that matches the specified display index. + This adapter index can be passed to IDirect3D9::CreateDevice and controls + on which monitor a full screen application will appear. +*/ +extern DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex( int displayIndex ); + +/* Returns the D3D device associated with a renderer, or NULL if it's not a D3D renderer. + Once you are done using the device, you should release it to avoid a resource leak. + */ +typedef struct IDirect3DDevice9 IDirect3DDevice9; +extern DECLSPEC IDirect3DDevice9* SDLCALL SDL_RenderGetD3D9Device(SDL_Renderer * renderer); + +#endif /* __WIN32__ */ + + +/* Platform specific functions for iOS */ +#if defined(__IPHONEOS__) && __IPHONEOS__ + +extern DECLSPEC int SDLCALL SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam); +extern DECLSPEC void SDLCALL SDL_iPhoneSetEventPump(SDL_bool enabled); + +#endif /* __IPHONEOS__ */ + + +/* Platform specific functions for Android */ +#if defined(__ANDROID__) && __ANDROID__ + +/* Get the JNI environment for the current thread + This returns JNIEnv*, but the prototype is void* so we don't need jni.h + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(); + +/* Get the SDL Activity object for the application + This returns jobject, but the prototype is void* so we don't need jni.h + The jobject returned by SDL_AndroidGetActivity is a local reference. + It is the caller's responsibility to properly release it + (using env->Push/PopLocalFrame or manually with env->DeleteLocalRef) + */ +extern DECLSPEC void * SDLCALL SDL_AndroidGetActivity(); + +/* See the official Android developer guide for more information: + http://developer.android.com/guide/topics/data/data-storage.html +*/ +#define SDL_ANDROID_EXTERNAL_STORAGE_READ 0x01 +#define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 + +/* Get the path used for internal storage for this application. + This path is unique to your application and cannot be written to + by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetInternalStoragePath(); + +/* Get the current state of external storage, a bitmask of these values: + SDL_ANDROID_EXTERNAL_STORAGE_READ + SDL_ANDROID_EXTERNAL_STORAGE_WRITE + If external storage is currently unavailable, this will return 0. +*/ +extern DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(); + +/* Get the path used for external storage for this application. + This path is unique to your application, but is public and can be + written to by other applications. + */ +extern DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(); + +#endif /* __ANDROID__ */ + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_system_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_syswm.h b/SDL/include/SDL_syswm.h new file mode 100644 index 0000000..5e4454f --- /dev/null +++ b/SDL/include/SDL_syswm.h @@ -0,0 +1,237 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_syswm.h + * + * Include file for SDL custom system window manager hooks. + */ + +#ifndef _SDL_syswm_h +#define _SDL_syswm_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" +#include "SDL_version.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \file SDL_syswm.h + * + * Your application has access to a special type of event ::SDL_SYSWMEVENT, + * which contains window-manager specific information and arrives whenever + * an unhandled window event occurs. This event is ignored by default, but + * you can enable it with SDL_EventState(). + */ +#ifdef SDL_PROTOTYPES_ONLY +struct SDL_SysWMinfo; +#else + +#if defined(SDL_VIDEO_DRIVER_WINDOWS) +#define WIN32_LEAN_AND_MEAN +#include +#endif + +/* This is the structure for custom window manager events */ +#if defined(SDL_VIDEO_DRIVER_X11) +#if defined(__APPLE__) && defined(__MACH__) +/* conflicts with Quickdraw.h */ +#define Cursor X11Cursor +#endif + +#include +#include + +#if defined(__APPLE__) && defined(__MACH__) +/* matches the re-define above */ +#undef Cursor +#endif + +#endif /* defined(SDL_VIDEO_DRIVER_X11) */ + +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) +#include +#endif + +#if defined(SDL_VIDEO_DRIVER_COCOA) +#ifdef __OBJC__ +#include +#else +typedef struct _NSWindow NSWindow; +#endif +#endif + +#if defined(SDL_VIDEO_DRIVER_UIKIT) +#ifdef __OBJC__ +#include +#else +typedef struct _UIWindow UIWindow; +#endif +#endif + +/** + * These are the various supported windowing subsystems + */ +typedef enum +{ + SDL_SYSWM_UNKNOWN, + SDL_SYSWM_WINDOWS, + SDL_SYSWM_X11, + SDL_SYSWM_DIRECTFB, + SDL_SYSWM_COCOA, + SDL_SYSWM_UIKIT, +} SDL_SYSWM_TYPE; + +/** + * The custom event structure. + */ +struct SDL_SysWMmsg +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct { + HWND hwnd; /**< The window for the message */ + UINT msg; /**< The type of message */ + WPARAM wParam; /**< WORD message parameter */ + LPARAM lParam; /**< LONG message parameter */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct { + XEvent event; + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct { + DFBEvent event; + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + /* No Cocoa window events yet */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + /* No UIKit window events yet */ + } uikit; +#endif + /* Can't have an empty union */ + int dummy; + } msg; +}; + +/** + * The custom window manager information structure. + * + * When this structure is returned, it holds information about which + * low level system it is using, and will be one of SDL_SYSWM_TYPE. + */ +struct SDL_SysWMinfo +{ + SDL_version version; + SDL_SYSWM_TYPE subsystem; + union + { +#if defined(SDL_VIDEO_DRIVER_WINDOWS) + struct + { + HWND window; /**< The window handle */ + } win; +#endif +#if defined(SDL_VIDEO_DRIVER_X11) + struct + { + Display *display; /**< The X11 display */ + Window window; /**< The X11 window */ + } x11; +#endif +#if defined(SDL_VIDEO_DRIVER_DIRECTFB) + struct + { + IDirectFB *dfb; /**< The directfb main interface */ + IDirectFBWindow *window; /**< The directfb window handle */ + IDirectFBSurface *surface; /**< The directfb client surface */ + } dfb; +#endif +#if defined(SDL_VIDEO_DRIVER_COCOA) + struct + { + NSWindow *window; /* The Cocoa window */ + } cocoa; +#endif +#if defined(SDL_VIDEO_DRIVER_UIKIT) + struct + { + UIWindow *window; /* The UIKit window */ + } uikit; +#endif + /* Can't have an empty union */ + int dummy; + } info; +}; + +#endif /* SDL_PROTOTYPES_ONLY */ + +typedef struct SDL_SysWMinfo SDL_SysWMinfo; + +/* Function prototypes */ +/** + * \brief This function allows access to driver-dependent window information. + * + * \param window The window about which information is being requested + * \param info This structure must be initialized with the SDL version, and is + * then filled in with information about the given window. + * + * \return SDL_TRUE if the function is implemented and the version member of + * the \c info struct is valid, SDL_FALSE otherwise. + * + * You typically use this function like this: + * \code + * SDL_SysWMinfo info; + * SDL_VERSION(&info.version); + * if ( SDL_GetWindowWMInfo(window, &info) ) { ... } + * \endcode + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window, + SDL_SysWMinfo * info); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_syswm_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test.h b/SDL/include/SDL_test.h new file mode 100644 index 0000000..7e0de08 --- /dev/null +++ b/SDL/include/SDL_test.h @@ -0,0 +1,68 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef _SDL_test_h +#define _SDL_test_h + +#include "SDL.h" +#include "SDL_test_common.h" +#include "SDL_test_font.h" +#include "SDL_test_random.h" +#include "SDL_test_fuzzer.h" +#include "SDL_test_crc32.h" +#include "SDL_test_md5.h" +#include "SDL_test_log.h" +#include "SDL_test_assert.h" +#include "SDL_test_harness.h" +#include "SDL_test_images.h" +#include "SDL_test_compare.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Global definitions */ + +/* + * Note: Maximum size of SDLTest log message is less than SDLs limit + * to ensure we can fit additional information such as the timestamp. + */ +#define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_assert.h b/SDL/include/SDL_test_assert.h new file mode 100644 index 0000000..beba16f --- /dev/null +++ b/SDL/include/SDL_test_assert.h @@ -0,0 +1,105 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_assert.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Assert API for test code and test cases + * + */ + +#ifndef _SDL_test_assert_h +#define _SDL_test_assert_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Fails the assert. + */ +#define ASSERT_FAIL 0 + +/** + * \brief Passes the assert. + */ +#define ASSERT_PASS 1 + +/** + * \brief Assert that logs and break execution flow on failures. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_Assert(int assertCondition, const char *assertDescription, ...); + +/** + * \brief Assert for test cases that logs but does not break execution flow on failures. Updates assertion counters. + * + * \param assertCondition Evaluated condition or variable to assert; fail (==0) or pass (!=0). + * \param assertDescription Message to log with the assert describing it. + * + * \returns Returns the assertCondition so it can be used to externally to break execution flow if desired. + */ +int SDLTest_AssertCheck(int assertCondition, const char *assertDescription, ...); + +/** + * \brief Explicitely pass without checking an assertion condition. Updates assertion counter. + * + * \param assertDescription Message to log with the assert describing it. + */ +void SDLTest_AssertPass(const char *assertDescription, ...); + +/** + * \brief Resets the assert summary counters to zero. + */ +void SDLTest_ResetAssertSummary(); + +/** + * \brief Logs summary of all assertions (total, pass, fail) since last reset as INFO or ERROR. + */ +void SDLTest_LogAssertSummary(); + + +/** + * \brief Converts the current assert summary state to a test result. + * + * \returns TEST_RESULT_PASSED, TEST_RESULT_FAILED, or TEST_RESULT_NO_ASSERT + */ +int SDLTest_AssertSummaryToTestResult(); + +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_assert_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_common.h b/SDL/include/SDL_test_common.h new file mode 100644 index 0000000..57f3114 --- /dev/null +++ b/SDL/include/SDL_test_common.h @@ -0,0 +1,187 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_common.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* Ported from original test\common.h file. */ + +#ifndef _SDL_test_common_h +#define _SDL_test_common_h + +#include "SDL.h" + +#if defined(__PSP__) +#define DEFAULT_WINDOW_WIDTH 480 +#define DEFAULT_WINDOW_HEIGHT 272 +#else +#define DEFAULT_WINDOW_WIDTH 640 +#define DEFAULT_WINDOW_HEIGHT 480 +#endif + +#define VERBOSE_VIDEO 0x00000001 +#define VERBOSE_MODES 0x00000002 +#define VERBOSE_RENDER 0x00000004 +#define VERBOSE_EVENT 0x00000008 +#define VERBOSE_AUDIO 0x00000010 + +typedef struct +{ + /* SDL init flags */ + char **argv; + Uint32 flags; + Uint32 verbose; + + /* Video info */ + const char *videodriver; + int display; + const char *window_title; + const char *window_icon; + Uint32 window_flags; + int window_x; + int window_y; + int window_w; + int window_h; + int window_minW; + int window_minH; + int window_maxW; + int window_maxH; + int logical_w; + int logical_h; + float scale; + int depth; + int refresh_rate; + int num_windows; + SDL_Window **windows; + + /* Renderer info */ + const char *renderdriver; + Uint32 render_flags; + SDL_bool skip_renderer; + SDL_Renderer **renderers; + + /* Audio info */ + const char *audiodriver; + SDL_AudioSpec audiospec; + + /* GL settings */ + int gl_red_size; + int gl_green_size; + int gl_blue_size; + int gl_alpha_size; + int gl_buffer_size; + int gl_depth_size; + int gl_stencil_size; + int gl_double_buffer; + int gl_accum_red_size; + int gl_accum_green_size; + int gl_accum_blue_size; + int gl_accum_alpha_size; + int gl_stereo; + int gl_multisamplebuffers; + int gl_multisamplesamples; + int gl_retained_backing; + int gl_accelerated; + int gl_major_version; + int gl_minor_version; + int gl_debug; + int gl_profile_mask; +} SDLTest_CommonState; + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Parse command line parameters and create common state. + * + * \param argv Array of command line parameters + * \param flags Flags indicating which subsystem to initialize (i.e. SDL_INIT_VIDEO | SDL_INIT_AUDIO) + * + * \returns Returns a newly allocated common state object. + */ +SDLTest_CommonState *SDLTest_CommonCreateState(char **argv, Uint32 flags); + +/** + * \brief Process one common argument. + * + * \param state The common state describing the test window to create. + * \param index The index of the argument to process in argv[]. + * + * \returns The number of arguments processed (i.e. 1 for --fullscreen, 2 for --video [videodriver], or -1 on error. + */ +int SDLTest_CommonArg(SDLTest_CommonState * state, int index); + +/** + * \brief Returns common usage information + * + * \param state The common state describing the test window to create. + * + * \returns String with usage information + */ +const char *SDLTest_CommonUsage(SDLTest_CommonState * state); + +/** + * \brief Open test window. + * + * \param state The common state describing the test window to create. + * + * \returns True if initialization succeeded, false otherwise + */ +SDL_bool SDLTest_CommonInit(SDLTest_CommonState * state); + +/** + * \brief Common event handler for test windows. + * + * \param state The common state used to create test window. + * \param event The event to handle. + * \param done Flag indicating we are done. + * + */ +void SDLTest_CommonEvent(SDLTest_CommonState * state, SDL_Event * event, int *done); + +/** + * \brief Close test window. + * + * \param state The common state used to create test window. + * + */ +void SDLTest_CommonQuit(SDLTest_CommonState * state); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_common_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_compare.h b/SDL/include/SDL_test_compare.h new file mode 100644 index 0000000..98ca8ce --- /dev/null +++ b/SDL/include/SDL_test_compare.h @@ -0,0 +1,69 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_compare.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines comparison functions (i.e. for surfaces). + +*/ + +#ifndef _SDL_test_compare_h +#define _SDL_test_compare_h + +#include "SDL.h" + +#include "SDL_test_images.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Compares a surface and with reference image data for equality + * + * \param surface Surface used in comparison + * \param referenceSurface Test Surface used in comparison + * \param allowable_error Allowable difference (squared) in blending accuracy. + * + * \returns 0 if comparison succeeded, >0 (=number of pixels where comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. + */ +int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_compare_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_crc32.h b/SDL/include/SDL_test_crc32.h new file mode 100644 index 0000000..f0a84a4 --- /dev/null +++ b/SDL/include/SDL_test_crc32.h @@ -0,0 +1,124 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_crc32.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Implements CRC32 calculations (default output is Perl String::CRC32 compatible). + +*/ + +#ifndef _SDL_test_crc32_h +#define _SDL_test_crc32_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ------------ Definitions --------- */ + +/* Definition shared by all CRC routines */ + +#ifndef CrcUint32 + #define CrcUint32 unsigned int +#endif +#ifndef CrcUint8 + #define CrcUint8 unsigned char +#endif + +#ifdef ORIGINAL_METHOD + #define CRC32_POLY 0x04c11db7 /* AUTODIN II, Ethernet, & FDDI */ +#else + #define CRC32_POLY 0xEDB88320 /* Perl String::CRC32 compatible */ +#endif + +/** + * Data structure for CRC32 (checksum) computation + */ + typedef struct { + CrcUint32 crc32_table[256]; /* CRC table */ + } SDLTest_Crc32Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * /brief Initialize the CRC context + * + * Note: The function initializes the crc table required for all crc calculations. + * + * /param crcContext pointer to context variable + * + * /returns 0 for OK, -1 on error + * + */ + int SDLTest_Crc32Init(SDLTest_Crc32Context * crcContext); + + +/** + * /brief calculate a crc32 from a data block + * + * /param crcContext pointer to context variable + * /param inBuf input buffer to checksum + * /param inLen length of input buffer + * /param crc32 pointer to Uint32 to store the final CRC into + * + * /returns 0 for OK, -1 on error + * + */ +int SDLTest_crc32Calc(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + +/* Same routine broken down into three steps */ +int SDLTest_Crc32CalcStart(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcEnd(SDLTest_Crc32Context * crcContext, CrcUint32 *crc32); +int SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context * crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32); + + +/** + * /brief clean up CRC context + * + * /param crcContext pointer to context variable + * + * /returns 0 for OK, -1 on error + * +*/ + +int SDLTest_Crc32Done(SDLTest_Crc32Context * crcContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_crc32_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_font.h b/SDL/include/SDL_test_font.h new file mode 100644 index 0000000..aa9286b --- /dev/null +++ b/SDL/include/SDL_test_font.h @@ -0,0 +1,62 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_font.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +#ifndef _SDL_test_font_h +#define _SDL_test_font_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Function prototypes */ + +/** + * \brief Draw a string in the currently set font. + * + * \param renderer The renderer to draw on. + * \param x The X coordinate of the upper left corner of the string. + * \param y The Y coordinate of the upper left corner of the string. + * \param s The string to draw. + * + * \returns Returns 0 on success, -1 on failure. + */ +int SDLTest_DrawString(SDL_Renderer * renderer, int x, int y, const char *s); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_font_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_fuzzer.h b/SDL/include/SDL_test_fuzzer.h new file mode 100644 index 0000000..a528ddc --- /dev/null +++ b/SDL/include/SDL_test_fuzzer.h @@ -0,0 +1,384 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_fuzzer.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Data generators for fuzzing test data in a reproducible way. + +*/ + +#ifndef _SDL_test_fuzzer_h +#define _SDL_test_fuzzer_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* + Based on GSOC code by Markus Kauppila +*/ + + +/** + * \file + * Note: The fuzzer implementation uses a static instance of random context + * internally which makes it thread-UNsafe. + */ + +/** + * Initializes the fuzzer for a test + * + * /param execKey Execution "Key" that initializes the random number generator uniquely for the test. + * + */ +void SDLTest_FuzzerInit(Uint64 execKey); + + +/** + * Returns a random Uint8 + * + * \returns Generated integer + */ +Uint8 SDLTest_RandomUint8(); + +/** + * Returns a random Sint8 + * + * \returns Generated signed integer + */ +Sint8 SDLTest_RandomSint8(); + + +/** + * Returns a random Uint16 + * + * \returns Generated integer + */ +Uint16 SDLTest_RandomUint16(); + +/** + * Returns a random Sint16 + * + * \returns Generated signed integer + */ +Sint16 SDLTest_RandomSint16(); + + +/** + * Returns a random integer + * + * \returns Generated integer + */ +Sint32 SDLTest_RandomSint32(); + + +/** + * Returns a random positive integer + * + * \returns Generated integer + */ +Uint32 SDLTest_RandomUint32(); + +/** + * Returns random Uint64. + * + * \returns Generated integer + */ +Uint64 SDLTest_RandomUint64(); + + +/** + * Returns random Sint64. + * + * \returns Generated signed integer + */ +Sint64 SDLTest_RandomSint64(); + +/** + * \returns random float in range [0.0 - 1.0[ + */ +float SDLTest_RandomUnitFloat(); + +/** + * \returns random double in range [0.0 - 1.0[ + */ +double SDLTest_RandomUnitDouble(); + +/** + * \returns random float. + * + */ +float SDLTest_RandomFloat(); + +/** + * \returns random double. + * + */ +double SDLTest_RandomDouble(); + +/** + * Returns a random boundary value for Uint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint8BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint8BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint8BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint8BoundaryValue(0, 255, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint16BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint16BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint16BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint16BoundaryValue(0, 0xFFFF, SDL_FALSE) returns 0 (error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint32BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint32BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint32BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint32BoundaryValue(0, 0xFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Uint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomUint64BoundaryValue(10, 20, SDL_TRUE) returns 10, 11, 19 or 20 + * RandomUint64BoundaryValue(1, 20, SDL_FALSE) returns 0 or 21 + * RandomUint64BoundaryValue(0, 99, SDL_FALSE) returns 100 + * RandomUint64BoundaryValue(0, 0xFFFFFFFFFFFFFFFF, SDL_FALSE) returns 0 (with error set) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or 0 with error set + */ +Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint8 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint8BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint8BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint8BoundaryValue(SINT8_MIN, 99, SDL_FALSE) returns 100 + * RandomSint8BoundaryValue(SINT8_MIN, SINT8_MAX, SDL_FALSE) returns SINT8_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT8_MIN with error set + */ +Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain); + + +/** + * Returns a random boundary value for Sint16 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint16BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint16BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint16BoundaryValue(SINT16_MIN, 99, SDL_FALSE) returns 100 + * RandomSint16BoundaryValue(SINT16_MIN, SINT16_MAX, SDL_FALSE) returns SINT16_MIN (== error value) with error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT16_MIN with error set + */ +Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint32 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint32BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint32BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint32BoundaryValue(SINT32_MIN, 99, SDL_FALSE) returns 100 + * RandomSint32BoundaryValue(SINT32_MIN, SINT32_MAX, SDL_FALSE) returns SINT32_MIN (== error value) + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT32_MIN with error set + */ +Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain); + +/** + * Returns a random boundary value for Sint64 within the given boundaries. + * Boundaries are inclusive, see the usage examples below. If validDomain + * is true, the function will only return valid boundaries, otherwise non-valid + * boundaries are also possible. + * If boundary1 > boundary2, the values are swapped + * + * Usage examples: + * RandomSint64BoundaryValue(-10, 20, SDL_TRUE) returns -11, -10, 19 or 20 + * RandomSint64BoundaryValue(-100, -10, SDL_FALSE) returns -101 or -9 + * RandomSint64BoundaryValue(SINT64_MIN, 99, SDL_FALSE) returns 100 + * RandomSint64BoundaryValue(SINT64_MIN, SINT64_MAX, SDL_FALSE) returns SINT64_MIN (== error value) and error set + * + * \param boundary1 Lower boundary limit + * \param boundary2 Upper boundary limit + * \param validDomain Should the generated boundary be valid (=within the bounds) or not? + * + * \returns Random boundary value for the given range and domain or SINT64_MIN with error set + */ +Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain); + + +/** + * Returns integer in range [min, max] (inclusive). + * Min and max values can be negative values. + * If Max in smaller tham min, then the values are swapped. + * Min and max are the same value, that value will be returned. + * + * \param min Minimum inclusive value of returned random number + * \param max Maximum inclusive value of returned random number + * + * \returns Generated random integer in range + */ +Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max); + + +/** + * Generates random null-terminated string. The minimum length for + * the string is 1 character, maximum length for the string is 255 + * characters and it can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \returns Newly allocated random string; or NULL if length was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiString(); + + +/** + * Generates random null-terminated string. The maximum length for + * the string is defined by the maxLength parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param maxLength The maximum length of the generated string. + * + * \returns Newly allocated random string; or NULL if maxLength was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringWithMaximumLength(int maxLength); + + +/** + * Generates random null-terminated string. The length for + * the string is defined by the size parameter. + * String can contain ASCII characters from 32 to 126. + * + * Note: Returned string needs to be deallocated. + * + * \param size The length of the generated string + * + * \returns Newly allocated random string; or NULL if size was invalid or string could not be allocated. + */ +char * SDLTest_RandomAsciiStringOfSize(int size); + +/** + * Returns the invocation count for the fuzzer since last ...FuzzerInit. + */ +int SDLTest_GetFuzzerInvocationCount(); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_fuzzer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_harness.h b/SDL/include/SDL_test_harness.h new file mode 100644 index 0000000..935038e --- /dev/null +++ b/SDL/include/SDL_test_harness.h @@ -0,0 +1,123 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_harness.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + Defines types for test case definitions and the test execution harness API. + + Based on original GSOC code by Markus Kauppila +*/ + +#ifndef _SDL_test_harness_h +#define _SDL_test_harness_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + + +/* ! Definitions for test case structures */ +#define TEST_ENABLED 1 +#define TEST_DISABLED 0 + +/* ! Definition of all the possible test return values of the test case method */ +#define TEST_ABORTED -1 +#define TEST_STARTED 0 +#define TEST_COMPLETED 1 +#define TEST_SKIPPED 2 + +/* ! Definition of all the possible test results for the harness */ +#define TEST_RESULT_PASSED 0 +#define TEST_RESULT_FAILED 1 +#define TEST_RESULT_NO_ASSERT 2 +#define TEST_RESULT_SKIPPED 3 +#define TEST_RESULT_SETUP_FAILURE 4 + +/* !< Function pointer to a test case setup function (run before every test) */ +typedef void (*SDLTest_TestCaseSetUpFp)(void *arg); + +/* !< Function pointer to a test case function */ +typedef int (*SDLTest_TestCaseFp)(void *arg); + +/* !< Function pointer to a test case teardown function (run after every test) */ +typedef void (*SDLTest_TestCaseTearDownFp)(void *arg); + +/** + * Holds information about a single test case. + */ +typedef struct SDLTest_TestCaseReference { + /* !< Func2Stress */ + SDLTest_TestCaseFp testCase; + /* !< Short name (or function name) "Func2Stress" */ + char *name; + /* !< Long name or full description "This test pushes func2() to the limit." */ + char *description; + /* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */ + int enabled; +} SDLTest_TestCaseReference; + +/** + * Holds information about a test suite (multiple test cases). + */ +typedef struct SDLTest_TestSuiteReference { + /* !< "PlatformSuite" */ + char *name; + /* !< The function that is run before each test. NULL skips. */ + SDLTest_TestCaseSetUpFp testSetUp; + /* !< The test cases that are run as part of the suite. Last item should be NULL. */ + const SDLTest_TestCaseReference **testCases; + /* !< The function that is run after each test. NULL skips. */ + SDLTest_TestCaseTearDownFp testTearDown; +} SDLTest_TestSuiteReference; + + +/** + * \brief Execute a test suite using the given run seed and execution key. + * + * \param testSuites Suites containing the test case. + * \param userRunSeed Custom run seed provided by user, or NULL to autogenerate one. + * \param userExecKey Custom execution key provided by user, or 0 to autogenerate one. + * \param filter Filter specification. NULL disables. Case sensitive. + * \param testIterations Number of iterations to run each test case. + * + * \returns Test run result; 0 when all tests passed, 1 if any tests failed. + */ +int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *userRunSeed, Uint64 userExecKey, const char *filter, int testIterations); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_harness_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_images.h b/SDL/include/SDL_test_images.h new file mode 100644 index 0000000..21cf39f --- /dev/null +++ b/SDL/include/SDL_test_images.h @@ -0,0 +1,78 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_images.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + Defines some images for tests. + +*/ + +#ifndef _SDL_test_images_h +#define _SDL_test_images_h + +#include "SDL.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + *Type for test images. + */ +typedef struct SDLTest_SurfaceImage_s { + int width; + int height; + unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ + const char *pixel_data; +} SDLTest_SurfaceImage_t; + +/* Test images */ +SDL_Surface *SDLTest_ImageBlit(); +SDL_Surface *SDLTest_ImageBlitColor(); +SDL_Surface *SDLTest_ImageBlitAlpha(); +SDL_Surface *SDLTest_ImageBlitBlendAdd(); +SDL_Surface *SDLTest_ImageBlitBlend(); +SDL_Surface *SDLTest_ImageBlitBlendMod(); +SDL_Surface *SDLTest_ImageBlitBlendNone(); +SDL_Surface *SDLTest_ImageBlitBlendAll(); +SDL_Surface *SDLTest_ImageFace(); +SDL_Surface *SDLTest_ImagePrimitives(); +SDL_Surface *SDLTest_ImagePrimitivesBlend(); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_images_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_log.h b/SDL/include/SDL_test_log.h new file mode 100644 index 0000000..a581d2e --- /dev/null +++ b/SDL/include/SDL_test_log.h @@ -0,0 +1,67 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_log.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + * + * Wrapper to log in the TEST category + * + */ + +#ifndef _SDL_test_log_h +#define _SDL_test_log_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Prints given message with a timestamp in the TEST category and INFO priority. + * + * \param fmt Message to be logged + */ +void SDLTest_Log(const char *fmt, ...); + +/** + * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. + * + * \param fmt Message to be logged + */ +void SDLTest_LogError(const char *fmt, ...); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_log_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_md5.h b/SDL/include/SDL_test_md5.h new file mode 100644 index 0000000..b0d4b7b --- /dev/null +++ b/SDL/include/SDL_test_md5.h @@ -0,0 +1,129 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_md5.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + *********************************************************************** + ** Header file for implementation of MD5 ** + ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** + ** Created: 2/17/90 RLR ** + ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** + ** Revised (for MD5): RLR 4/27/91 ** + ** -- G modified to have y&~z instead of y&z ** + ** -- FF, GG, HH modified to add in last register done ** + ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** + ** -- distinct additive constant for each step ** + ** -- round 4 added, working mod 7 ** + *********************************************************************** +*/ + +/* + *********************************************************************** + ** Message-digest routines: ** + ** To form the message digest for a message M ** + ** (1) Initialize a context buffer mdContext using MD5Init ** + ** (2) Call MD5Update on mdContext and M ** + ** (3) Call MD5Final on mdContext ** + ** The message digest is now in mdContext->digest[0...15] ** + *********************************************************************** +*/ + +#ifndef _SDL_test_md5_h +#define _SDL_test_md5_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------ Definitions --------- */ + +/* typedef a 32-bit type */ + typedef unsigned long int MD5UINT4; + +/* Data structure for MD5 (Message-Digest) computation */ + typedef struct { + MD5UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ + MD5UINT4 buf[4]; /* scratch buffer */ + unsigned char in[64]; /* input buffer */ + unsigned char digest[16]; /* actual digest after Md5Final call */ + } SDLTest_Md5Context; + +/* ---------- Function Prototypes ------------- */ + +/** + * /brief initialize the context + * + * /param mdContext pointer to context variable + * + * Note: The function initializes the message-digest context + * mdContext. Call before each new use of the context - + * all fields are set to zero. + */ + void SDLTest_Md5Init(SDLTest_Md5Context * mdContext); + + +/** + * /brief update digest from variable length data + * + * /param mdContext pointer to context variable + * /param inBuf pointer to data array/string + * /param inLen length of data array/string + * + * Note: The function updates the message-digest context to account + * for the presence of each of the characters inBuf[0..inLen-1] + * in the message whose digest is being computed. +*/ + + void SDLTest_Md5Update(SDLTest_Md5Context * mdContext, unsigned char *inBuf, + unsigned int inLen); + + +/* + * /brief complete digest computation + * + * /param mdContext pointer to context variable + * + * Note: The function terminates the message-digest computation and + * ends with the desired message digest in mdContext.digest[0..15]. + * Always call before using the digest[] variable. +*/ + + void SDLTest_Md5Final(SDLTest_Md5Context * mdContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_md5_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_test_random.h b/SDL/include/SDL_test_random.h new file mode 100644 index 0000000..ce6192c --- /dev/null +++ b/SDL/include/SDL_test_random.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_test_random.h + * + * Include file for SDL test framework. + * + * This code is a part of the SDL2_test library, not the main SDL library. + */ + +/* + + A "32-bit Multiply with carry random number generator. Very fast. + Includes a list of recommended multipliers. + + multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. + period: (a*2^31)-1 + +*/ + +#ifndef _SDL_test_random_h +#define _SDL_test_random_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* --- Definitions */ + +/* + * Macros that return a random number in a specific format. + */ +#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) + +/* + * Context structure for the random number generator state. + */ + typedef struct { + unsigned int a; + unsigned int x; + unsigned int c; + unsigned int ah; + unsigned int al; + } SDLTest_RandomContext; + + +/* --- Function prototypes */ + +/** + * \brief Initialize random number generator with two integers. + * + * Note: The random sequence of numbers returned by ...Random() is the + * same for the same two integers and has a period of 2^31. + * + * \param rndContext pointer to context structure + * \param xi integer that defines the random sequence + * \param ci integer that defines the random sequence + * + */ + void SDLTest_RandomInit(SDLTest_RandomContext * rndContext, unsigned int xi, + unsigned int ci); + +/** + * \brief Initialize random number generator based on current system time. + * + * \param rndContext pointer to context structure + * + */ + void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); + + +/** + * \brief Initialize random number generator based on current system time. + * + * Note: ...RandomInit() or ...RandomInitTime() must have been called + * before using this function. + * + * \param rndContext pointer to context structure + * + * \returns A random number (32bit unsigned integer) + * + */ + unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_test_random_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_thread.h b/SDL/include/SDL_thread.h new file mode 100644 index 0000000..f248c3d --- /dev/null +++ b/SDL/include/SDL_thread.h @@ -0,0 +1,242 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_thread_h +#define _SDL_thread_h + +/** + * \file SDL_thread.h + * + * Header for the SDL thread management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +/* Thread synchronization primitives */ +#include "SDL_atomic.h" +#include "SDL_mutex.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* The SDL thread structure, defined in SDL_thread.c */ +struct SDL_Thread; +typedef struct SDL_Thread SDL_Thread; + +/* The SDL thread ID */ +typedef unsigned long SDL_threadID; + +/* Thread local storage ID, 0 is the invalid ID */ +typedef unsigned int SDL_TLSID; + +/** + * The SDL thread priority. + * + * \note On many systems you require special privileges to set high priority. + */ +typedef enum { + SDL_THREAD_PRIORITY_LOW, + SDL_THREAD_PRIORITY_NORMAL, + SDL_THREAD_PRIORITY_HIGH +} SDL_ThreadPriority; + +/** + * The function passed to SDL_CreateThread(). + * It is passed a void* user context parameter and returns an int. + */ +typedef int (SDLCALL * SDL_ThreadFunction) (void *data); + +#if defined(__WIN32__) && !defined(HAVE_LIBC) +/** + * \file SDL_thread.h + * + * We compile SDL into a DLL. This means, that it's the DLL which + * creates a new thread for the calling process with the SDL_CreateThread() + * API. There is a problem with this, that only the RTL of the SDL.DLL will + * be initialized for those threads, and not the RTL of the calling + * application! + * + * To solve this, we make a little hack here. + * + * We'll always use the caller's _beginthread() and _endthread() APIs to + * start a new thread. This way, if it's the SDL.DLL which uses this API, + * then the RTL of SDL.DLL will be used to create the new thread, and if it's + * the application, then the RTL of the application will be used. + * + * So, in short: + * Always use the _beginthread() and _endthread() of the calling runtime + * library! + */ +#define SDL_PASSED_BEGINTHREAD_ENDTHREAD +#include /* This has _beginthread() and _endthread() defined! */ + +typedef uintptr_t(__cdecl * pfnSDL_CurrentBeginThread) (void *, unsigned, + unsigned (__stdcall * + func) (void + *), + void *arg, unsigned, + unsigned *threadID); +typedef void (__cdecl * pfnSDL_CurrentEndThread) (unsigned code); + +/** + * Create a thread. + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data, + pfnSDL_CurrentBeginThread pfnBeginThread, + pfnSDL_CurrentEndThread pfnEndThread); + +/** + * Create a thread. + */ +#define SDL_CreateThread(fn, name, data) SDL_CreateThread(fn, name, data, (pfnSDL_CurrentBeginThread)_beginthreadex, (pfnSDL_CurrentEndThread)_endthreadex) + +#else + +/** + * Create a thread. + * + * Thread naming is a little complicated: Most systems have very small + * limits for the string length (BeOS has 32 bytes, Linux currently has 16, + * Visual C++ 6.0 has nine!), and possibly other arbitrary rules. You'll + * have to see what happens with your system's debugger. The name should be + * UTF-8 (but using the naming limits of C identifiers is a better bet). + * There are no requirements for thread naming conventions, so long as the + * string is null-terminated UTF-8, but these guidelines are helpful in + * choosing a name: + * + * http://stackoverflow.com/questions/149932/naming-conventions-for-threads + * + * If a system imposes requirements, SDL will try to munge the string for + * it (truncate, etc), but the original string contents will be available + * from SDL_GetThreadName(). + */ +extern DECLSPEC SDL_Thread *SDLCALL +SDL_CreateThread(SDL_ThreadFunction fn, const char *name, void *data); + +#endif + +/** + * Get the thread name, as it was specified in SDL_CreateThread(). + * This function returns a pointer to a UTF-8 string that names the + * specified thread, or NULL if it doesn't have a name. This is internal + * memory, not to be free()'d by the caller, and remains valid until the + * specified thread is cleaned up by SDL_WaitThread(). + */ +extern DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); + +/** + * Get the thread identifier for the current thread. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_ThreadID(void); + +/** + * Get the thread identifier for the specified thread. + * + * Equivalent to SDL_ThreadID() if the specified thread is NULL. + */ +extern DECLSPEC SDL_threadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); + +/** + * Set the priority for the current thread + */ +extern DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priority); + +/** + * Wait for a thread to finish. + * + * The return code for the thread function is placed in the area + * pointed to by \c status, if \c status is not NULL. + */ +extern DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); + +/** + * \brief Create an identifier that is globally visible to all threads but refers to data that is thread-specific. + * + * \return The newly created thread local storage identifier, or 0 on error + * + * \code + * static SDL_SpinLock tls_lock; + * static SDL_TLSID thread_local_storage; + * + * void SetMyThreadData(void *value) + * { + * if (!thread_local_storage) { + * SDL_AtomicLock(&tls_lock); + * if (!thread_local_storage) { + * thread_local_storage = SDL_TLSCreate(); + * } + * SDL_AtomicUnLock(&tls_lock); + * } + * SDL_TLSSet(thread_local_storage, value); + * } + * + * void *GetMyThreadData(void) + * { + * return SDL_TLSGet(thread_local_storage); + * } + * \endcode + * + * \sa SDL_TLSGet() + * \sa SDL_TLSSet() + */ +extern DECLSPEC SDL_TLSID SDLCALL SDL_TLSCreate(void); + +/** + * \brief Get the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * + * \return The value associated with the ID for the current thread, or NULL if no value has been set. + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSSet() + */ +extern DECLSPEC void * SDLCALL SDL_TLSGet(SDL_TLSID id); + +/** + * \brief Set the value associated with a thread local storage ID for the current thread. + * + * \param id The thread local storage ID + * \param value The value to associate with the ID for the current thread + * \param destructor A function called when the thread exits, to free the value. + * + * \return 0 on success, -1 on error + * + * \sa SDL_TLSCreate() + * \sa SDL_TLSGet() + */ +extern DECLSPEC int SDLCALL SDL_TLSSet(SDL_TLSID id, const void *value, void (*destructor)(void*)); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_thread_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_timer.h b/SDL/include/SDL_timer.h new file mode 100644 index 0000000..28ab415 --- /dev/null +++ b/SDL/include/SDL_timer.h @@ -0,0 +1,115 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef _SDL_timer_h +#define _SDL_timer_h + +/** + * \file SDL_timer.h + * + * Header for the SDL time management routines. + */ + +#include "SDL_stdinc.h" +#include "SDL_error.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Get the number of milliseconds since the SDL library initialization. + * + * \note This value wraps if the program runs for more than ~49 days. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); + +/** + * \brief Compare SDL ticks values, and return true if A has passed B + * + * e.g. if you want to wait 100 ms, you could do this: + * Uint32 timeout = SDL_GetTicks() + 100; + * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { + * ... do work until timeout has elapsed + * } + */ +#define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) + +/** + * \brief Get the current value of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); + +/** + * \brief Get the count per second of the high resolution counter + */ +extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); + +/** + * \brief Wait a specified number of milliseconds before returning. + */ +extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); + +/** + * Function prototype for the timer callback function. + * + * The callback function is passed the current timer interval and returns + * the next timer interval. If the returned value is the same as the one + * passed in, the periodic alarm continues, otherwise a new alarm is + * scheduled. If the callback returns 0, the periodic alarm is cancelled. + */ +typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); + +/** + * Definition of the timer ID type. + */ +typedef int SDL_TimerID; + +/** + * \brief Add a new timer to the pool of timers already running. + * + * \return A timer ID, or NULL when an error occurs. + */ +extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, + SDL_TimerCallback callback, + void *param); + +/** + * \brief Remove a timer knowing its ID. + * + * \return A boolean value indicating success or failure. + * + * \warning It is not safe to remove a timer multiple times. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_timer_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_touch.h b/SDL/include/SDL_touch.h new file mode 100644 index 0000000..9e6d7c6 --- /dev/null +++ b/SDL/include/SDL_touch.h @@ -0,0 +1,86 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_touch.h + * + * Include file for SDL touch event handling. + */ + +#ifndef _SDL_touch_h +#define _SDL_touch_h + +#include "SDL_stdinc.h" +#include "SDL_error.h" +#include "SDL_video.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +typedef Sint64 SDL_TouchID; +typedef Sint64 SDL_FingerID; + +typedef struct SDL_Finger +{ + SDL_FingerID id; + float x; + float y; + float pressure; +} SDL_Finger; + +/* Used as the device ID for mouse events simulated with touch input */ +#define SDL_TOUCH_MOUSEID ((Uint32)-1) + + +/* Function prototypes */ + +/** + * \brief Get the number of registered touch devices. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); + +/** + * \brief Get the touch ID with the given index, or 0 if the index is invalid. + */ +extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); + +/** + * \brief Get the number of active fingers for a given touch device. + */ +extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); + +/** + * \brief Get the finger object of the given touch, with the given index. + */ +extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_touch_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_ttf.h b/SDL/include/SDL_ttf.h new file mode 100644 index 0000000..1c7a801 --- /dev/null +++ b/SDL/include/SDL_ttf.h @@ -0,0 +1,263 @@ +/* + SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts + Copyright (C) 2001-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* This library is a wrapper around the excellent FreeType 2.0 library, + available at: + http://www.freetype.org/ +*/ + +#ifndef _SDL_TTF_H +#define _SDL_TTF_H + +#include "SDL.h" +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_TTF_MAJOR_VERSION 2 +#define SDL_TTF_MINOR_VERSION 0 +#define SDL_TTF_PATCHLEVEL 12 + +/* This macro can be used to fill a version structure with the compile-time + * version of the SDL_ttf library. + */ +#define SDL_TTF_VERSION(X) \ +{ \ + (X)->major = SDL_TTF_MAJOR_VERSION; \ + (X)->minor = SDL_TTF_MINOR_VERSION; \ + (X)->patch = SDL_TTF_PATCHLEVEL; \ +} + +/* Backwards compatibility */ +#define TTF_MAJOR_VERSION SDL_TTF_MAJOR_VERSION +#define TTF_MINOR_VERSION SDL_TTF_MINOR_VERSION +#define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL +#define TTF_VERSION(X) SDL_TTF_VERSION(X) + +/* This function gets the version of the dynamically linked SDL_ttf library. + it should NOT be used to fill a version structure, instead you should + use the SDL_TTF_VERSION() macro. + */ +extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void); + +/* ZERO WIDTH NO-BREAKSPACE (Unicode byte order mark) */ +#define UNICODE_BOM_NATIVE 0xFEFF +#define UNICODE_BOM_SWAPPED 0xFFFE + +/* This function tells the library whether UNICODE text is generally + byteswapped. A UNICODE BOM character in a string will override + this setting for the remainder of that string. +*/ +extern DECLSPEC void SDLCALL TTF_ByteSwappedUNICODE(int swapped); + +/* The internal structure containing font information */ +typedef struct _TTF_Font TTF_Font; + +/* Initialize the TTF engine - returns 0 if successful, -1 on error */ +extern DECLSPEC int SDLCALL TTF_Init(void); + +/* Open a font file and create a font of the specified point size. + * Some .fon fonts will have several sizes embedded in the file, so the + * point size becomes the index of choosing which size. If the value + * is too high, the last indexed size will be the default. */ +extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFont(const char *file, int ptsize); +extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndex(const char *file, int ptsize, long index); +extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontRW(SDL_RWops *src, int freesrc, int ptsize); +extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexRW(SDL_RWops *src, int freesrc, int ptsize, long index); + +/* Set and retrieve the font style */ +#define TTF_STYLE_NORMAL 0x00 +#define TTF_STYLE_BOLD 0x01 +#define TTF_STYLE_ITALIC 0x02 +#define TTF_STYLE_UNDERLINE 0x04 +#define TTF_STYLE_STRIKETHROUGH 0x08 +extern DECLSPEC int SDLCALL TTF_GetFontStyle(const TTF_Font *font); +extern DECLSPEC void SDLCALL TTF_SetFontStyle(TTF_Font *font, int style); +extern DECLSPEC int SDLCALL TTF_GetFontOutline(const TTF_Font *font); +extern DECLSPEC void SDLCALL TTF_SetFontOutline(TTF_Font *font, int outline); + +/* Set and retrieve FreeType hinter settings */ +#define TTF_HINTING_NORMAL 0 +#define TTF_HINTING_LIGHT 1 +#define TTF_HINTING_MONO 2 +#define TTF_HINTING_NONE 3 +extern DECLSPEC int SDLCALL TTF_GetFontHinting(const TTF_Font *font); +extern DECLSPEC void SDLCALL TTF_SetFontHinting(TTF_Font *font, int hinting); + +/* Get the total height of the font - usually equal to point size */ +extern DECLSPEC int SDLCALL TTF_FontHeight(const TTF_Font *font); + +/* Get the offset from the baseline to the top of the font + This is a positive value, relative to the baseline. + */ +extern DECLSPEC int SDLCALL TTF_FontAscent(const TTF_Font *font); + +/* Get the offset from the baseline to the bottom of the font + This is a negative value, relative to the baseline. + */ +extern DECLSPEC int SDLCALL TTF_FontDescent(const TTF_Font *font); + +/* Get the recommended spacing between lines of text for this font */ +extern DECLSPEC int SDLCALL TTF_FontLineSkip(const TTF_Font *font); + +/* Get/Set whether or not kerning is allowed for this font */ +extern DECLSPEC int SDLCALL TTF_GetFontKerning(const TTF_Font *font); +extern DECLSPEC void SDLCALL TTF_SetFontKerning(TTF_Font *font, int allowed); + +/* Get the number of faces of the font */ +extern DECLSPEC long SDLCALL TTF_FontFaces(const TTF_Font *font); + +/* Get the font face attributes, if any */ +extern DECLSPEC int SDLCALL TTF_FontFaceIsFixedWidth(const TTF_Font *font); +extern DECLSPEC char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font); +extern DECLSPEC char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font); + +/* Check wether a glyph is provided by the font or not */ +extern DECLSPEC int SDLCALL TTF_GlyphIsProvided(const TTF_Font *font, Uint16 ch); + +/* Get the metrics (dimensions) of a glyph + To understand what these metrics mean, here is a useful link: + http://freetype.sourceforge.net/freetype2/docs/tutorial/step2.html + */ +extern DECLSPEC int SDLCALL TTF_GlyphMetrics(TTF_Font *font, Uint16 ch, + int *minx, int *maxx, + int *miny, int *maxy, int *advance); + +/* Get the dimensions of a rendered string of text */ +extern DECLSPEC int SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int *w, int *h); +extern DECLSPEC int SDLCALL TTF_SizeUTF8(TTF_Font *font, const char *text, int *w, int *h); +extern DECLSPEC int SDLCALL TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, int *w, int *h); + +/* Create an 8-bit palettized surface and render the given text at + fast quality with the given font and color. The 0 pixel is the + colorkey, giving a transparent background, and the 1 pixel is set + to the text color. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Solid(TTF_Font *font, + const char *text, SDL_Color fg); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid(TTF_Font *font, + const char *text, SDL_Color fg); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid(TTF_Font *font, + const Uint16 *text, SDL_Color fg); + +/* Create an 8-bit palettized surface and render the given glyph at + fast quality with the given font and color. The 0 pixel is the + colorkey, giving a transparent background, and the 1 pixel is set + to the text color. The glyph is rendered without any padding or + centering in the X direction, and aligned normally in the Y direction. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Solid(TTF_Font *font, + Uint16 ch, SDL_Color fg); + +/* Create an 8-bit palettized surface and render the given text at + high quality with the given font and colors. The 0 pixel is background, + while other pixels have varying degrees of the foreground color. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Shaded(TTF_Font *font, + const char *text, SDL_Color fg, SDL_Color bg); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded(TTF_Font *font, + const char *text, SDL_Color fg, SDL_Color bg); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded(TTF_Font *font, + const Uint16 *text, SDL_Color fg, SDL_Color bg); + +/* Create an 8-bit palettized surface and render the given glyph at + high quality with the given font and colors. The 0 pixel is background, + while other pixels have varying degrees of the foreground color. + The glyph is rendered without any padding or centering in the X + direction, and aligned normally in the Y direction. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Shaded(TTF_Font *font, + Uint16 ch, SDL_Color fg, SDL_Color bg); + +/* Create a 32-bit ARGB surface and render the given text at high quality, + using alpha blending to dither the font with the given color. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended(TTF_Font *font, + const char *text, SDL_Color fg); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended(TTF_Font *font, + const char *text, SDL_Color fg); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended(TTF_Font *font, + const Uint16 *text, SDL_Color fg); + + +/* Create a 32-bit ARGB surface and render the given text at high quality, + using alpha blending to dither the font with the given color. + Text is wrapped to multiple lines on line endings and on word boundaries + if it extends beyond wrapLength in pixels. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended_Wrapped(TTF_Font *font, + const char *text, SDL_Color fg, Uint32 wrapLength); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended_Wrapped(TTF_Font *font, + const char *text, SDL_Color fg, Uint32 wrapLength); +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended_Wrapped(TTF_Font *font, + const Uint16 *text, SDL_Color fg, Uint32 wrapLength); + +/* Create a 32-bit ARGB surface and render the given glyph at high quality, + using alpha blending to dither the font with the given color. + The glyph is rendered without any padding or centering in the X + direction, and aligned normally in the Y direction. + This function returns the new surface, or NULL if there was an error. +*/ +extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Blended(TTF_Font *font, + Uint16 ch, SDL_Color fg); + +/* For compatibility with previous versions, here are the old functions */ +#define TTF_RenderText(font, text, fg, bg) \ + TTF_RenderText_Shaded(font, text, fg, bg) +#define TTF_RenderUTF8(font, text, fg, bg) \ + TTF_RenderUTF8_Shaded(font, text, fg, bg) +#define TTF_RenderUNICODE(font, text, fg, bg) \ + TTF_RenderUNICODE_Shaded(font, text, fg, bg) + +/* Close an opened font file */ +extern DECLSPEC void SDLCALL TTF_CloseFont(TTF_Font *font); + +/* De-initialize the TTF engine */ +extern DECLSPEC void SDLCALL TTF_Quit(void); + +/* Check if the TTF engine is initialized */ +extern DECLSPEC int SDLCALL TTF_WasInit(void); + +/* Get the kerning size of two glyphs */ +extern DECLSPEC int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int index); + +/* We'll use SDL for reporting errors */ +#define TTF_SetError SDL_SetError +#define TTF_GetError SDL_GetError + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_TTF_H */ diff --git a/SDL/include/SDL_types.h b/SDL/include/SDL_types.h new file mode 100644 index 0000000..bb485cd --- /dev/null +++ b/SDL/include/SDL_types.h @@ -0,0 +1,29 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_types.h + * + * \deprecated + */ + +/* DEPRECATED */ +#include "SDL_stdinc.h" diff --git a/SDL/include/SDL_version.h b/SDL/include/SDL_version.h new file mode 100644 index 0000000..dc52c85 --- /dev/null +++ b/SDL/include/SDL_version.h @@ -0,0 +1,162 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_version.h + * + * This header defines the current SDL version. + */ + +#ifndef _SDL_version_h +#define _SDL_version_h + +#include "SDL_stdinc.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Information the version of SDL in use. + * + * Represents the library's version as three levels: major revision + * (increments with massive changes, additions, and enhancements), + * minor revision (increments with backwards-compatible changes to the + * major revision), and patchlevel (increments with fixes to the minor + * revision). + * + * \sa SDL_VERSION + * \sa SDL_GetVersion + */ +typedef struct SDL_version +{ + Uint8 major; /**< major version */ + Uint8 minor; /**< minor version */ + Uint8 patch; /**< update version */ +} SDL_version; + +/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL +*/ +#define SDL_MAJOR_VERSION 2 +#define SDL_MINOR_VERSION 0 +#define SDL_PATCHLEVEL 1 + +/** + * \brief Macro to determine SDL version program was compiled against. + * + * This macro fills in a SDL_version structure with the version of the + * library you compiled against. This is determined by what header the + * compiler uses. Note that if you dynamically linked the library, you might + * have a slightly newer or older version at runtime. That version can be + * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), + * is not a macro. + * + * \param x A pointer to a SDL_version struct to initialize. + * + * \sa SDL_version + * \sa SDL_GetVersion + */ +#define SDL_VERSION(x) \ +{ \ + (x)->major = SDL_MAJOR_VERSION; \ + (x)->minor = SDL_MINOR_VERSION; \ + (x)->patch = SDL_PATCHLEVEL; \ +} + +/** + * This macro turns the version numbers into a numeric value: + * \verbatim + (1,2,3) -> (1203) + \endverbatim + * + * This assumes that there will never be more than 100 patchlevels. + */ +#define SDL_VERSIONNUM(X, Y, Z) \ + ((X)*1000 + (Y)*100 + (Z)) + +/** + * This is the version number macro for the current SDL version. + */ +#define SDL_COMPILEDVERSION \ + SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) + +/** + * This macro will evaluate to true if compiled with SDL at least X.Y.Z. + */ +#define SDL_VERSION_ATLEAST(X, Y, Z) \ + (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) + +/** + * \brief Get the version of SDL that is linked against your program. + * + * If you are linking to SDL dynamically, then it is possible that the + * current version will be different than the version you compiled against. + * This function returns the current version, while SDL_VERSION() is a + * macro that tells you what version you compiled with. + * + * \code + * SDL_version compiled; + * SDL_version linked; + * + * SDL_VERSION(&compiled); + * SDL_GetVersion(&linked); + * printf("We compiled against SDL version %d.%d.%d ...\n", + * compiled.major, compiled.minor, compiled.patch); + * printf("But we linked against SDL version %d.%d.%d.\n", + * linked.major, linked.minor, linked.patch); + * \endcode + * + * This function may be called safely at any time, even before SDL_Init(). + * + * \sa SDL_VERSION + */ +extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); + +/** + * \brief Get the code revision of SDL that is linked against your program. + * + * Returns an arbitrary string (a hash value) uniquely identifying the + * exact revision of the SDL library in use, and is only useful in comparing + * against other revisions. It is NOT an incrementing number. + */ +extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); + +/** + * \brief Get the revision number of SDL that is linked against your program. + * + * Returns a number uniquely identifying the exact revision of the SDL + * library in use. It is an incrementing number based on commits to + * hg.libsdl.org. + */ +extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_version_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/SDL_video.h b/SDL/include/SDL_video.h new file mode 100644 index 0000000..4a53f9b --- /dev/null +++ b/SDL/include/SDL_video.h @@ -0,0 +1,974 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file SDL_video.h + * + * Header file for SDL video functions. + */ + +#ifndef _SDL_video_h +#define _SDL_video_h + +#include "SDL_stdinc.h" +#include "SDL_pixels.h" +#include "SDL_rect.h" +#include "SDL_surface.h" + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief The structure that defines a display mode + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + * \sa SDL_GetDesktopDisplayMode() + * \sa SDL_GetCurrentDisplayMode() + * \sa SDL_GetClosestDisplayMode() + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +typedef struct +{ + Uint32 format; /**< pixel format */ + int w; /**< width */ + int h; /**< height */ + int refresh_rate; /**< refresh rate (or zero for unspecified) */ + void *driverdata; /**< driver-specific data, initialize to 0 */ +} SDL_DisplayMode; + +/** + * \brief The type used to identify a window + * + * \sa SDL_CreateWindow() + * \sa SDL_CreateWindowFrom() + * \sa SDL_DestroyWindow() + * \sa SDL_GetWindowData() + * \sa SDL_GetWindowFlags() + * \sa SDL_GetWindowGrab() + * \sa SDL_GetWindowPosition() + * \sa SDL_GetWindowSize() + * \sa SDL_GetWindowTitle() + * \sa SDL_HideWindow() + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + * \sa SDL_RaiseWindow() + * \sa SDL_RestoreWindow() + * \sa SDL_SetWindowData() + * \sa SDL_SetWindowFullscreen() + * \sa SDL_SetWindowGrab() + * \sa SDL_SetWindowIcon() + * \sa SDL_SetWindowPosition() + * \sa SDL_SetWindowSize() + * \sa SDL_SetWindowBordered() + * \sa SDL_SetWindowTitle() + * \sa SDL_ShowWindow() + */ +typedef struct SDL_Window SDL_Window; + +/** + * \brief The flags on a window + * + * \sa SDL_GetWindowFlags() + */ +typedef enum +{ + SDL_WINDOW_FULLSCREEN = 0x00000001, /**< fullscreen window */ + SDL_WINDOW_OPENGL = 0x00000002, /**< window usable with OpenGL context */ + SDL_WINDOW_SHOWN = 0x00000004, /**< window is visible */ + SDL_WINDOW_HIDDEN = 0x00000008, /**< window is not visible */ + SDL_WINDOW_BORDERLESS = 0x00000010, /**< no window decoration */ + SDL_WINDOW_RESIZABLE = 0x00000020, /**< window can be resized */ + SDL_WINDOW_MINIMIZED = 0x00000040, /**< window is minimized */ + SDL_WINDOW_MAXIMIZED = 0x00000080, /**< window is maximized */ + SDL_WINDOW_INPUT_GRABBED = 0x00000100, /**< window has grabbed input focus */ + SDL_WINDOW_INPUT_FOCUS = 0x00000200, /**< window has input focus */ + SDL_WINDOW_MOUSE_FOCUS = 0x00000400, /**< window has mouse focus */ + SDL_WINDOW_FULLSCREEN_DESKTOP = ( SDL_WINDOW_FULLSCREEN | 0x00001000 ), + SDL_WINDOW_FOREIGN = 0x00000800, /**< window not created by SDL */ + SDL_WINDOW_ALLOW_HIGHDPI = 0x00002000 /**< window should be created in high-DPI mode if supported */ +} SDL_WindowFlags; + +/** + * \brief Used to indicate that you don't care what the window position is. + */ +#define SDL_WINDOWPOS_UNDEFINED_MASK 0x1FFF0000 +#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X) (SDL_WINDOWPOS_UNDEFINED_MASK|(X)) +#define SDL_WINDOWPOS_UNDEFINED SDL_WINDOWPOS_UNDEFINED_DISPLAY(0) +#define SDL_WINDOWPOS_ISUNDEFINED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK) + +/** + * \brief Used to indicate that the window position should be centered. + */ +#define SDL_WINDOWPOS_CENTERED_MASK 0x2FFF0000 +#define SDL_WINDOWPOS_CENTERED_DISPLAY(X) (SDL_WINDOWPOS_CENTERED_MASK|(X)) +#define SDL_WINDOWPOS_CENTERED SDL_WINDOWPOS_CENTERED_DISPLAY(0) +#define SDL_WINDOWPOS_ISCENTERED(X) \ + (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK) + +/** + * \brief Event subtype for window events + */ +typedef enum +{ + SDL_WINDOWEVENT_NONE, /**< Never used */ + SDL_WINDOWEVENT_SHOWN, /**< Window has been shown */ + SDL_WINDOWEVENT_HIDDEN, /**< Window has been hidden */ + SDL_WINDOWEVENT_EXPOSED, /**< Window has been exposed and should be + redrawn */ + SDL_WINDOWEVENT_MOVED, /**< Window has been moved to data1, data2 + */ + SDL_WINDOWEVENT_RESIZED, /**< Window has been resized to data1xdata2 */ + SDL_WINDOWEVENT_SIZE_CHANGED, /**< The window size has changed, either as a result of an API call or through the system or user changing the window size. */ + SDL_WINDOWEVENT_MINIMIZED, /**< Window has been minimized */ + SDL_WINDOWEVENT_MAXIMIZED, /**< Window has been maximized */ + SDL_WINDOWEVENT_RESTORED, /**< Window has been restored to normal size + and position */ + SDL_WINDOWEVENT_ENTER, /**< Window has gained mouse focus */ + SDL_WINDOWEVENT_LEAVE, /**< Window has lost mouse focus */ + SDL_WINDOWEVENT_FOCUS_GAINED, /**< Window has gained keyboard focus */ + SDL_WINDOWEVENT_FOCUS_LOST, /**< Window has lost keyboard focus */ + SDL_WINDOWEVENT_CLOSE /**< The window manager requests that the + window be closed */ +} SDL_WindowEventID; + +/** + * \brief An opaque handle to an OpenGL context. + */ +typedef void *SDL_GLContext; + +/** + * \brief OpenGL configuration attributes + */ +typedef enum +{ + SDL_GL_RED_SIZE, + SDL_GL_GREEN_SIZE, + SDL_GL_BLUE_SIZE, + SDL_GL_ALPHA_SIZE, + SDL_GL_BUFFER_SIZE, + SDL_GL_DOUBLEBUFFER, + SDL_GL_DEPTH_SIZE, + SDL_GL_STENCIL_SIZE, + SDL_GL_ACCUM_RED_SIZE, + SDL_GL_ACCUM_GREEN_SIZE, + SDL_GL_ACCUM_BLUE_SIZE, + SDL_GL_ACCUM_ALPHA_SIZE, + SDL_GL_STEREO, + SDL_GL_MULTISAMPLEBUFFERS, + SDL_GL_MULTISAMPLESAMPLES, + SDL_GL_ACCELERATED_VISUAL, + SDL_GL_RETAINED_BACKING, + SDL_GL_CONTEXT_MAJOR_VERSION, + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_EGL, + SDL_GL_CONTEXT_FLAGS, + SDL_GL_CONTEXT_PROFILE_MASK, + SDL_GL_SHARE_WITH_CURRENT_CONTEXT, + SDL_GL_FRAMEBUFFER_SRGB_CAPABLE +} SDL_GLattr; + +typedef enum +{ + SDL_GL_CONTEXT_PROFILE_CORE = 0x0001, + SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002, + SDL_GL_CONTEXT_PROFILE_ES = 0x0004 /* GLX_CONTEXT_ES2_PROFILE_BIT_EXT */ +} SDL_GLprofile; + +typedef enum +{ + SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001, + SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002, + SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004, + SDL_GL_CONTEXT_RESET_ISOLATION_FLAG = 0x0008 +} SDL_GLcontextFlag; + + +/* Function prototypes */ + +/** + * \brief Get the number of video drivers compiled into SDL + * + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); + +/** + * \brief Get the name of a built in video driver. + * + * \note The video drivers are presented in the order in which they are + * normally checked during initialization. + * + * \sa SDL_GetNumVideoDrivers() + */ +extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); + +/** + * \brief Initialize the video subsystem, optionally specifying a video driver. + * + * \param driver_name Initialize a specific driver by name, or NULL for the + * default video driver. + * + * \return 0 on success, -1 on error + * + * This function initializes the video subsystem; setting up a connection + * to the window manager, etc, and determines the available display modes + * and pixel formats, but does not initialize a window or graphics mode. + * + * \sa SDL_VideoQuit() + */ +extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name); + +/** + * \brief Shuts down the video subsystem. + * + * This function closes all windows, and restores the original video mode. + * + * \sa SDL_VideoInit() + */ +extern DECLSPEC void SDLCALL SDL_VideoQuit(void); + +/** + * \brief Returns the name of the currently initialized video driver. + * + * \return The name of the current video driver or NULL if no driver + * has been initialized + * + * \sa SDL_GetNumVideoDrivers() + * \sa SDL_GetVideoDriver() + */ +extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); + +/** + * \brief Returns the number of available video displays. + * + * \sa SDL_GetDisplayBounds() + */ +extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void); + +/** + * \brief Get the name of a display in UTF-8 encoding + * + * \return The name of a display, or NULL for an invalid display index. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC const char * SDLCALL SDL_GetDisplayName(int displayIndex); + +/** + * \brief Get the desktop area represented by a display, with the primary + * display located at 0,0 + * + * \return 0 on success, or -1 if the index is out of range. + * + * \sa SDL_GetNumVideoDisplays() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect); + +/** + * \brief Returns the number of available display modes. + * + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex); + +/** + * \brief Fill in information about a specific display mode. + * + * \note The display modes are sorted in this priority: + * \li bits per pixel -> more colors to fewer colors + * \li width -> largest to smallest + * \li height -> largest to smallest + * \li refresh rate -> highest to lowest + * + * \sa SDL_GetNumDisplayModes() + */ +extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex, + SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the desktop display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode); + +/** + * \brief Fill in information about the current display mode. + */ +extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode); + + +/** + * \brief Get the closest match to the requested display mode. + * + * \param displayIndex The index of display from which mode should be queried. + * \param mode The desired display mode + * \param closest A pointer to a display mode to be filled in with the closest + * match of the available display modes. + * + * \return The passed in value \c closest, or NULL if no matching video mode + * was available. + * + * The available display modes are scanned, and \c closest is filled in with the + * closest mode matching the requested mode and returned. The mode format and + * refresh_rate default to the desktop mode if they are 0. The modes are + * scanned with size being first priority, format being second priority, and + * finally checking the refresh_rate. If all the available modes are too + * small, then NULL is returned. + * + * \sa SDL_GetNumDisplayModes() + * \sa SDL_GetDisplayMode() + */ +extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); + +/** + * \brief Get the display index associated with a window. + * + * \return the display index of the display containing the center of the + * window, or -1 on error. + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayIndex(SDL_Window * window); + +/** + * \brief Set the display mode used when a fullscreen window is visible. + * + * By default the window's dimensions and the desktop format and refresh rate + * are used. + * + * \param window The window for which the display mode should be set. + * \param mode The mode to use, or NULL for the default mode. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_GetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window, + const SDL_DisplayMode + * mode); + +/** + * \brief Fill in information about the display mode used when a fullscreen + * window is visible. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_SetWindowFullscreen() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window, + SDL_DisplayMode * mode); + +/** + * \brief Get the pixel format associated with the window. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window); + +/** + * \brief Create a window with the specified position, dimensions, and flags. + * + * \param title The title of the window, in UTF-8 encoding. + * \param x The x position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y position of the window, ::SDL_WINDOWPOS_CENTERED, or + * ::SDL_WINDOWPOS_UNDEFINED. + * \param w The width of the window. + * \param h The height of the window. + * \param flags The flags for the window, a mask of any of the following: + * ::SDL_WINDOW_FULLSCREEN, ::SDL_WINDOW_OPENGL, + * ::SDL_WINDOW_HIDDEN, ::SDL_WINDOW_BORDERLESS, + * ::SDL_WINDOW_RESIZABLE, ::SDL_WINDOW_MAXIMIZED, + * ::SDL_WINDOW_MINIMIZED, ::SDL_WINDOW_INPUT_GRABBED, + * ::SDL_WINDOW_ALLOW_HIGHDPI. + * + * \return The id of the window created, or zero if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, + int x, int y, int w, + int h, Uint32 flags); + +/** + * \brief Create an SDL window from an existing native window. + * + * \param data A pointer to driver-dependent window creation data + * + * \return The id of the window created, or zero if window creation failed. + * + * \sa SDL_DestroyWindow() + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowFrom(const void *data); + +/** + * \brief Get the numeric ID of a window, for logging purposes. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowID(SDL_Window * window); + +/** + * \brief Get a window from a stored ID, or NULL if it doesn't exist. + */ +extern DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(Uint32 id); + +/** + * \brief Get the window flags. + */ +extern DECLSPEC Uint32 SDLCALL SDL_GetWindowFlags(SDL_Window * window); + +/** + * \brief Set the title of a window, in UTF-8 format. + * + * \sa SDL_GetWindowTitle() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowTitle(SDL_Window * window, + const char *title); + +/** + * \brief Get the title of a window, in UTF-8 format. + * + * \sa SDL_SetWindowTitle() + */ +extern DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window * window); + +/** + * \brief Set the icon for a window. + * + * \param window The window for which the icon should be set. + * \param icon The icon for the window. + */ +extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window, + SDL_Surface * icon); + +/** + * \brief Associate an arbitrary named pointer with a window. + * + * \param window The window to associate with the pointer. + * \param name The name of the pointer. + * \param userdata The associated pointer. + * + * \return The previous value associated with 'name' + * + * \note The name is case-sensitive. + * + * \sa SDL_GetWindowData() + */ +extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window, + const char *name, + void *userdata); + +/** + * \brief Retrieve the data pointer associated with a window. + * + * \param window The window to query. + * \param name The name of the pointer. + * + * \return The value associated with 'name' + * + * \sa SDL_SetWindowData() + */ +extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window, + const char *name); + +/** + * \brief Set the position of a window. + * + * \param window The window to reposition. + * \param x The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or + ::SDL_WINDOWPOS_UNDEFINED. + * \param y The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or + ::SDL_WINDOWPOS_UNDEFINED. + * + * \note The window coordinate origin is the upper left of the display. + * + * \sa SDL_GetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowPosition(SDL_Window * window, + int x, int y); + +/** + * \brief Get the position of a window. + * + * \param window The window to query. + * \param x Pointer to variable for storing the x position, may be NULL + * \param y Pointer to variable for storing the y position, may be NULL + * + * \sa SDL_SetWindowPosition() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowPosition(SDL_Window * window, + int *x, int *y); + +/** + * \brief Set the size of a window's client area. + * + * \param window The window to resize. + * \param w The width of the window, must be >0 + * \param h The height of the window, must be >0 + * + * \note You can't change the size of a fullscreen window, it automatically + * matches the size of the display mode. + * + * \sa SDL_GetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowSize(SDL_Window * window, int w, + int h); + +/** + * \brief Get the size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the width, may be NULL + * \param h Pointer to variable for storing the height, may be NULL + * + * \sa SDL_SetWindowSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowSize(SDL_Window * window, int *w, + int *h); + +/** + * \brief Set the minimum size of a window's client area. + * + * \param window The window to set a new minimum size. + * \param min_w The minimum width of the window, must be >0 + * \param min_h The minimum height of the window, must be >0 + * + * \note You can't change the minimum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMinimumSize(SDL_Window * window, + int min_w, int min_h); + +/** + * \brief Get the minimum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the minimum width, may be NULL + * \param h Pointer to variable for storing the minimum height, may be NULL + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMinimumSize(SDL_Window * window, + int *w, int *h); + +/** + * \brief Set the maximum size of a window's client area. + * + * \param window The window to set a new maximum size. + * \param max_w The maximum width of the window, must be >0 + * \param max_h The maximum height of the window, must be >0 + * + * \note You can't change the maximum size of a fullscreen window, it + * automatically matches the size of the display mode. + * + * \sa SDL_GetWindowMaximumSize() + * \sa SDL_SetWindowMinimumSize() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowMaximumSize(SDL_Window * window, + int max_w, int max_h); + +/** + * \brief Get the maximum size of a window's client area. + * + * \param window The window to query. + * \param w Pointer to variable for storing the maximum width, may be NULL + * \param h Pointer to variable for storing the maximum height, may be NULL + * + * \sa SDL_GetWindowMinimumSize() + * \sa SDL_SetWindowMaximumSize() + */ +extern DECLSPEC void SDLCALL SDL_GetWindowMaximumSize(SDL_Window * window, + int *w, int *h); + +/** + * \brief Set the border state of a window. + * + * This will add or remove the window's SDL_WINDOW_BORDERLESS flag and + * add or remove the border from the actual window. This is a no-op if the + * window's border already matches the requested state. + * + * \param window The window of which to change the border state. + * \param bordered SDL_FALSE to remove border, SDL_TRUE to add border. + * + * \note You can't change the border state of a fullscreen window. + * + * \sa SDL_GetWindowFlags() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowBordered(SDL_Window * window, + SDL_bool bordered); + +/** + * \brief Show a window. + * + * \sa SDL_HideWindow() + */ +extern DECLSPEC void SDLCALL SDL_ShowWindow(SDL_Window * window); + +/** + * \brief Hide a window. + * + * \sa SDL_ShowWindow() + */ +extern DECLSPEC void SDLCALL SDL_HideWindow(SDL_Window * window); + +/** + * \brief Raise a window above other windows and set the input focus. + */ +extern DECLSPEC void SDLCALL SDL_RaiseWindow(SDL_Window * window); + +/** + * \brief Make a window as large as possible. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MaximizeWindow(SDL_Window * window); + +/** + * \brief Minimize a window to an iconic representation. + * + * \sa SDL_RestoreWindow() + */ +extern DECLSPEC void SDLCALL SDL_MinimizeWindow(SDL_Window * window); + +/** + * \brief Restore the size and position of a minimized or maximized window. + * + * \sa SDL_MaximizeWindow() + * \sa SDL_MinimizeWindow() + */ +extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window); + +/** + * \brief Set a window's fullscreen state. + * + * \return 0 on success, or -1 if setting the display mode failed. + * + * \sa SDL_SetWindowDisplayMode() + * \sa SDL_GetWindowDisplayMode() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window, + Uint32 flags); + +/** + * \brief Get the SDL surface associated with the window. + * + * \return The window's framebuffer surface, or NULL on error. + * + * A new surface will be created with the optimal format for the window, + * if necessary. This surface will be freed when the window is destroyed. + * + * \note You may not combine this with 3D or the rendering API on this window. + * + * \sa SDL_UpdateWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window); + +/** + * \brief Copy the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRects() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window); + +/** + * \brief Copy a number of rectangles on the window surface to the screen. + * + * \return 0 on success, or -1 on error. + * + * \sa SDL_GetWindowSurface() + * \sa SDL_UpdateWindowSurfaceRect() + */ +extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window, + const SDL_Rect * rects, + int numrects); + +/** + * \brief Set a window's input grab mode. + * + * \param window The window for which the input grab mode should be set. + * \param grabbed This is SDL_TRUE to grab input, and SDL_FALSE to release input. + * + * \sa SDL_GetWindowGrab() + */ +extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window, + SDL_bool grabbed); + +/** + * \brief Get a window's input grab mode. + * + * \return This returns SDL_TRUE if input is grabbed, and SDL_FALSE otherwise. + * + * \sa SDL_SetWindowGrab() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowGrab(SDL_Window * window); + +/** + * \brief Set the brightness (gamma correction) for a window. + * + * \return 0 on success, or -1 if setting the brightness isn't supported. + * + * \sa SDL_GetWindowBrightness() + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowBrightness(SDL_Window * window, float brightness); + +/** + * \brief Get the brightness (gamma correction) for a window. + * + * \return The last brightness value passed to SDL_SetWindowBrightness() + * + * \sa SDL_SetWindowBrightness() + */ +extern DECLSPEC float SDLCALL SDL_GetWindowBrightness(SDL_Window * window); + +/** + * \brief Set the gamma ramp for a window. + * + * \param window The window for which the gamma ramp should be set. + * \param red The translation table for the red channel, or NULL. + * \param green The translation table for the green channel, or NULL. + * \param blue The translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * Set the gamma translation table for the red, green, and blue channels + * of the video hardware. Each table is an array of 256 16-bit quantities, + * representing a mapping between the input and output for that channel. + * The input is the index into the array, and the output is the 16-bit + * gamma value at that index, scaled to the output color precision. + * + * \sa SDL_GetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_SetWindowGammaRamp(SDL_Window * window, + const Uint16 * red, + const Uint16 * green, + const Uint16 * blue); + +/** + * \brief Get the gamma ramp for a window. + * + * \param window The window from which the gamma ramp should be queried. + * \param red A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the red channel, or NULL. + * \param green A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the green channel, or NULL. + * \param blue A pointer to a 256 element array of 16-bit quantities to hold + * the translation table for the blue channel, or NULL. + * + * \return 0 on success, or -1 if gamma ramps are unsupported. + * + * \sa SDL_SetWindowGammaRamp() + */ +extern DECLSPEC int SDLCALL SDL_GetWindowGammaRamp(SDL_Window * window, + Uint16 * red, + Uint16 * green, + Uint16 * blue); + +/** + * \brief Destroy a window. + */ +extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window); + + +/** + * \brief Returns whether the screensaver is currently enabled (default on). + * + * \sa SDL_EnableScreenSaver() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void); + +/** + * \brief Allow the screen to be blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_DisableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_EnableScreenSaver(void); + +/** + * \brief Prevent the screen from being blanked by a screensaver + * + * \sa SDL_IsScreenSaverEnabled() + * \sa SDL_EnableScreenSaver() + */ +extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void); + + +/** + * \name OpenGL support functions + */ +/* @{ */ + +/** + * \brief Dynamically load an OpenGL library. + * + * \param path The platform dependent OpenGL library name, or NULL to open the + * default OpenGL library. + * + * \return 0 on success, or -1 if the library couldn't be loaded. + * + * This should be done after initializing the video driver, but before + * creating any OpenGL windows. If no OpenGL library is loaded, the default + * library will be loaded upon creation of the first OpenGL window. + * + * \note If you do this, you need to retrieve all of the GL functions used in + * your program from the dynamic library using SDL_GL_GetProcAddress(). + * + * \sa SDL_GL_GetProcAddress() + * \sa SDL_GL_UnloadLibrary() + */ +extern DECLSPEC int SDLCALL SDL_GL_LoadLibrary(const char *path); + +/** + * \brief Get the address of an OpenGL function. + */ +extern DECLSPEC void *SDLCALL SDL_GL_GetProcAddress(const char *proc); + +/** + * \brief Unload the OpenGL library previously loaded by SDL_GL_LoadLibrary(). + * + * \sa SDL_GL_LoadLibrary() + */ +extern DECLSPEC void SDLCALL SDL_GL_UnloadLibrary(void); + +/** + * \brief Return true if an OpenGL extension is supported for the current + * context. + */ +extern DECLSPEC SDL_bool SDLCALL SDL_GL_ExtensionSupported(const char + *extension); + +/** + * \brief Set an OpenGL window attribute before window creation. + */ +extern DECLSPEC int SDLCALL SDL_GL_SetAttribute(SDL_GLattr attr, int value); + +/** + * \brief Get the actual value for an attribute from the current context. + */ +extern DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value); + +/** + * \brief Create an OpenGL context for use with an OpenGL window, and make it + * current. + * + * \sa SDL_GL_DeleteContext() + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window * + window); + +/** + * \brief Set up an OpenGL context for rendering into an OpenGL window. + * + * \note The context must have been created with a compatible window. + */ +extern DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window * window, + SDL_GLContext context); + +/** + * \brief Get the currently active OpenGL window. + */ +extern DECLSPEC SDL_Window* SDLCALL SDL_GL_GetCurrentWindow(void); + +/** + * \brief Get the currently active OpenGL context. + */ +extern DECLSPEC SDL_GLContext SDLCALL SDL_GL_GetCurrentContext(void); + +/** + * \brief Get the size of a window's underlying drawable (for use with glViewport). + * + * \param window Window from which the drawable size should be queried + * \param w Pointer to variable for storing the width, may be NULL + * \param h Pointer to variable for storing the height, may be NULL + * + * This may differ from SDL_GetWindowSize if we're rendering to a high-DPI + * drawable, i.e. the window was created with SDL_WINDOW_ALLOW_HIGHDPI on a + * platform with high-DPI support (Apple calls this "Retina"), and not disabled + * by the SDL_HINT_VIDEO_HIGHDPI_DISABLED hint. + * + * \sa SDL_GetWindowSize() + * \sa SDL_CreateWindow() + */ +extern DECLSPEC void SDLCALL SDL_GL_GetDrawableSize(SDL_Window * window, int *w, + int *h); + +/** + * \brief Set the swap interval for the current OpenGL context. + * + * \param interval 0 for immediate updates, 1 for updates synchronized with the + * vertical retrace. If the system supports it, you may + * specify -1 to allow late swaps to happen immediately + * instead of waiting for the next retrace. + * + * \return 0 on success, or -1 if setting the swap interval is not supported. + * + * \sa SDL_GL_GetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_SetSwapInterval(int interval); + +/** + * \brief Get the swap interval for the current OpenGL context. + * + * \return 0 if there is no vertical retrace synchronization, 1 if the buffer + * swap is synchronized with the vertical retrace, and -1 if late + * swaps happen immediately instead of waiting for the next retrace. + * If the system can't determine the swap interval, or there isn't a + * valid current context, this will return 0 as a safe default. + * + * \sa SDL_GL_SetSwapInterval() + */ +extern DECLSPEC int SDLCALL SDL_GL_GetSwapInterval(void); + +/** + * \brief Swap the OpenGL buffers for a window, if double-buffering is + * supported. + */ +extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window); + +/** + * \brief Delete an OpenGL context. + * + * \sa SDL_GL_CreateContext() + */ +extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); + +/* @} *//* OpenGL support functions */ + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +} +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/SDL/include/begin_code.h b/SDL/include/begin_code.h new file mode 100644 index 0000000..968a540 --- /dev/null +++ b/SDL/include/begin_code.h @@ -0,0 +1,140 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file begin_code.h + * + * This file sets things up for C dynamic library function definitions, + * static inlined functions, and structures aligned at 4-byte alignment. + * If you don't like ugly C preprocessor code, don't look at this file. :) + */ + +/* This shouldn't be nested -- included it around code only. */ +#ifdef _begin_code_h +#error Nested inclusion of begin_code.h +#endif +#define _begin_code_h + +#ifndef SDL_DEPRECATED +# if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ +# define SDL_DEPRECATED __attribute__((deprecated)) +# else +# define SDL_DEPRECATED +# endif +#endif + +/* Some compilers use a special export keyword */ +#ifndef DECLSPEC +# if defined(__WIN32__) +# ifdef __BORLANDC__ +# ifdef BUILD_SDL +# define DECLSPEC +# else +# define DECLSPEC __declspec(dllimport) +# endif +# else +# define DECLSPEC __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && __GNUC__ >= 4 +# define DECLSPEC __attribute__ ((visibility("default"))) +# elif defined(__GNUC__) && __GNUC__ >= 2 +# define DECLSPEC __declspec(dllexport) +# else +# define DECLSPEC +# endif +# endif +#endif + +/* By default SDL uses the C calling convention */ +#ifndef SDLCALL +#if defined(__WIN32__) && !defined(__GNUC__) +#define SDLCALL __cdecl +#else +#define SDLCALL +#endif +#endif /* SDLCALL */ + +/* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ +#ifdef __SYMBIAN32__ +#undef DECLSPEC +#define DECLSPEC +#endif /* __SYMBIAN32__ */ + +/* Force structure packing at 4 byte alignment. + This is necessary if the header is included in code which has structure + packing set to an alternate value, say for loading structures from disk. + The packing is reset to the previous value in close_code.h + */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) +#ifdef _MSC_VER +#pragma warning(disable: 4103) +#endif +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#ifdef _M_X64 +/* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ +#pragma pack(push,8) +#else +#pragma pack(push,4) +#endif +#endif /* Compiler needs structure packing set */ + +#ifndef SDL_INLINE +#if defined(__GNUC__) +#define SDL_INLINE __inline__ +#elif defined(_MSC_VER) || defined(__BORLANDC__) || \ + defined(__DMC__) || defined(__SC__) || \ + defined(__WATCOMC__) || defined(__LCC__) || \ + defined(__DECC) +#define SDL_INLINE __inline +#ifndef __inline__ +#define __inline__ __inline +#endif +#else +#define SDL_INLINE inline +#ifndef __inline__ +#define __inline__ inline +#endif +#endif +#endif /* SDL_INLINE not defined */ + +#ifndef SDL_FORCE_INLINE +#if defined(_MSC_VER) +#define SDL_FORCE_INLINE __forceinline +#elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) +#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ +#else +#define SDL_FORCE_INLINE static SDL_INLINE +#endif +#endif /* SDL_FORCE_INLINE not defined */ + +/* Apparently this is needed by several Windows compilers */ +#if !defined(__MACH__) +#ifndef NULL +#ifdef __cplusplus +#define NULL 0 +#else +#define NULL ((void *)0) +#endif +#endif /* NULL */ +#endif /* ! Mac OS X - breaks precompiled headers */ diff --git a/SDL/include/close_code.h b/SDL/include/close_code.h new file mode 100644 index 0000000..4901482 --- /dev/null +++ b/SDL/include/close_code.h @@ -0,0 +1,37 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/** + * \file close_code.h + * + * This file reverses the effects of begin_code.h and should be included + * after you finish any function and structure declarations in your headers + */ + +#undef _begin_code_h + +/* Reset structure packing at previous byte alignment */ +#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__WATCOMC__) || defined(__BORLANDC__) +#ifdef __BORLANDC__ +#pragma nopackwarning +#endif +#pragma pack(pop) +#endif /* Compiler needs structure packing set */ diff --git a/SDL/include/doxyfile b/SDL/include/doxyfile new file mode 100644 index 0000000..495dbc1 --- /dev/null +++ b/SDL/include/doxyfile @@ -0,0 +1,1555 @@ +# Doxyfile 1.5.9 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = SDL + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 2.0.0 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = YES + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = "defined=\"\def\"" \ + "discussion=\"\par Discussion:\n\"" + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set +# FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = YES + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = YES + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = YES + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = ./doxygen_warn.txt + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = . + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.f90 \ + *.f \ + *.vhd \ + *.vhdl \ + *.h.in \ + *.h.default + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = ../doxy \ + ../test \ + ../Xcode \ + ../VisualC \ + ../VisualCE \ + ../Xcode-iOS + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = YES + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = YES + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = SDL_ \ + SDL + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = YES + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "SDL 2.0 Doxygen" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.libsdl.sdl20 + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = ./sdl20.chm + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = YES + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 1 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to FRAME, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, +# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are +# probably better off using the HTML help feature. Other possible values +# for this tag are: HIERARCHIES, which will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list; +# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which +# disables this behavior completely. For backwards compatibility with previous +# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE +# respectively. + +GENERATE_TREEVIEW = ALL + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = YES + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = YES + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = DOXYGEN_SHOULD_IGNORE_THIS=1 \ + DECLSPEC= \ + SDLCALL= \ + _WIN32=1 + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = ./SDL.tag + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = c:\Perl\bin\perl.exe + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 2 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES + +#--------------------------------------------------------------------------- +# Options related to the search engine +#--------------------------------------------------------------------------- + +# The SEARCHENGINE tag specifies whether or not a search engine should be +# used. If set to NO the values of all tags below this one will be ignored. + +SEARCHENGINE = NO diff --git a/SDL/include/dynamic_flac.h b/SDL/include/dynamic_flac.h new file mode 100644 index 0000000..10a4046 --- /dev/null +++ b/SDL/include/dynamic_flac.h @@ -0,0 +1,66 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + The following file defines all of the functions/objects used to dynamically + link to the libFLAC library. + ~ Austen Dicken (admin@cvpcs.org) +*/ + +#ifdef FLAC_MUSIC + +#include + +typedef struct { + int loaded; + void *handle; + FLAC__StreamDecoder *(*FLAC__stream_decoder_new)(); + void (*FLAC__stream_decoder_delete)(FLAC__StreamDecoder *decoder); + FLAC__StreamDecoderInitStatus (*FLAC__stream_decoder_init_stream)( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data); + FLAC__bool (*FLAC__stream_decoder_finish)(FLAC__StreamDecoder *decoder); + FLAC__bool (*FLAC__stream_decoder_flush)(FLAC__StreamDecoder *decoder); + FLAC__bool (*FLAC__stream_decoder_process_single)( + FLAC__StreamDecoder *decoder); + FLAC__bool (*FLAC__stream_decoder_process_until_end_of_metadata)( + FLAC__StreamDecoder *decoder); + FLAC__bool (*FLAC__stream_decoder_process_until_end_of_stream)( + FLAC__StreamDecoder *decoder); + FLAC__bool (*FLAC__stream_decoder_seek_absolute)( + FLAC__StreamDecoder *decoder, + FLAC__uint64 sample); + FLAC__StreamDecoderState (*FLAC__stream_decoder_get_state)( + const FLAC__StreamDecoder *decoder); +} flac_loader; + +extern flac_loader flac; + +#endif /* FLAC_MUSIC */ + +extern int Mix_InitFLAC(); +extern void Mix_QuitFLAC(); diff --git a/SDL/include/dynamic_fluidsynth.h b/SDL/include/dynamic_fluidsynth.h new file mode 100644 index 0000000..455b419 --- /dev/null +++ b/SDL/include/dynamic_fluidsynth.h @@ -0,0 +1,57 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + James Le Cuirot + chewi@aura-online.co.uk +*/ + +#ifdef USE_FLUIDSYNTH_MIDI + +#include + +typedef struct { + int loaded; + void *handle; + + int (*delete_fluid_player)(fluid_player_t*); + void (*delete_fluid_settings)(fluid_settings_t*); + int (*delete_fluid_synth)(fluid_synth_t*); + int (*fluid_player_add)(fluid_player_t*, const char*); + int (*fluid_player_add_mem)(fluid_player_t*, const void*, size_t); + int (*fluid_player_get_status)(fluid_player_t*); + int (*fluid_player_play)(fluid_player_t*); + int (*fluid_player_set_loop)(fluid_player_t*, int); + int (*fluid_player_stop)(fluid_player_t*); + int (*fluid_settings_setnum)(fluid_settings_t*, const char*, double); + fluid_settings_t* (*fluid_synth_get_settings)(fluid_synth_t*); + void (*fluid_synth_set_gain)(fluid_synth_t*, float); + int (*fluid_synth_sfload)(fluid_synth_t*, const char*, int); + int (*fluid_synth_write_s16)(fluid_synth_t*, int, void*, int, int, void*, int, int); + fluid_player_t* (*new_fluid_player)(fluid_synth_t*); + fluid_settings_t* (*new_fluid_settings)(void); + fluid_synth_t* (*new_fluid_synth)(fluid_settings_t*); +} fluidsynth_loader; + +extern fluidsynth_loader fluidsynth; + +#endif /* USE_FLUIDSYNTH_MIDI */ + +extern int Mix_InitFluidSynth(); +extern void Mix_QuitFluidSynth(); diff --git a/SDL/include/dynamic_mod.h b/SDL/include/dynamic_mod.h new file mode 100644 index 0000000..945d3cf --- /dev/null +++ b/SDL/include/dynamic_mod.h @@ -0,0 +1,63 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef MOD_MUSIC + +#include "mikmod.h" + +typedef struct { + int loaded; + void *handle; + + void (*MikMod_Exit)(void); + CHAR* (*MikMod_InfoDriver)(void); + CHAR* (*MikMod_InfoLoader)(void); + BOOL (*MikMod_Init)(CHAR*); + void (*MikMod_RegisterAllLoaders)(void); + void (*MikMod_RegisterDriver)(struct MDRIVER*); + int* MikMod_errno; + char* (*MikMod_strerror)(int); + void (*MikMod_free)(void*); + BOOL (*Player_Active)(void); + void (*Player_Free)(MODULE*); + MODULE* (*Player_LoadGeneric)(MREADER*,int,BOOL); + void (*Player_SetPosition)(UWORD); + void (*Player_SetVolume)(SWORD); + void (*Player_Start)(MODULE*); + void (*Player_Stop)(void); + ULONG (*VC_WriteBytes)(SBYTE*,ULONG); + struct MDRIVER* drv_nos; + UWORD* md_device; + UWORD* md_mixfreq; + UWORD* md_mode; + UBYTE* md_musicvolume; + UBYTE* md_pansep; + UBYTE* md_reverb; + UBYTE* md_sndfxvolume; + UBYTE* md_volume; +} mikmod_loader; + +extern mikmod_loader mikmod; + +#endif /* MOD_MUSIC */ + +extern int Mix_InitMOD(); +extern void Mix_QuitMOD(); diff --git a/SDL/include/dynamic_modplug.h b/SDL/include/dynamic_modplug.h new file mode 100644 index 0000000..21eeb33 --- /dev/null +++ b/SDL/include/dynamic_modplug.h @@ -0,0 +1,44 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef MODPLUG_MUSIC + +#include "modplug.h" + +typedef struct { + int loaded; + void *handle; + + ModPlugFile* (*ModPlug_Load)(const void* data, int size); + void (*ModPlug_Unload)(ModPlugFile* file); + int (*ModPlug_Read)(ModPlugFile* file, void* buffer, int size); + void (*ModPlug_Seek)(ModPlugFile* file, int millisecond); + void (*ModPlug_GetSettings)(ModPlug_Settings* settings); + void (*ModPlug_SetSettings)(const ModPlug_Settings* settings); + void (*ModPlug_SetMasterVolume)(ModPlugFile* file,unsigned int cvol) ; +} modplug_loader; + +extern modplug_loader modplug; + +#endif /* MODPLUG_MUSIC */ + +extern int Mix_InitModPlug(); +extern void Mix_QuitModPlug(); diff --git a/SDL/include/dynamic_mp3.h b/SDL/include/dynamic_mp3.h new file mode 100644 index 0000000..5017e0e --- /dev/null +++ b/SDL/include/dynamic_mp3.h @@ -0,0 +1,47 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef MP3_MUSIC +#include "smpeg.h" + +typedef struct { + int loaded; + void *handle; + void (*SMPEG_actualSpec)( SMPEG *mpeg, SDL_AudioSpec *spec ); + void (*SMPEG_delete)( SMPEG* mpeg ); + void (*SMPEG_enableaudio)( SMPEG* mpeg, int enable ); + void (*SMPEG_enablevideo)( SMPEG* mpeg, int enable ); + SMPEG* (*SMPEG_new_rwops)(SDL_RWops *src, SMPEG_Info* info, int freesrc, int sdl_audio); + void (*SMPEG_play)( SMPEG* mpeg ); + int (*SMPEG_playAudio)( SMPEG *mpeg, Uint8 *stream, int len ); + void (*SMPEG_rewind)( SMPEG* mpeg ); + void (*SMPEG_setvolume)( SMPEG* mpeg, int volume ); + void (*SMPEG_skip)( SMPEG* mpeg, float seconds ); + SMPEGstatus (*SMPEG_status)( SMPEG* mpeg ); + void (*SMPEG_stop)( SMPEG* mpeg ); +} smpeg_loader; + +extern smpeg_loader smpeg; + +#endif /* MUSIC_MP3 */ + +extern int Mix_InitMP3(); +extern void Mix_QuitMP3(); diff --git a/SDL/include/dynamic_ogg.h b/SDL/include/dynamic_ogg.h new file mode 100644 index 0000000..d54705a --- /dev/null +++ b/SDL/include/dynamic_ogg.h @@ -0,0 +1,53 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef OGG_MUSIC +#ifdef OGG_USE_TREMOR +#include +#else +#include +#endif + +typedef struct { + int loaded; + void *handle; + int (*ov_clear)(OggVorbis_File *vf); + vorbis_info *(*ov_info)(OggVorbis_File *vf,int link); + int (*ov_open_callbacks)(void *datasource, OggVorbis_File *vf, const char *initial, long ibytes, ov_callbacks callbacks); + ogg_int64_t (*ov_pcm_total)(OggVorbis_File *vf,int i); +#ifdef OGG_USE_TREMOR + long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int *bitstream); +#else + long (*ov_read)(OggVorbis_File *vf,char *buffer,int length, int bigendianp,int word,int sgned,int *bitstream); +#endif +#ifdef OGG_USE_TREMOR + int (*ov_time_seek)(OggVorbis_File *vf,ogg_int64_t pos); +#else + int (*ov_time_seek)(OggVorbis_File *vf,double pos); +#endif +} vorbis_loader; + +extern vorbis_loader vorbis; + +#endif /* OGG_MUSIC */ + +extern int Mix_InitOgg(); +extern void Mix_QuitOgg(); diff --git a/SDL/include/effects_internal.h b/SDL/include/effects_internal.h new file mode 100644 index 0000000..c6e92ee --- /dev/null +++ b/SDL/include/effects_internal.h @@ -0,0 +1,60 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* $Id$ */ + +#ifndef _INCLUDE_EFFECTS_INTERNAL_H_ +#define _INCLUDE_EFFECTS_INTERNAL_H_ + +#ifndef __MIX_INTERNAL_EFFECT__ +#error You should not include this file or use these functions. +#endif + +#include "SDL_mixer.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +extern int _Mix_effects_max_speed; +extern void *_Eff_volume_table; +void *_Eff_build_volume_table_u8(void); +void *_Eff_build_volume_table_s8(void); + +void _Mix_InitEffects(void); +void _Mix_DeinitEffects(void); +void _Eff_PositionDeinit(void); + +int _Mix_RegisterEffect_locked(int channel, Mix_EffectFunc_t f, + Mix_EffectDone_t d, void *arg); +int _Mix_UnregisterEffect_locked(int channel, Mix_EffectFunc_t f); +int _Mix_UnregisterAllEffects_locked(int channel); + + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +} +#endif + + +#endif + diff --git a/SDL/include/fluidsynth.h b/SDL/include/fluidsynth.h new file mode 100644 index 0000000..dfccd1c --- /dev/null +++ b/SDL/include/fluidsynth.h @@ -0,0 +1,51 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + James Le Cuirot + chewi@aura-online.co.uk +*/ + +#ifndef _FLUIDSYNTH_H_ +#define _FLUIDSYNTH_H_ + +#ifdef USE_FLUIDSYNTH_MIDI + +#include "dynamic_fluidsynth.h" +#include +#include + +typedef struct { + SDL_AudioCVT convert; + fluid_synth_t *synth; + fluid_player_t* player; +} FluidSynthMidiSong; + +int fluidsynth_init(SDL_AudioSpec *mixer); +FluidSynthMidiSong *fluidsynth_loadsong_RW(SDL_RWops *rw, int freerw); +void fluidsynth_freesong(FluidSynthMidiSong *song); +void fluidsynth_start(FluidSynthMidiSong *song); +void fluidsynth_stop(FluidSynthMidiSong *song); +int fluidsynth_active(FluidSynthMidiSong *song); +void fluidsynth_setvolume(FluidSynthMidiSong *song, int volume); +int fluidsynth_playsome(FluidSynthMidiSong *song, void *stream, int len); + +#endif /* USE_FLUIDSYNTH_MIDI */ + +#endif /* _FLUIDSYNTH_H_ */ diff --git a/SDL/include/load_aiff.h b/SDL/include/load_aiff.h new file mode 100644 index 0000000..02e3cb8 --- /dev/null +++ b/SDL/include/load_aiff.h @@ -0,0 +1,33 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + This is the source needed to decode an AIFF file into a waveform. + It's pretty straightforward once you get going. The only + externally-callable function is Mix_LoadAIFF_RW(), which is meant to + act as identically to SDL_LoadWAV_RW() as possible. + + This file by Torbjörn Andersson (torbjorn.andersson@eurotime.se) +*/ + +/* $Id$ */ + +/* Don't call this directly; use Mix_LoadWAV_RW() for now. */ +SDL_AudioSpec *Mix_LoadAIFF_RW (SDL_RWops *src, int freesrc, + SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); diff --git a/SDL/include/load_flac.h b/SDL/include/load_flac.h new file mode 100644 index 0000000..f71f31e --- /dev/null +++ b/SDL/include/load_flac.h @@ -0,0 +1,31 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + This is the source needed to decode a FLAC into a waveform. + ~ Austen Dicken (admin@cvpcs.org). +*/ + +/* $Id: $ */ + +#ifdef FLAC_MUSIC +/* Don't call this directly; use Mix_LoadWAV_RW() for now. */ +SDL_AudioSpec *Mix_LoadFLAC_RW (SDL_RWops *src, int freesrc, + SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); +#endif diff --git a/SDL/include/load_ogg.h b/SDL/include/load_ogg.h new file mode 100644 index 0000000..1f05909 --- /dev/null +++ b/SDL/include/load_ogg.h @@ -0,0 +1,31 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + This is the source needed to decode an Ogg Vorbis into a waveform. + This file by Vaclav Slavik (vaclav.slavik@matfyz.cz). +*/ + +/* $Id$ */ + +#ifdef OGG_MUSIC +/* Don't call this directly; use Mix_LoadWAV_RW() for now. */ +SDL_AudioSpec *Mix_LoadOGG_RW (SDL_RWops *src, int freesrc, + SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); +#endif diff --git a/SDL/include/load_voc.h b/SDL/include/load_voc.h new file mode 100644 index 0000000..d82d76e --- /dev/null +++ b/SDL/include/load_voc.h @@ -0,0 +1,36 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + This is the source needed to decode a Creative Labs VOC file into a + waveform. It's pretty straightforward once you get going. The only + externally-callable function is Mix_LoadVOC_RW(), which is meant to + act as identically to SDL_LoadWAV_RW() as possible. + + This file by Ryan C. Gordon (icculus@icculus.org). + + Heavily borrowed from sox v12.17.1's voc.c. + (http://www.freshmeat.net/projects/sox/) +*/ + +/* $Id$ */ + +/* Don't call this directly; use Mix_LoadWAV_RW() for now. */ +SDL_AudioSpec *Mix_LoadVOC_RW (SDL_RWops *src, int freesrc, + SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len); diff --git a/SDL/include/miniz.h b/SDL/include/miniz.h new file mode 100644 index 0000000..51b37ac --- /dev/null +++ b/SDL/include/miniz.h @@ -0,0 +1,4771 @@ +/* miniz.c v1.14 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing + See "unlicense" statement at the end of this file. + Rich Geldreich , last updated May 20, 2012 + Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt + + Most API's defined in miniz.c are optional. For example, to disable the archive related functions just define + MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros). + + * Change History + 5/20/12 v1.14 - MinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE, #include (thanks fermtect). + 5/19/12 v1.13 - From jason@cornsyrup.org and kelwert@mtu.edu - Fix mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit. + Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files. + Eliminated a bunch of warnings when compiling with GCC 32-bit/64. + Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly + "Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning). + Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. + Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test. + Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. + Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.) + Fix ftell() usage in examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself). + 4/12/12 v1.12 - More comments, added low-level example5.c, fixed a couple minor level_and_flags issues in the archive API's. + level_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce Dawson for the feedback/bug report. + 5/28/11 v1.11 - Added statement from unlicense.org + 5/27/11 v1.10 - Substantial compressor optimizations: + Level 1 is now ~4x faster than before. The L1 compressor's throughput now varies between 70-110MB/sec. on a + Core i7 (actual throughput varies depending on the type of data, and x64 vs. x86). + Improved baseline L2-L9 compression perf. Also, greatly improved compression perf. issues on some file types. + Refactored the compression code for better readability and maintainability. + Added level 10 compression level (L10 has slightly better ratio than level 9, but could have a potentially large + drop in throughput on some files). + 5/15/11 v1.09 - Initial stable release. + + * Low-level Deflate/Inflate implementation notes: + + Compression: Use the "tdefl" API's. The compressor supports raw, static, and dynamic blocks, lazy or + greedy parsing, match length filtering, RLE-only, and Huffman-only streams. It performs and compresses + approximately as well as zlib. + + Decompression: Use the "tinfl" API's. The entire decompressor is implemented as a single function + coroutine: see tinfl_decompress(). It supports decompression into a 32KB (or larger power of 2) wrapping buffer, or into a memory + block large enough to hold the entire file. + + The low-level tdefl/tinfl API's do not make any use of dynamic memory allocation. + + * zlib-style API notes: + + miniz.c implements a fairly large subset of zlib. There's enough functionality present for it to be a drop-in + zlib replacement in many apps: + The z_stream struct, optional memory allocation callbacks + deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound + inflateInit/inflateInit2/inflate/inflateEnd + compress, compress2, compressBound, uncompress + CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly routines. + Supports raw deflate streams or standard zlib streams with adler-32 checking. + + Limitations: + The callback API's are not implemented yet. No support for gzip headers or zlib static dictionaries. + I've tried to closely emulate zlib's various flavors of stream flushing and return status codes, but + there are no guarantees that miniz.c pulls this off perfectly. + + * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function, originally written by + Alex Evans. Supports 1-4 bytes/pixel images. + + * ZIP archive API notes: + + The ZIP archive API's where designed with simplicity and efficiency in mind, with just enough abstraction to + get the job done with minimal fuss. There are simple API's to retrieve file information, read files from + existing archives, create new archives, append new files to existing archives, or clone archive data from + one archive to another. It supports archives located in memory or the heap, on disk (using stdio.h), + or you can specify custom file read/write callbacks. + + - Archive reading: Just call this function to read a single file from a disk archive: + + void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, + size_t *pSize, mz_uint zip_flags); + + For more complex cases, use the "mz_zip_reader" functions. Upon opening an archive, the entire central + directory is located and read as-is into memory, and subsequent file access only occurs when reading individual files. + + - Archives file scanning: The simple way is to use this function to scan a loaded archive for a specific file: + + int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); + + The locate operation can optionally check file comments too, which (as one example) can be used to identify + multiple versions of the same file in an archive. This function uses a simple linear search through the central + directory, so it's not very fast. + + Alternately, you can iterate through all the files in an archive (using mz_zip_reader_get_num_files()) and + retrieve detailed info on each file by calling mz_zip_reader_file_stat(). + + - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer immediately writes compressed file data + to disk and builds an exact image of the central directory in memory. The central directory image is written + all at once at the end of the archive file when the archive is finalized. + + The archive writer can optionally align each file's local header and file data to any power of 2 alignment, + which can be useful when the archive will be read from optical media. Also, the writer supports placing + arbitrary data blobs at the very beginning of ZIP archives. Archives written using either feature are still + readable by any ZIP tool. + + - Archive appending: The simple way to add a single file to an archive is to call this function: + + mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, + const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); + + The archive will be created if it doesn't already exist, otherwise it'll be appended to. + Note the appending is done in-place and is not an atomic operation, so if something goes wrong + during the operation it's possible the archive could be left without a central directory (although the local + file headers and file data will be fine, so the archive will be recoverable). + + For more complex archive modification scenarios: + 1. The safest way is to use a mz_zip_reader to read the existing archive, cloning only those bits you want to + preserve into a new archive using using the mz_zip_writer_add_from_zip_reader() function (which compiles the + compressed file data as-is). When you're done, delete the old archive and rename the newly written archive, and + you're done. This is safe but requires a bunch of temporary disk space or heap memory. + + 2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using mz_zip_writer_init_from_reader(), + append new files as needed, then finalize the archive which will write an updated central directory to the + original archive. (This is basically what mz_zip_add_mem_to_archive_file_in_place() does.) There's a + possibility that the archive's central directory could be lost with this method if anything goes wrong, though. + + - ZIP archive support limitations: + No zip64 or spanning support. Extraction functions can only handle unencrypted, stored or deflated files. + Requires streams capable of seeking. + + * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the + below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it. + + * Important: For best perf. be sure to customize the below macros for your target platform: + #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 + #define MINIZ_LITTLE_ENDIAN 1 + #define MINIZ_HAS_64BIT_REGISTERS 1 +*/ + +#ifndef MINIZ_HEADER_INCLUDED +#define MINIZ_HEADER_INCLUDED + +#include + +#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS) +#include +#endif + +// Defines to completely disable specific portions of miniz.c: +// If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. + +// Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. +#define MINIZ_NO_STDIO + +// If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or +// get/set file times. +#define MINIZ_NO_TIME + +// Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. +#define MINIZ_NO_ARCHIVE_APIS + +// Define MINIZ_NO_ARCHIVE_APIS to disable all writing related ZIP archive API's. +#define MINIZ_NO_ARCHIVE_WRITING_APIS + +// Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. +#define MINIZ_NO_ZLIB_APIS + +// Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. +#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES + +// Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc. +// Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc +// callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user +// functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. +//#define MINIZ_NO_MALLOC +#define MINIZ_SDL_MALLOC + +#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__) +// MINIZ_X86_OR_X64_CPU is only used to help set the below macros. +#define MINIZ_X86_OR_X64_CPU 1 +#endif + +#if (__BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU +// Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. +#define MINIZ_LITTLE_ENDIAN 1 +#endif + +#if MINIZ_X86_OR_X64_CPU +// Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 +#endif + +#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) +// Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). +#define MINIZ_HAS_64BIT_REGISTERS 1 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// ------------------- zlib-style API Definitions. + +// For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! +typedef unsigned long mz_ulong; + +// Heap allocation callbacks. +// Note that mz_alloc_func parameter types purpsosely differ from zlib's: items/size is size_t, not unsigned long. +typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size); +typedef void (*mz_free_func)(void *opaque, void *address); +typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size); + +#define MZ_ADLER32_INIT (1) +// mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. +mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len); + +#define MZ_CRC32_INIT (0) +// mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. +mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len); + +// Compression strategies. +enum { MZ_DEFAULT_STRATEGY = 0, MZ_FILTERED = 1, MZ_HUFFMAN_ONLY = 2, MZ_RLE = 3, MZ_FIXED = 4 }; + +// Method +#define MZ_DEFLATED 8 + +#ifndef MINIZ_NO_ZLIB_APIS + +#define MZ_VERSION "9.1.14" +#define MZ_VERNUM 0x91E0 +#define MZ_VER_MAJOR 9 +#define MZ_VER_MINOR 1 +#define MZ_VER_REVISION 14 +#define MZ_VER_SUBREVISION 0 + +// Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). +enum { MZ_NO_FLUSH = 0, MZ_PARTIAL_FLUSH = 1, MZ_SYNC_FLUSH = 2, MZ_FULL_FLUSH = 3, MZ_FINISH = 4, MZ_BLOCK = 5 }; + +// Return status codes. MZ_PARAM_ERROR is non-standard. +enum { MZ_OK = 0, MZ_STREAM_END = 1, MZ_NEED_DICT = 2, MZ_ERRNO = -1, MZ_STREAM_ERROR = -2, MZ_DATA_ERROR = -3, MZ_MEM_ERROR = -4, MZ_BUF_ERROR = -5, MZ_VERSION_ERROR = -6, MZ_PARAM_ERROR = -10000 }; + +// Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. +enum { MZ_NO_COMPRESSION = 0, MZ_BEST_SPEED = 1, MZ_BEST_COMPRESSION = 9, MZ_UBER_COMPRESSION = 10, MZ_DEFAULT_LEVEL = 6, MZ_DEFAULT_COMPRESSION = -1 }; + +// Window bits +#define MZ_DEFAULT_WINDOW_BITS 15 + +struct mz_internal_state; + +// Compression/decompression stream struct. +typedef struct mz_stream_s +{ + const unsigned char *next_in; // pointer to next byte to read + unsigned int avail_in; // number of bytes available at next_in + mz_ulong total_in; // total number of bytes consumed so far + + unsigned char *next_out; // pointer to next byte to write + unsigned int avail_out; // number of bytes that can be written to next_out + mz_ulong total_out; // total number of bytes produced so far + + char *msg; // error msg (unused) + struct mz_internal_state *state; // internal state, allocated by zalloc/zfree + + mz_alloc_func zalloc; // optional heap allocation function (defaults to malloc) + mz_free_func zfree; // optional heap free function (defaults to free) + void *opaque; // heap alloc function user pointer + + int data_type; // data_type (unused) + mz_ulong adler; // adler32 of the source or uncompressed data + mz_ulong reserved; // not used +} mz_stream; + +typedef mz_stream *mz_streamp; + +// Returns the version string of miniz.c. +const char *mz_version(void); + +// mz_deflateInit() initializes a compressor with default options: +// Parameters: +// pStream must point to an initialized mz_stream struct. +// level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. +// level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. +// (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) +// Return values: +// MZ_OK on success. +// MZ_STREAM_ERROR if the stream is bogus. +// MZ_PARAM_ERROR if the input parameters are bogus. +// MZ_MEM_ERROR on out of memory. +int mz_deflateInit(mz_streamp pStream, int level); + +// mz_deflateInit2() is like mz_deflate(), except with more control: +// Additional parameters: +// method must be MZ_DEFLATED +// window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) +// mem_level must be between [1, 9] (it's checked but ignored by miniz.c) +int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + +// Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). +int mz_deflateReset(mz_streamp pStream); + +// mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. +// Parameters: +// pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. +// flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. +// Return values: +// MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). +// MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. +// MZ_STREAM_ERROR if the stream is bogus. +// MZ_PARAM_ERROR if one of the parameters is invalid. +// MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) +int mz_deflate(mz_streamp pStream, int flush); + +// mz_deflateEnd() deinitializes a compressor: +// Return values: +// MZ_OK on success. +// MZ_STREAM_ERROR if the stream is bogus. +int mz_deflateEnd(mz_streamp pStream); + +// mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. +mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len); + +// Single-call compression functions mz_compress() and mz_compress2(): +// Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. +int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); +int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level); + +// mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). +mz_ulong mz_compressBound(mz_ulong source_len); + +// Initializes a decompressor. +int mz_inflateInit(mz_streamp pStream); + +// mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: +// window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). +int mz_inflateInit2(mz_streamp pStream, int window_bits); + +// Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. +// Parameters: +// pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. +// flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. +// On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). +// MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. +// Return values: +// MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. +// MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. +// MZ_STREAM_ERROR if the stream is bogus. +// MZ_DATA_ERROR if the deflate stream is invalid. +// MZ_PARAM_ERROR if one of the parameters is invalid. +// MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again +// with more input data, or with more room in the output buffer (except when using single call decompression, described above). +int mz_inflate(mz_streamp pStream, int flush); + +// Deinitializes a decompressor. +int mz_inflateEnd(mz_streamp pStream); + +// Single-call decompression. +// Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. +int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); + +// Returns a string description of the specified error code, or NULL if the error code is invalid. +const char *mz_error(int err); + +// Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. +// Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. +#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES + typedef unsigned char Byte; + typedef unsigned int uInt; + typedef mz_ulong uLong; + typedef Byte Bytef; + typedef uInt uIntf; + typedef char charf; + typedef int intf; + typedef void *voidpf; + typedef uLong uLongf; + typedef void *voidp; + typedef void *const voidpc; + #define Z_NULL 0 + #define Z_NO_FLUSH MZ_NO_FLUSH + #define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH + #define Z_SYNC_FLUSH MZ_SYNC_FLUSH + #define Z_FULL_FLUSH MZ_FULL_FLUSH + #define Z_FINISH MZ_FINISH + #define Z_BLOCK MZ_BLOCK + #define Z_OK MZ_OK + #define Z_STREAM_END MZ_STREAM_END + #define Z_NEED_DICT MZ_NEED_DICT + #define Z_ERRNO MZ_ERRNO + #define Z_STREAM_ERROR MZ_STREAM_ERROR + #define Z_DATA_ERROR MZ_DATA_ERROR + #define Z_MEM_ERROR MZ_MEM_ERROR + #define Z_BUF_ERROR MZ_BUF_ERROR + #define Z_VERSION_ERROR MZ_VERSION_ERROR + #define Z_PARAM_ERROR MZ_PARAM_ERROR + #define Z_NO_COMPRESSION MZ_NO_COMPRESSION + #define Z_BEST_SPEED MZ_BEST_SPEED + #define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION + #define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION + #define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY + #define Z_FILTERED MZ_FILTERED + #define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY + #define Z_RLE MZ_RLE + #define Z_FIXED MZ_FIXED + #define Z_DEFLATED MZ_DEFLATED + #define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS + #define alloc_func mz_alloc_func + #define free_func mz_free_func + #define internal_state mz_internal_state + #define z_stream mz_stream + #define deflateInit mz_deflateInit + #define deflateInit2 mz_deflateInit2 + #define deflateReset mz_deflateReset + #define deflate mz_deflate + #define deflateEnd mz_deflateEnd + #define deflateBound mz_deflateBound + #define compress mz_compress + #define compress2 mz_compress2 + #define compressBound mz_compressBound + #define inflateInit mz_inflateInit + #define inflateInit2 mz_inflateInit2 + #define inflate mz_inflate + #define inflateEnd mz_inflateEnd + #define uncompress mz_uncompress + #define crc32 mz_crc32 + #define adler32 mz_adler32 + #define MAX_WBITS 15 + #define MAX_MEM_LEVEL 9 + #define zError mz_error + #define ZLIB_VERSION MZ_VERSION + #define ZLIB_VERNUM MZ_VERNUM + #define ZLIB_VER_MAJOR MZ_VER_MAJOR + #define ZLIB_VER_MINOR MZ_VER_MINOR + #define ZLIB_VER_REVISION MZ_VER_REVISION + #define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION + #define zlibVersion mz_version + #define zlib_version mz_version() +#endif // #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES + +#endif // MINIZ_NO_ZLIB_APIS + +// ------------------- Types and macros + +typedef unsigned char mz_uint8; +typedef signed short mz_int16; +typedef unsigned short mz_uint16; +typedef unsigned int mz_uint32; +typedef unsigned int mz_uint; +typedef long long mz_int64; +typedef unsigned long long mz_uint64; +typedef int mz_bool; + +#define MZ_FALSE (0) +#define MZ_TRUE (1) + +// Works around MSVC's spammy "warning C4127: conditional expression is constant" message. +#ifdef _MSC_VER + #define MZ_MACRO_END while (0, 0) +#else + #define MZ_MACRO_END while (0) +#endif + +// ------------------- ZIP archive reading/writing + +#ifndef MINIZ_NO_ARCHIVE_APIS + +enum +{ + MZ_ZIP_MAX_IO_BUF_SIZE = 64*1024, + MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 260, + MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 256 +}; + +typedef struct +{ + mz_uint32 m_file_index; + mz_uint32 m_central_dir_ofs; + mz_uint16 m_version_made_by; + mz_uint16 m_version_needed; + mz_uint16 m_bit_flag; + mz_uint16 m_method; +#ifndef MINIZ_NO_TIME + time_t m_time; +#endif + mz_uint32 m_crc32; + mz_uint64 m_comp_size; + mz_uint64 m_uncomp_size; + mz_uint16 m_internal_attr; + mz_uint32 m_external_attr; + mz_uint64 m_local_header_ofs; + mz_uint32 m_comment_size; + char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE]; + char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; +} mz_zip_archive_file_stat; + +typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); +typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n); + +struct mz_zip_internal_state_tag; +typedef struct mz_zip_internal_state_tag mz_zip_internal_state; + +typedef enum +{ + MZ_ZIP_MODE_INVALID = 0, + MZ_ZIP_MODE_READING = 1, + MZ_ZIP_MODE_WRITING = 2, + MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3 +} mz_zip_mode; + +typedef struct +{ + mz_uint64 m_archive_size; + mz_uint64 m_central_directory_file_ofs; + mz_uint m_total_files; + mz_zip_mode m_zip_mode; + + mz_uint m_file_offset_alignment; + + mz_alloc_func m_pAlloc; + mz_free_func m_pFree; + mz_realloc_func m_pRealloc; + void *m_pAlloc_opaque; + + mz_file_read_func m_pRead; + mz_file_write_func m_pWrite; + void *m_pIO_opaque; + + mz_zip_internal_state *m_pState; + +} mz_zip_archive; + +typedef enum +{ + MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100, + MZ_ZIP_FLAG_IGNORE_PATH = 0x0200, + MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400, + MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800 +} mz_zip_flags; + +// ZIP archive reading + +// Inits a ZIP archive reader. +// These functions read and validate the archive's central directory. +mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint32 flags); +mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint32 flags); + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags); +#endif + +// Returns the total number of files in the archive. +mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip); + +// Returns detailed information about an archive file entry. +mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat); + +// Determines if an archive file entry is a directory entry. +mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index); +mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index); + +// Retrieves the filename of an archive file entry. +// Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. +mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size); + +// Attempts to locates a file in the archive's central directory. +// Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH +// Returns -1 if the file cannot be found. +int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); + +// Extracts a archive file to a memory buffer using no memory allocation. +mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); +mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); + +// Extracts a archive file to a memory buffer. +mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags); + +// Extracts a archive file to a dynamically allocated heap buffer. +void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags); +void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags); + +// Extracts a archive file using a callback function to output the file's data. +mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); + +#ifndef MINIZ_NO_STDIO +// Extracts a archive file to a disk file and sets its last accessed and modified times. +// This function only extracts files, not archive directory records. +mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags); +mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags); +#endif + +// Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. +mz_bool mz_zip_reader_end(mz_zip_archive *pZip); + +// ZIP archive writing + +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +// Inits a ZIP archive writer. +mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size); +mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size); + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning); +#endif + +// Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. +// For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. +// For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). +// Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. +// Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before +// the archive is finalized the file's central directory will be hosed. +mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename); + +// Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. +// To add a directory entry, call this method with an archive name ending in a forwardslash with empty buffer. +// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. +mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags); +mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); + +#ifndef MINIZ_NO_STDIO +// Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. +// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. +mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); +#endif + +// Adds a file to an archive by fully cloning the data from another archive. +// This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data, and comment fields. +mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint file_index); + +// Finalizes the archive by writing the central directory records followed by the end of central directory record. +// After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). +// An archive must be manually finalized by calling this function for it to be valid. +mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip); +mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf, size_t *pSize); + +// Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. +// Note for the archive to be valid, it must have been finalized before ending. +mz_bool mz_zip_writer_end(mz_zip_archive *pZip); + +// Misc. high-level helper functions: + +// mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. +// level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. +mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); + +// Reads a single file from an archive into a heap block. +// Returns NULL on failure. +void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint zip_flags); + +#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +#endif // #ifndef MINIZ_NO_ARCHIVE_APIS + +// ------------------- Low-level Decompression API Definitions + +// Decompression flags used by tinfl_decompress(). +// TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. +// TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. +// TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). +// TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. +enum +{ + TINFL_FLAG_PARSE_ZLIB_HEADER = 1, + TINFL_FLAG_HAS_MORE_INPUT = 2, + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, + TINFL_FLAG_COMPUTE_ADLER32 = 8 +}; + +// High level decompression functions: +// tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). +// On entry: +// pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. +// On return: +// Function returns a pointer to the decompressed data, or NULL on failure. +// *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. +// The caller must free() the returned block when it's no longer needed. +void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +// tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. +// Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. +#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) +size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +// tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. +// Returns 1 on success or 0 on failure. +typedef int (*tinfl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); +int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +struct tinfl_decompressor_tag; typedef struct tinfl_decompressor_tag tinfl_decompressor; + +// Max size of LZ dictionary. +#define TINFL_LZ_DICT_SIZE 32768 + +// Return status. +typedef enum +{ + TINFL_STATUS_BAD_PARAM = -3, + TINFL_STATUS_ADLER32_MISMATCH = -2, + TINFL_STATUS_FAILED = -1, + TINFL_STATUS_DONE = 0, + TINFL_STATUS_NEEDS_MORE_INPUT = 1, + TINFL_STATUS_HAS_MORE_OUTPUT = 2 +} tinfl_status; + +// Initializes the decompressor to its initial state. +#define tinfl_init(r) do { (r)->m_state = 0; } MZ_MACRO_END +#define tinfl_get_adler32(r) (r)->m_check_adler32 + +// Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. +// This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. +tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); + +// Internal/private bits follow. +enum +{ + TINFL_MAX_HUFF_TABLES = 3, TINFL_MAX_HUFF_SYMBOLS_0 = 288, TINFL_MAX_HUFF_SYMBOLS_1 = 32, TINFL_MAX_HUFF_SYMBOLS_2 = 19, + TINFL_FAST_LOOKUP_BITS = 10, TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS +}; + +typedef struct +{ + mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0]; + mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; +} tinfl_huff_table; + +#if MINIZ_HAS_64BIT_REGISTERS + #define TINFL_USE_64BIT_BITBUF 1 +#endif + +#if TINFL_USE_64BIT_BITBUF + typedef mz_uint64 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (64) +#else + typedef mz_uint32 tinfl_bit_buf_t; + #define TINFL_BITBUF_SIZE (32) +#endif + +struct tinfl_decompressor_tag +{ + mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; + tinfl_bit_buf_t m_bit_buf; + size_t m_dist_from_out_buf_start; + tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]; + mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; +}; + +// ------------------- Low-level Compression API Definitions + +// Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). +#define TDEFL_LESS_MEMORY 0 + +// tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): +// TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). +enum +{ + TDEFL_HUFFMAN_ONLY = 0, TDEFL_DEFAULT_MAX_PROBES = 128, TDEFL_MAX_PROBES_MASK = 0xFFF +}; + +// TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. +// TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). +// TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. +// TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). +// TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) +// TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. +// TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. +// TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. +enum +{ + TDEFL_WRITE_ZLIB_HEADER = 0x01000, + TDEFL_COMPUTE_ADLER32 = 0x02000, + TDEFL_GREEDY_PARSING_FLAG = 0x04000, + TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000, + TDEFL_RLE_MATCHES = 0x10000, + TDEFL_FILTER_MATCHES = 0x20000, + TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000, + TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000 +}; + +// High level compression functions: +// tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). +// On entry: +// pSrc_buf, src_buf_len: Pointer and size of source block to compress. +// flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. +// On return: +// Function returns a pointer to the compressed data, or NULL on failure. +// *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. +// The caller must free() the returned block when it's no longer needed. +void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +// tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. +// Returns 0 on failure. +size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +// Compresses an image to a compressed PNG file in memory. +// On entry: +// pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. +// On return: +// Function returns a pointer to the compressed data, or NULL on failure. +// *pLen_out will be set to the size of the PNG image file. +// The caller must free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. +void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int bpl, int num_chans, size_t *pLen_out); + +// Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. +typedef mz_bool (*tdefl_put_buf_func_ptr)(const void* pBuf, int len, void *pUser); + +// tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. +mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +enum { TDEFL_MAX_HUFF_TABLES = 3, TDEFL_MAX_HUFF_SYMBOLS_0 = 288, TDEFL_MAX_HUFF_SYMBOLS_1 = 32, TDEFL_MAX_HUFF_SYMBOLS_2 = 19, TDEFL_LZ_DICT_SIZE = 32768, TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1, TDEFL_MIN_MATCH_LEN = 3, TDEFL_MAX_MATCH_LEN = 258 }; + +// TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). +#if TDEFL_LESS_MEMORY +enum { TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024, TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13 ) / 10, TDEFL_MAX_HUFF_SYMBOLS = 288, TDEFL_LZ_HASH_BITS = 12, TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS }; +#else +enum { TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024, TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13 ) / 10, TDEFL_MAX_HUFF_SYMBOLS = 288, TDEFL_LZ_HASH_BITS = 15, TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS }; +#endif + +// The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. +typedef enum +{ + TDEFL_STATUS_BAD_PARAM = -2, + TDEFL_STATUS_PUT_BUF_FAILED = -1, + TDEFL_STATUS_OKAY = 0, + TDEFL_STATUS_DONE = 1, +} tdefl_status; + +// Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums +typedef enum +{ + TDEFL_NO_FLUSH = 0, + TDEFL_SYNC_FLUSH = 2, + TDEFL_FULL_FLUSH = 3, + TDEFL_FINISH = 4 +} tdefl_flush; + +// tdefl's compression state structure. +typedef struct +{ + tdefl_put_buf_func_ptr m_pPut_buf_func; + void *m_pPut_buf_user; + mz_uint m_flags, m_max_probes[2]; + int m_greedy_parsing; + mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size; + mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end; + mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer; + mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish; + tdefl_status m_prev_return_status; + const void *m_pIn_buf; + void *m_pOut_buf; + size_t *m_pIn_buf_size, *m_pOut_buf_size; + tdefl_flush m_flush; + const mz_uint8 *m_pSrc; + size_t m_src_buf_left, m_out_buf_ofs; + mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1]; + mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE]; + mz_uint16 m_next[TDEFL_LZ_DICT_SIZE]; + mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE]; + mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE]; +} tdefl_compressor; + +// Initializes the compressor. +// There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. +// pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. +// If pBut_buf_func is NULL the user should always call the tdefl_compress() API. +// flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) +tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +// Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. +tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush); + +// tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. +// tdefl_compress_buffer() always consumes the entire input buffer. +tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush); + +tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d); +mz_uint32 tdefl_get_adler32(tdefl_compressor *d); + +// Can't use tdefl_create_comp_flags_from_zip_params if MINIZ_NO_ZLIB_APIS isn't defined, because it uses some of its macros. +#ifndef MINIZ_NO_ZLIB_APIS +// Create tdefl_compress() flags given zlib-style compression parameters. +// level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) +// window_bits may be -15 (raw deflate) or 15 (zlib) +// strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED +mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy); +#endif // #ifndef MINIZ_NO_ZLIB_APIS + +#ifdef __cplusplus +} +#endif + +#endif // MINIZ_HEADER_INCLUDED + +// ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.) + +#ifndef MINIZ_HEADER_FILE_ONLY + +typedef unsigned char mz_validate_uint16[sizeof(mz_uint16)==2 ? 1 : -1]; +typedef unsigned char mz_validate_uint32[sizeof(mz_uint32)==4 ? 1 : -1]; +typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1]; + +#include +#include + +#define MZ_ASSERT(x) assert(x) + +#ifdef MINIZ_NO_MALLOC + #define MZ_MALLOC(x) NULL + #define MZ_FREE(x) (void)x, ((void)0) + #define MZ_REALLOC(p, x) NULL +#elif defined(MINIZ_SDL_MALLOC) + #define MZ_MALLOC(x) SDL_malloc(x) + #define MZ_FREE(x) SDL_free(x) + #define MZ_REALLOC(p, x) SDL_realloc(p, x) +#else + #define MZ_MALLOC(x) malloc(x) + #define MZ_FREE(x) free(x) + #define MZ_REALLOC(p, x) realloc(p, x) +#endif + +#define MZ_MAX(a,b) (((a)>(b))?(a):(b)) +#define MZ_MIN(a,b) (((a)<(b))?(a):(b)) +#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) + #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) +#else + #define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) + #define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) +#endif + +#ifdef _MSC_VER + #define MZ_FORCEINLINE __forceinline +#elif defined(__GNUC__) + #define MZ_FORCEINLINE __attribute__((__always_inline__)) +#else + #define MZ_FORCEINLINE inline +#endif + +#ifdef __cplusplus + extern "C" { +#endif + +// ------------------- zlib-style API's + +mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len) +{ + mz_uint32 i, s1 = (mz_uint32)(adler & 0xffff), s2 = (mz_uint32)(adler >> 16); size_t block_len = buf_len % 5552; + if (!ptr) return MZ_ADLER32_INIT; + while (buf_len) { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) { + s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; + } + for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; + } + return (s2 << 16) + s1; +} + +// Karl Malbrain's compact CRC-32. See "A compact CCITT crc16 and crc32 C implementation that balances processor cache usage against speed": http://www.geocities.com/malbrain/ +mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len) +{ + static const mz_uint32 s_crc32[16] = { 0, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, + 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c }; + mz_uint32 crcu32 = (mz_uint32)crc; + if (!ptr) return MZ_CRC32_INIT; + crcu32 = ~crcu32; while (buf_len--) { mz_uint8 b = *ptr++; crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b & 0xF)]; crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b >> 4)]; } + return ~crcu32; +} + +#ifndef MINIZ_NO_ZLIB_APIS + +static void *def_alloc_func(void *opaque, size_t items, size_t size) { (void)opaque, (void)items, (void)size; return MZ_MALLOC(items * size); } +static void def_free_func(void *opaque, void *address) { (void)opaque, (void)address; MZ_FREE(address); } +static void *def_realloc_func(void *opaque, void *address, size_t items, size_t size) { (void)opaque, (void)address, (void)items, (void)size; return MZ_REALLOC(address, items * size); } + +const char *mz_version(void) +{ + return MZ_VERSION; +} + +int mz_deflateInit(mz_streamp pStream, int level) +{ + return mz_deflateInit2(pStream, level, MZ_DEFLATED, MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY); +} + +int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy) +{ + tdefl_compressor *pComp; + mz_uint comp_flags = TDEFL_COMPUTE_ADLER32 | tdefl_create_comp_flags_from_zip_params(level, window_bits, strategy); + + if (!pStream) return MZ_STREAM_ERROR; + if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS))) return MZ_PARAM_ERROR; + + pStream->data_type = 0; + pStream->adler = MZ_ADLER32_INIT; + pStream->msg = NULL; + pStream->reserved = 0; + pStream->total_in = 0; + pStream->total_out = 0; + if (!pStream->zalloc) pStream->zalloc = def_alloc_func; + if (!pStream->zfree) pStream->zfree = def_free_func; + + pComp = (tdefl_compressor *)pStream->zalloc(pStream->opaque, 1, sizeof(tdefl_compressor)); + if (!pComp) + return MZ_MEM_ERROR; + + pStream->state = (struct mz_internal_state *)pComp; + + if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY) + { + mz_deflateEnd(pStream); + return MZ_PARAM_ERROR; + } + + return MZ_OK; +} + +int mz_deflateReset(mz_streamp pStream) +{ + if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree)) return MZ_STREAM_ERROR; + pStream->total_in = pStream->total_out = 0; + tdefl_init((tdefl_compressor*)pStream->state, NULL, NULL, ((tdefl_compressor*)pStream->state)->m_flags); + return MZ_OK; +} + +int mz_deflate(mz_streamp pStream, int flush) +{ + size_t in_bytes, out_bytes; + mz_ulong orig_total_in, orig_total_out; + int mz_status = MZ_OK; + + if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out)) return MZ_STREAM_ERROR; + if (!pStream->avail_out) return MZ_BUF_ERROR; + + if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH; + + if (((tdefl_compressor*)pStream->state)->m_prev_return_status == TDEFL_STATUS_DONE) + return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR; + + orig_total_in = pStream->total_in; orig_total_out = pStream->total_out; + for ( ; ; ) + { + tdefl_status defl_status; + in_bytes = pStream->avail_in; out_bytes = pStream->avail_out; + + defl_status = tdefl_compress((tdefl_compressor*)pStream->state, pStream->next_in, &in_bytes, pStream->next_out, &out_bytes, (tdefl_flush)flush); + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; pStream->adler = tdefl_get_adler32((tdefl_compressor*)pStream->state); + + pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; + pStream->total_out += (mz_uint)out_bytes; + + if (defl_status < 0) + { + mz_status = MZ_STREAM_ERROR; + break; + } + else if (defl_status == TDEFL_STATUS_DONE) + { + mz_status = MZ_STREAM_END; + break; + } + else if (!pStream->avail_out) + break; + else if ((!pStream->avail_in) && (flush != MZ_FINISH)) + { + if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out)) + break; + return MZ_BUF_ERROR; // Can't make forward progress without some input. + } + } + return mz_status; +} + +int mz_deflateEnd(mz_streamp pStream) +{ + if (!pStream) return MZ_STREAM_ERROR; + if (pStream->state) + { + pStream->zfree(pStream->opaque, pStream->state); + pStream->state = NULL; + } + return MZ_OK; +} + +mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len) +{ + (void)pStream; + // This is really over conservative. (And lame, but it's actually pretty tricky to compute a true upper bound given the way tdefl's blocking works.) + return MZ_MAX(128 + (source_len * 110) / 100, 128 + source_len + ((source_len / (31 * 1024)) + 1) * 5); +} + +int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level) +{ + int status; + mz_stream stream; + memset(&stream, 0, sizeof(stream)); + + // In case mz_ulong is 64-bits (argh I hate longs). + if ((source_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR; + + stream.next_in = pSource; + stream.avail_in = (mz_uint32)source_len; + stream.next_out = pDest; + stream.avail_out = (mz_uint32)*pDest_len; + + status = mz_deflateInit(&stream, level); + if (status != MZ_OK) return status; + + status = mz_deflate(&stream, MZ_FINISH); + if (status != MZ_STREAM_END) + { + mz_deflateEnd(&stream); + return (status == MZ_OK) ? MZ_BUF_ERROR : status; + } + + *pDest_len = stream.total_out; + return mz_deflateEnd(&stream); +} + +int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len) +{ + return mz_compress2(pDest, pDest_len, pSource, source_len, MZ_DEFAULT_COMPRESSION); +} + +mz_ulong mz_compressBound(mz_ulong source_len) +{ + return mz_deflateBound(NULL, source_len); +} + +typedef struct +{ + tinfl_decompressor m_decomp; + mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed; int m_window_bits; + mz_uint8 m_dict[TINFL_LZ_DICT_SIZE]; + tinfl_status m_last_status; +} inflate_state; + +int mz_inflateInit2(mz_streamp pStream, int window_bits) +{ + inflate_state *pDecomp; + if (!pStream) return MZ_STREAM_ERROR; + if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)) return MZ_PARAM_ERROR; + + pStream->data_type = 0; + pStream->adler = 0; + pStream->msg = NULL; + pStream->total_in = 0; + pStream->total_out = 0; + pStream->reserved = 0; + if (!pStream->zalloc) pStream->zalloc = def_alloc_func; + if (!pStream->zfree) pStream->zfree = def_free_func; + + pDecomp = (inflate_state*)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state)); + if (!pDecomp) return MZ_MEM_ERROR; + + pStream->state = (struct mz_internal_state *)pDecomp; + + tinfl_init(&pDecomp->m_decomp); + pDecomp->m_dict_ofs = 0; + pDecomp->m_dict_avail = 0; + pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT; + pDecomp->m_first_call = 1; + pDecomp->m_has_flushed = 0; + pDecomp->m_window_bits = window_bits; + + return MZ_OK; +} + +int mz_inflateInit(mz_streamp pStream) +{ + return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS); +} + +int mz_inflate(mz_streamp pStream, int flush) +{ + inflate_state* pState; + mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32; + size_t in_bytes, out_bytes, orig_avail_in; + tinfl_status status; + + if ((!pStream) || (!pStream->state)) return MZ_STREAM_ERROR; + if (flush == MZ_PARTIAL_FLUSH) flush = MZ_SYNC_FLUSH; + if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; + + pState = (inflate_state*)pStream->state; + if (pState->m_window_bits > 0) decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER; + orig_avail_in = pStream->avail_in; + + first_call = pState->m_first_call; pState->m_first_call = 0; + if (pState->m_last_status < 0) return MZ_DATA_ERROR; + + if (pState->m_has_flushed && (flush != MZ_FINISH)) return MZ_STREAM_ERROR; + pState->m_has_flushed |= (flush == MZ_FINISH); + + if ((flush == MZ_FINISH) && (first_call)) + { + // MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. + decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF; + in_bytes = pStream->avail_in; out_bytes = pStream->avail_out; + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags); + pState->m_last_status = status; + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; pStream->total_in += (mz_uint)in_bytes; + pStream->adler = tinfl_get_adler32(&pState->m_decomp); + pStream->next_out += (mz_uint)out_bytes; pStream->avail_out -= (mz_uint)out_bytes; pStream->total_out += (mz_uint)out_bytes; + + if (status < 0) + return MZ_DATA_ERROR; + else if (status != TINFL_STATUS_DONE) + { + pState->m_last_status = TINFL_STATUS_FAILED; + return MZ_BUF_ERROR; + } + return MZ_STREAM_END; + } + // flush != MZ_FINISH then we must assume there's more input. + if (flush != MZ_FINISH) decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT; + + if (pState->m_dict_avail) + { + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; + pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; + } + + for ( ; ; ) + { + in_bytes = pStream->avail_in; + out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs; + + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags); + pState->m_last_status = status; + + pStream->next_in += (mz_uint)in_bytes; pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; pStream->adler = tinfl_get_adler32(&pState->m_decomp); + + pState->m_dict_avail = (mz_uint)out_bytes; + + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; pStream->avail_out -= n; pStream->total_out += n; + pState->m_dict_avail -= n; pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + + if (status < 0) + return MZ_DATA_ERROR; // Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). + else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in)) + return MZ_BUF_ERROR; // Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. + else if (flush == MZ_FINISH) + { + // The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. + if (status == TINFL_STATUS_DONE) + return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END; + // status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. + else if (!pStream->avail_out) + return MZ_BUF_ERROR; + } + else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)) + break; + } + + return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; +} + +int mz_inflateEnd(mz_streamp pStream) +{ + if (!pStream) + return MZ_STREAM_ERROR; + if (pStream->state) + { + pStream->zfree(pStream->opaque, pStream->state); + pStream->state = NULL; + } + return MZ_OK; +} + +int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len) +{ + mz_stream stream; + int status; + memset(&stream, 0, sizeof(stream)); + + // In case mz_ulong is 64-bits (argh I hate longs). + if ((source_len | *pDest_len) > 0xFFFFFFFFU) return MZ_PARAM_ERROR; + + stream.next_in = pSource; + stream.avail_in = (mz_uint32)source_len; + stream.next_out = pDest; + stream.avail_out = (mz_uint32)*pDest_len; + + status = mz_inflateInit(&stream); + if (status != MZ_OK) + return status; + + status = mz_inflate(&stream, MZ_FINISH); + if (status != MZ_STREAM_END) + { + mz_inflateEnd(&stream); + return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR : status; + } + *pDest_len = stream.total_out; + + return mz_inflateEnd(&stream); +} + +const char *mz_error(int err) +{ + static struct { int m_err; const char *m_pDesc; } s_error_descs[] = + { + { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" }, + { MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" } + }; + mz_uint i; for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i) if (s_error_descs[i].m_err == err) return s_error_descs[i].m_pDesc; + return NULL; +} + +#endif //MINIZ_NO_ZLIB_APIS + +// ------------------- Low-level Decompression (completely independent from all compression API's) + +#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) +#define TINFL_MEMSET(p, c, l) memset(p, c, l) + +#define TINFL_CR_BEGIN switch(r->m_state) { case 0: +#define TINFL_CR_RETURN(state_index, result) do { status = result; r->m_state = state_index; goto common_exit; case state_index:; } MZ_MACRO_END +#define TINFL_CR_RETURN_FOREVER(state_index, result) do { for ( ; ; ) { TINFL_CR_RETURN(state_index, result); } } MZ_MACRO_END +#define TINFL_CR_FINISH } + +// TODO: If the caller has indicated that there's no more input, and we attempt to read beyond the input buf, then something is wrong with the input because the inflator never +// reads ahead more than it needs to. Currently TINFL_GET_BYTE() pads the end of the stream with 0's in this scenario. +#define TINFL_GET_BYTE(state_index, c) do { \ + if (pIn_buf_cur >= pIn_buf_end) { \ + for ( ; ; ) { \ + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) { \ + TINFL_CR_RETURN(state_index, TINFL_STATUS_NEEDS_MORE_INPUT); \ + if (pIn_buf_cur < pIn_buf_end) { \ + c = *pIn_buf_cur++; \ + break; \ + } \ + } else { \ + c = 0; \ + break; \ + } \ + } \ + } else c = *pIn_buf_cur++; } MZ_MACRO_END + +#define TINFL_NEED_BITS(state_index, n) do { mz_uint c; TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; } while (num_bits < (mz_uint)(n)) +#define TINFL_SKIP_BITS(state_index, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END +#define TINFL_GET_BITS(state_index, b, n) do { if (num_bits < (mz_uint)(n)) { TINFL_NEED_BITS(state_index, n); } b = bit_buf & ((1 << (n)) - 1); bit_buf >>= (n); num_bits -= (n); } MZ_MACRO_END + +// TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. +// It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a +// Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the +// bit buffer contains >=15 bits (deflate's max. Huffman code size). +#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \ + do { \ + temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ + if (temp >= 0) { \ + code_len = temp >> 9; \ + if ((code_len) && (num_bits >= code_len)) \ + break; \ + } else if (num_bits > TINFL_FAST_LOOKUP_BITS) { \ + code_len = TINFL_FAST_LOOKUP_BITS; \ + do { \ + temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \ + } while ((temp < 0) && (num_bits >= (code_len + 1))); if (temp >= 0) break; \ + } TINFL_GET_BYTE(state_index, c); bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); num_bits += 8; \ + } while (num_bits < 15); + +// TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read +// beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully +// decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. +// The slow path is only executed at the very end of the input buffer. +#define TINFL_HUFF_DECODE(state_index, sym, pHuff) do { \ + int temp; mz_uint code_len, c; \ + if (num_bits < 15) { \ + if ((pIn_buf_end - pIn_buf_cur) < 2) { \ + TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \ + } else { \ + bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); pIn_buf_cur += 2; num_bits += 16; \ + } \ + } \ + if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ + code_len = temp >> 9, temp &= 511; \ + else { \ + code_len = TINFL_FAST_LOOKUP_BITS; do { temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; } while (temp < 0); \ + } sym = temp; bit_buf >>= code_len; num_bits -= code_len; } MZ_MACRO_END + +tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) +{ + static const int s_length_base[31] = { 3,4,5,6,7,8,9,10,11,13, 15,17,19,23,27,31,35,43,51,59, 67,83,99,115,131,163,195,227,258,0,0 }; + static const int s_length_extra[31]= { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 }; + static const int s_dist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193, 257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0}; + static const int s_dist_extra[32] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13}; + static const mz_uint8 s_length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 }; + static const int s_min_table_sizes[3] = { 257, 1, 4 }; + + tinfl_status status = TINFL_STATUS_FAILED; mz_uint32 num_bits, dist, counter, num_extra; tinfl_bit_buf_t bit_buf; + const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; + mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size; + size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; + + // Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). + if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) { *pIn_buf_size = *pOut_buf_size = 0; return TINFL_STATUS_BAD_PARAM; } + + num_bits = r->m_num_bits; bit_buf = r->m_bit_buf; dist = r->m_dist; counter = r->m_counter; num_extra = r->m_num_extra; dist_from_out_buf_start = r->m_dist_from_out_buf_start; + TINFL_CR_BEGIN + + bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; r->m_z_adler32 = r->m_check_adler32 = 1; + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_GET_BYTE(1, r->m_zhdr0); TINFL_GET_BYTE(2, r->m_zhdr1); + counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); + if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4))))); + if (counter) { TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); } + } + + do + { + TINFL_GET_BITS(3, r->m_final, 3); r->m_type = r->m_final >> 1; + if (r->m_type == 0) + { + TINFL_SKIP_BITS(5, num_bits & 7); + for (counter = 0; counter < 4; ++counter) { if (num_bits) TINFL_GET_BITS(6, r->m_raw_header[counter], 8); else TINFL_GET_BYTE(7, r->m_raw_header[counter]); } + if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) { TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); } + while ((counter) && (num_bits)) + { + TINFL_GET_BITS(51, dist, 8); + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)dist; + counter--; + } + while (counter) + { + size_t n; while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); } + while (pIn_buf_cur >= pIn_buf_end) + { + if (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) + { + TINFL_CR_RETURN(38, TINFL_STATUS_NEEDS_MORE_INPUT); + } + else + { + TINFL_CR_RETURN_FOREVER(40, TINFL_STATUS_FAILED); + } + } + n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); + TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); pIn_buf_cur += n; pOut_buf_cur += n; counter -= (mz_uint)n; + } + } + else if (r->m_type == 3) + { + TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); + } + else + { + if (r->m_type == 1) + { + mz_uint8 *p = r->m_tables[0].m_code_size; mz_uint i; + r->m_table_sizes[0] = 288; r->m_table_sizes[1] = 32; TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32); + for ( i = 0; i <= 143; ++i) *p++ = 8; for ( ; i <= 255; ++i) *p++ = 9; for ( ; i <= 279; ++i) *p++ = 7; for ( ; i <= 287; ++i) *p++ = 8; + } + else + { + for (counter = 0; counter < 3; counter++) { TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); r->m_table_sizes[counter] += s_min_table_sizes[counter]; } + MZ_CLEAR_OBJ(r->m_tables[2].m_code_size); for (counter = 0; counter < r->m_table_sizes[2]; counter++) { mz_uint s; TINFL_GET_BITS(14, s, 3); r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s; } + r->m_table_sizes[2] = 19; + } + for ( ; (int)r->m_type >= 0; r->m_type--) + { + int tree_next, tree_cur; tinfl_huff_table *pTable; + mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; pTable = &r->m_tables[r->m_type]; MZ_CLEAR_OBJ(total_syms); MZ_CLEAR_OBJ(pTable->m_look_up); MZ_CLEAR_OBJ(pTable->m_tree); + for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) total_syms[pTable->m_code_size[i]]++; + used_syms = 0, total = 0; next_code[0] = next_code[1] = 0; + for (i = 1; i <= 15; ++i) { used_syms += total_syms[i]; next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); } + if ((65536 != total) && (used_syms > 1)) + { + TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); + } + for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) + { + mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index]; if (!code_size) continue; + cur_code = next_code[code_size]++; for (l = code_size; l > 0; l--, cur_code >>= 1) rev_code = (rev_code << 1) | (cur_code & 1); + if (code_size <= TINFL_FAST_LOOKUP_BITS) { mz_int16 k = (mz_int16)((code_size << 9) | sym_index); while (rev_code < TINFL_FAST_LOOKUP_SIZE) { pTable->m_look_up[rev_code] = k; rev_code += (1 << code_size); } continue; } + if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) { pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } + rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); + for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) + { + tree_cur -= ((rev_code >>= 1) & 1); + if (!pTable->m_tree[-tree_cur - 1]) { pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next; tree_cur = tree_next; tree_next -= 2; } else tree_cur = pTable->m_tree[-tree_cur - 1]; + } + tree_cur -= ((rev_code >>= 1) & 1); pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index; + } + if (r->m_type == 2) + { + for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]); ) + { + mz_uint s; TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]); if (dist < 16) { r->m_len_codes[counter++] = (mz_uint8)dist; continue; } + if ((dist == 16) && (!counter)) + { + TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); + } + num_extra = "\02\03\07"[dist - 16]; TINFL_GET_BITS(18, s, num_extra); s += "\03\03\013"[dist - 16]; + TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); counter += s; + } + if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) + { + TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); + } + TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]); TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); + } + } + for ( ; ; ) + { + mz_uint8 *pSrc; + for ( ; ; ) + { + if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) + { + TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]); + if (counter >= 256) + break; + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = (mz_uint8)counter; + } + else + { + int sym2; mz_uint code_len; +#if TINFL_USE_64BIT_BITBUF + if (num_bits < 30) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); pIn_buf_cur += 4; num_bits += 32; } +#else + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + counter = sym2; bit_buf >>= code_len; num_bits -= code_len; + if (counter & 256) + break; + +#if !TINFL_USE_64BIT_BITBUF + if (num_bits < 15) { bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); pIn_buf_cur += 2; num_bits += 16; } +#endif + if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; do { sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)]; } while (sym2 < 0); + } + bit_buf >>= code_len; num_bits -= code_len; + + pOut_buf_cur[0] = (mz_uint8)counter; + if (sym2 & 256) + { + pOut_buf_cur++; + counter = sym2; + break; + } + pOut_buf_cur[1] = (mz_uint8)sym2; + pOut_buf_cur += 2; + } + } + if ((counter &= 511) == 256) break; + + num_extra = s_length_extra[counter - 257]; counter = s_length_base[counter - 257]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(25, extra_bits, num_extra); counter += extra_bits; } + + TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]); + num_extra = s_dist_extra[dist]; dist = s_dist_base[dist]; + if (num_extra) { mz_uint extra_bits; TINFL_GET_BITS(27, extra_bits, num_extra); dist += extra_bits; } + + dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; + if ((dist > dist_from_out_buf_start) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) + { + TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); + } + + pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); + + if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) + { + while (counter--) + { + while (pOut_buf_cur >= pOut_buf_end) { TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); } + *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; + } + continue; + } +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES + else if ((counter >= 9) && (counter <= dist)) + { + const mz_uint8 *pSrc_end = pSrc + (counter & ~7); + do + { + ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; + ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; + pOut_buf_cur += 8; + } while ((pSrc += 8) < pSrc_end); + if ((counter &= 7) < 3) + { + if (counter) + { + pOut_buf_cur[0] = pSrc[0]; + if (counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + continue; + } + } +#endif + do + { + pOut_buf_cur[0] = pSrc[0]; + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur[2] = pSrc[2]; + pOut_buf_cur += 3; pSrc += 3; + } while ((int)(counter -= 3) > 2); + if ((int)counter > 0) + { + pOut_buf_cur[0] = pSrc[0]; + if ((int)counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + } + } + } while (!(r->m_final & 1)); + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_SKIP_BITS(32, num_bits & 7); for (counter = 0; counter < 4; ++counter) { mz_uint s; if (num_bits) TINFL_GET_BITS(41, s, 8); else TINFL_GET_BYTE(42, s); r->m_z_adler32 = (r->m_z_adler32 << 8) | s; } + } + TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); + TINFL_CR_FINISH + +common_exit: + r->m_num_bits = num_bits; r->m_bit_buf = bit_buf; r->m_dist = dist; r->m_counter = counter; r->m_num_extra = num_extra; r->m_dist_from_out_buf_start = dist_from_out_buf_start; + *pIn_buf_size = pIn_buf_cur - pIn_buf_next; *pOut_buf_size = pOut_buf_cur - pOut_buf_next; + if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) + { + const mz_uint8 *ptr = pOut_buf_next; size_t buf_len = *pOut_buf_size; + mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; size_t block_len = buf_len % 5552; + while (buf_len) + { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) + { + s1 += ptr[0], s2 += s1; s1 += ptr[1], s2 += s1; s1 += ptr[2], s2 += s1; s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; s1 += ptr[5], s2 += s1; s1 += ptr[6], s2 += s1; s1 += ptr[7], s2 += s1; + } + for ( ; i < block_len; ++i) s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; buf_len -= block_len; block_len = 5552; + } + r->m_check_adler32 = (s2 << 16) + s1; if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) status = TINFL_STATUS_ADLER32_MISMATCH; + } + return status; +} + +// Higher level helper functions. +void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) +{ + tinfl_decompressor decomp; void *pBuf = NULL, *pNew_buf; size_t src_buf_ofs = 0, out_buf_capacity = 0; + *pOut_len = 0; + tinfl_init(&decomp); + for ( ; ; ) + { + size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity; + tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8*)pBuf, pBuf ? (mz_uint8*)pBuf + *pOut_len : NULL, &dst_buf_size, + (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) + { + MZ_FREE(pBuf); *pOut_len = 0; return NULL; + } + src_buf_ofs += src_buf_size; + *pOut_len += dst_buf_size; + if (status == TINFL_STATUS_DONE) break; + new_out_buf_capacity = out_buf_capacity * 2; if (new_out_buf_capacity < 128) new_out_buf_capacity = 128; + pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity); + if (!pNew_buf) + { + MZ_FREE(pBuf); *pOut_len = 0; return NULL; + } + pBuf = pNew_buf; out_buf_capacity = new_out_buf_capacity; + } + return pBuf; +} + +size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) +{ + tinfl_decompressor decomp; tinfl_status status; tinfl_init(&decomp); + status = tinfl_decompress(&decomp, (const mz_uint8*)pSrc_buf, &src_buf_len, (mz_uint8*)pOut_buf, (mz_uint8*)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len; +} + +int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + int result = 0; + tinfl_decompressor decomp; + mz_uint8 *pDict = (mz_uint8*)MZ_MALLOC(TINFL_LZ_DICT_SIZE); size_t in_buf_ofs = 0, dict_ofs = 0; + if (!pDict) + return TINFL_STATUS_FAILED; + tinfl_init(&decomp); + for ( ; ; ) + { + size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs; + tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8*)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size, + (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); + in_buf_ofs += in_buf_size; + if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user))) + break; + if (status != TINFL_STATUS_HAS_MORE_OUTPUT) + { + result = (status == TINFL_STATUS_DONE); + break; + } + dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1); + } + MZ_FREE(pDict); + *pIn_buf_size = in_buf_ofs; + return result; +} + +// ------------------- Low-level Compression (independent from all decompression API's) + +// Purposely making these tables static for faster init and thread safety. +static const mz_uint16 s_tdefl_len_sym[256] = { + 257,258,259,260,261,262,263,264,265,265,266,266,267,267,268,268,269,269,269,269,270,270,270,270,271,271,271,271,272,272,272,272, + 273,273,273,273,273,273,273,273,274,274,274,274,274,274,274,274,275,275,275,275,275,275,275,275,276,276,276,276,276,276,276,276, + 277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,277,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278,278, + 279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,279,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280,280, + 281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281,281, + 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282, + 283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283,283, + 284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,285 }; + +static const mz_uint8 s_tdefl_len_extra[256] = { + 0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3, + 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0 }; + +static const mz_uint8 s_tdefl_small_dist_sym[512] = { + 0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11, + 11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14, + 14,14,14,14,14,14,14,14,14,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15, + 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, + 16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17, + 17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17 }; + +static const mz_uint8 s_tdefl_small_dist_extra[512] = { + 0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7 }; + +static const mz_uint8 s_tdefl_large_dist_sym[128] = { + 0,0,18,19,20,20,21,21,22,22,22,22,23,23,23,23,24,24,24,24,24,24,24,24,25,25,25,25,25,25,25,25,26,26,26,26,26,26,26,26,26,26,26,26, + 26,26,26,26,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28, + 28,28,28,28,28,28,28,28,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29 }; + +static const mz_uint8 s_tdefl_large_dist_extra[128] = { + 0,0,8,8,9,9,9,9,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12, + 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13, + 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13 }; + +// Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted values. +typedef struct { mz_uint16 m_key, m_sym_index; } tdefl_sym_freq; +static tdefl_sym_freq* tdefl_radix_sort_syms(mz_uint num_syms, tdefl_sym_freq* pSyms0, tdefl_sym_freq* pSyms1) +{ + mz_uint32 total_passes = 2, pass_shift, pass, i, hist[256 * 2]; tdefl_sym_freq* pCur_syms = pSyms0, *pNew_syms = pSyms1; MZ_CLEAR_OBJ(hist); + for (i = 0; i < num_syms; i++) { mz_uint freq = pSyms0[i].m_key; hist[freq & 0xFF]++; hist[256 + ((freq >> 8) & 0xFF)]++; } + while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256])) total_passes--; + for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8) + { + const mz_uint32* pHist = &hist[pass << 8]; + mz_uint offsets[256], cur_ofs = 0; + for (i = 0; i < 256; i++) { offsets[i] = cur_ofs; cur_ofs += pHist[i]; } + for (i = 0; i < num_syms; i++) pNew_syms[offsets[(pCur_syms[i].m_key >> pass_shift) & 0xFF]++] = pCur_syms[i]; + { tdefl_sym_freq* t = pCur_syms; pCur_syms = pNew_syms; pNew_syms = t; } + } + return pCur_syms; +} + +// tdefl_calculate_minimum_redundancy() originally written by: Alistair Moffat, alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996. +static void tdefl_calculate_minimum_redundancy(tdefl_sym_freq *A, int n) +{ + int root, leaf, next, avbl, used, dpth; + if (n==0) return; else if (n==1) { A[0].m_key = 1; return; } + A[0].m_key += A[1].m_key; root = 0; leaf = 2; + for (next=1; next < n-1; next++) + { + if (leaf>=n || A[root].m_key=n || (root=0; next--) A[next].m_key = A[A[next].m_key].m_key+1; + avbl = 1; used = dpth = 0; root = n-2; next = n-1; + while (avbl>0) + { + while (root>=0 && (int)A[root].m_key==dpth) { used++; root--; } + while (avbl>used) { A[next--].m_key = (mz_uint16)(dpth); avbl--; } + avbl = 2*used; dpth++; used = 0; + } +} + +// Limits canonical Huffman code table's max code size. +enum { TDEFL_MAX_SUPPORTED_HUFF_CODESIZE = 32 }; +static void tdefl_huffman_enforce_max_code_size(int *pNum_codes, int code_list_len, int max_code_size) +{ + int i; mz_uint32 total = 0; if (code_list_len <= 1) return; + for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++) pNum_codes[max_code_size] += pNum_codes[i]; + for (i = max_code_size; i > 0; i--) total += (((mz_uint32)pNum_codes[i]) << (max_code_size - i)); + while (total != (1UL << max_code_size)) + { + pNum_codes[max_code_size]--; + for (i = max_code_size - 1; i > 0; i--) if (pNum_codes[i]) { pNum_codes[i]--; pNum_codes[i + 1] += 2; break; } + total--; + } +} + +static void tdefl_optimize_huffman_table(tdefl_compressor *d, int table_num, int table_len, int code_size_limit, int static_table) +{ + int i, j, l, num_codes[1 + TDEFL_MAX_SUPPORTED_HUFF_CODESIZE]; mz_uint next_code[TDEFL_MAX_SUPPORTED_HUFF_CODESIZE + 1]; MZ_CLEAR_OBJ(num_codes); + if (static_table) + { + for (i = 0; i < table_len; i++) num_codes[d->m_huff_code_sizes[table_num][i]]++; + } + else + { + tdefl_sym_freq syms0[TDEFL_MAX_HUFF_SYMBOLS], syms1[TDEFL_MAX_HUFF_SYMBOLS], *pSyms; + int num_used_syms = 0; + const mz_uint16 *pSym_count = &d->m_huff_count[table_num][0]; + for (i = 0; i < table_len; i++) if (pSym_count[i]) { syms0[num_used_syms].m_key = (mz_uint16)pSym_count[i]; syms0[num_used_syms++].m_sym_index = (mz_uint16)i; } + + pSyms = tdefl_radix_sort_syms(num_used_syms, syms0, syms1); tdefl_calculate_minimum_redundancy(pSyms, num_used_syms); + + for (i = 0; i < num_used_syms; i++) num_codes[pSyms[i].m_key]++; + + tdefl_huffman_enforce_max_code_size(num_codes, num_used_syms, code_size_limit); + + MZ_CLEAR_OBJ(d->m_huff_code_sizes[table_num]); MZ_CLEAR_OBJ(d->m_huff_codes[table_num]); + for (i = 1, j = num_used_syms; i <= code_size_limit; i++) + for (l = num_codes[i]; l > 0; l--) d->m_huff_code_sizes[table_num][pSyms[--j].m_sym_index] = (mz_uint8)(i); + } + + next_code[1] = 0; for (j = 0, i = 2; i <= code_size_limit; i++) next_code[i] = j = ((j + num_codes[i - 1]) << 1); + + for (i = 0; i < table_len; i++) + { + mz_uint rev_code = 0, code, code_size; if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0) continue; + code = next_code[code_size]++; for (l = code_size; l > 0; l--, code >>= 1) rev_code = (rev_code << 1) | (code & 1); + d->m_huff_codes[table_num][i] = (mz_uint16)rev_code; + } +} + +#define TDEFL_PUT_BITS(b, l) do { \ + mz_uint bits = b; mz_uint len = l; MZ_ASSERT(bits <= ((1U << len) - 1U)); \ + d->m_bit_buffer |= (bits << d->m_bits_in); d->m_bits_in += len; \ + while (d->m_bits_in >= 8) { \ + if (d->m_pOutput_buf < d->m_pOutput_buf_end) \ + *d->m_pOutput_buf++ = (mz_uint8)(d->m_bit_buffer); \ + d->m_bit_buffer >>= 8; \ + d->m_bits_in -= 8; \ + } \ +} MZ_MACRO_END + +#define TDEFL_RLE_PREV_CODE_SIZE() { if (rle_repeat_count) { \ + if (rle_repeat_count < 3) { \ + d->m_huff_count[2][prev_code_size] = (mz_uint16)(d->m_huff_count[2][prev_code_size] + rle_repeat_count); \ + while (rle_repeat_count--) packed_code_sizes[num_packed_code_sizes++] = prev_code_size; \ + } else { \ + d->m_huff_count[2][16] = (mz_uint16)(d->m_huff_count[2][16] + 1); packed_code_sizes[num_packed_code_sizes++] = 16; packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_repeat_count - 3); \ +} rle_repeat_count = 0; } } + +#define TDEFL_RLE_ZERO_CODE_SIZE() { if (rle_z_count) { \ + if (rle_z_count < 3) { \ + d->m_huff_count[2][0] = (mz_uint16)(d->m_huff_count[2][0] + rle_z_count); while (rle_z_count--) packed_code_sizes[num_packed_code_sizes++] = 0; \ + } else if (rle_z_count <= 10) { \ + d->m_huff_count[2][17] = (mz_uint16)(d->m_huff_count[2][17] + 1); packed_code_sizes[num_packed_code_sizes++] = 17; packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 3); \ + } else { \ + d->m_huff_count[2][18] = (mz_uint16)(d->m_huff_count[2][18] + 1); packed_code_sizes[num_packed_code_sizes++] = 18; packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 11); \ +} rle_z_count = 0; } } + +static mz_uint8 s_tdefl_packed_code_size_syms_swizzle[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + +static void tdefl_start_dynamic_block(tdefl_compressor *d) +{ + int num_lit_codes, num_dist_codes, num_bit_lengths; mz_uint i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index; + mz_uint8 code_sizes_to_pack[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], packed_code_sizes[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], prev_code_size = 0xFF; + + d->m_huff_count[0][256] = 1; + + tdefl_optimize_huffman_table(d, 0, TDEFL_MAX_HUFF_SYMBOLS_0, 15, MZ_FALSE); + tdefl_optimize_huffman_table(d, 1, TDEFL_MAX_HUFF_SYMBOLS_1, 15, MZ_FALSE); + + for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--) if (d->m_huff_code_sizes[0][num_lit_codes - 1]) break; + for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--) if (d->m_huff_code_sizes[1][num_dist_codes - 1]) break; + + memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes); + memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0], num_dist_codes); + total_code_sizes_to_pack = num_lit_codes + num_dist_codes; num_packed_code_sizes = 0; rle_z_count = 0; rle_repeat_count = 0; + + memset(&d->m_huff_count[2][0], 0, sizeof(d->m_huff_count[2][0]) * TDEFL_MAX_HUFF_SYMBOLS_2); + for (i = 0; i < total_code_sizes_to_pack; i++) + { + mz_uint8 code_size = code_sizes_to_pack[i]; + if (!code_size) + { + TDEFL_RLE_PREV_CODE_SIZE(); + if (++rle_z_count == 138) { TDEFL_RLE_ZERO_CODE_SIZE(); } + } + else + { + TDEFL_RLE_ZERO_CODE_SIZE(); + if (code_size != prev_code_size) + { + TDEFL_RLE_PREV_CODE_SIZE(); + d->m_huff_count[2][code_size] = (mz_uint16)(d->m_huff_count[2][code_size] + 1); packed_code_sizes[num_packed_code_sizes++] = code_size; + } + else if (++rle_repeat_count == 6) + { + TDEFL_RLE_PREV_CODE_SIZE(); + } + } + prev_code_size = code_size; + } + if (rle_repeat_count) { TDEFL_RLE_PREV_CODE_SIZE(); } else { TDEFL_RLE_ZERO_CODE_SIZE(); } + + tdefl_optimize_huffman_table(d, 2, TDEFL_MAX_HUFF_SYMBOLS_2, 7, MZ_FALSE); + + TDEFL_PUT_BITS(2, 2); + + TDEFL_PUT_BITS(num_lit_codes - 257, 5); + TDEFL_PUT_BITS(num_dist_codes - 1, 5); + + for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--) if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]]) break; + num_bit_lengths = MZ_MAX(4, (num_bit_lengths + 1)); TDEFL_PUT_BITS(num_bit_lengths - 4, 4); + for (i = 0; (int)i < num_bit_lengths; i++) TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3); + + for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes; ) + { + mz_uint code = packed_code_sizes[packed_code_sizes_index++]; MZ_ASSERT(code < TDEFL_MAX_HUFF_SYMBOLS_2); + TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]); + if (code >= 16) TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]); + } +} + +static void tdefl_start_static_block(tdefl_compressor *d) +{ + mz_uint i; + mz_uint8 *p = &d->m_huff_code_sizes[0][0]; + + for (i = 0; i <= 143; ++i) *p++ = 8; + for ( ; i <= 255; ++i) *p++ = 9; + for ( ; i <= 279; ++i) *p++ = 7; + for ( ; i <= 287; ++i) *p++ = 8; + + memset(d->m_huff_code_sizes[1], 5, 32); + + tdefl_optimize_huffman_table(d, 0, 288, 15, MZ_TRUE); + tdefl_optimize_huffman_table(d, 1, 32, 15, MZ_TRUE); + + TDEFL_PUT_BITS(1, 2); +} + +static const mz_uint mz_bitmasks[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS +static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) +{ + mz_uint flags; + mz_uint8 *pLZ_codes; + mz_uint8 *pOutput_buf = d->m_pOutput_buf; + mz_uint8 *pLZ_code_buf_end = d->m_pLZ_code_buf; + mz_uint64 bit_buffer = d->m_bit_buffer; + mz_uint bits_in = d->m_bits_in; + +#define TDEFL_PUT_BITS_FAST(b, l) { bit_buffer |= (((mz_uint64)(b)) << bits_in); bits_in += (l); } + + flags = 1; + for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < pLZ_code_buf_end; flags >>= 1) + { + if (flags == 1) + flags = *pLZ_codes++ | 0x100; + + if (flags & 1) + { + mz_uint s0, s1, n0, n1, sym, num_extra_bits; + mz_uint match_len = pLZ_codes[0], match_dist = *(const mz_uint16 *)(pLZ_codes + 1); pLZ_codes += 3; + + MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS_FAST(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]); + + // This sequence coaxes MSVC into using cmov's vs. jmp's. + s0 = s_tdefl_small_dist_sym[match_dist & 511]; + n0 = s_tdefl_small_dist_extra[match_dist & 511]; + s1 = s_tdefl_large_dist_sym[match_dist >> 8]; + n1 = s_tdefl_large_dist_extra[match_dist >> 8]; + sym = (match_dist < 512) ? s0 : s1; + num_extra_bits = (match_dist < 512) ? n0 : n1; + + MZ_ASSERT(d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS_FAST(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits); + } + else + { + mz_uint lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + + if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) + { + flags >>= 1; + lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + + if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) + { + flags >>= 1; + lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + } + } + } + + if (pOutput_buf >= d->m_pOutput_buf_end) + return MZ_FALSE; + + *(mz_uint64*)pOutput_buf = bit_buffer; + pOutput_buf += (bits_in >> 3); + bit_buffer >>= (bits_in & ~7); + bits_in &= 7; + } + +#undef TDEFL_PUT_BITS_FAST + + d->m_pOutput_buf = pOutput_buf; + d->m_bits_in = 0; + d->m_bit_buffer = 0; + + while (bits_in) + { + mz_uint32 n = MZ_MIN(bits_in, 16); + TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n); + bit_buffer >>= n; + bits_in -= n; + } + + TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]); + + return (d->m_pOutput_buf < d->m_pOutput_buf_end); +} +#else +static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) +{ + mz_uint flags; + mz_uint8 *pLZ_codes; + + flags = 1; + for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1) + { + if (flags == 1) + flags = *pLZ_codes++ | 0x100; + if (flags & 1) + { + mz_uint sym, num_extra_bits; + mz_uint match_len = pLZ_codes[0], match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8)); pLZ_codes += 3; + + MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]); + + if (match_dist < 512) + { + sym = s_tdefl_small_dist_sym[match_dist]; num_extra_bits = s_tdefl_small_dist_extra[match_dist]; + } + else + { + sym = s_tdefl_large_dist_sym[match_dist >> 8]; num_extra_bits = s_tdefl_large_dist_extra[match_dist >> 8]; + } + MZ_ASSERT(d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits); + } + else + { + mz_uint lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + } + } + + TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]); + + return (d->m_pOutput_buf < d->m_pOutput_buf_end); +} +#endif // MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS + +static mz_bool tdefl_compress_block(tdefl_compressor *d, mz_bool static_block) +{ + if (static_block) + tdefl_start_static_block(d); + else + tdefl_start_dynamic_block(d); + return tdefl_compress_lz_codes(d); +} + +static int tdefl_flush_block(tdefl_compressor *d, int flush) +{ + mz_uint saved_bit_buf, saved_bits_in; + mz_uint8 *pSaved_output_buf; + mz_bool comp_block_succeeded = MZ_FALSE; + int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size; + mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf; + + d->m_pOutput_buf = pOutput_buf_start; + d->m_pOutput_buf_end = d->m_pOutput_buf + TDEFL_OUT_BUF_SIZE - 16; + + MZ_ASSERT(!d->m_output_flush_remaining); + d->m_output_flush_ofs = 0; + d->m_output_flush_remaining = 0; + + *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> d->m_num_flags_left); + d->m_pLZ_code_buf -= (d->m_num_flags_left == 8); + + if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index)) + { + TDEFL_PUT_BITS(0x78, 8); TDEFL_PUT_BITS(0x01, 8); + } + + TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1); + + pSaved_output_buf = d->m_pOutput_buf; saved_bit_buf = d->m_bit_buffer; saved_bits_in = d->m_bits_in; + + if (!use_raw_block) + comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48)); + + // If the block gets expanded, forget the current contents of the output buffer and send a raw block instead. + if ( ((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) && + ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size) ) + { + mz_uint i; d->m_pOutput_buf = pSaved_output_buf; d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in; + TDEFL_PUT_BITS(0, 2); + if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } + for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF) + { + TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16); + } + for (i = 0; i < d->m_total_lz_bytes; ++i) + { + TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8); + } + } + // Check for the extremely unlikely (if not impossible) case of the compressed block not fitting into the output buffer when using dynamic codes. + else if (!comp_block_succeeded) + { + d->m_pOutput_buf = pSaved_output_buf; d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in; + tdefl_compress_block(d, MZ_TRUE); + } + + if (flush) + { + if (flush == TDEFL_FINISH) + { + if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } + if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER) { mz_uint i, a = d->m_adler32; for (i = 0; i < 4; i++) { TDEFL_PUT_BITS((a >> 24) & 0xFF, 8); a <<= 8; } } + } + else + { + mz_uint i, z = 0; TDEFL_PUT_BITS(0, 3); if (d->m_bits_in) { TDEFL_PUT_BITS(0, 8 - d->m_bits_in); } for (i = 2; i; --i, z ^= 0xFFFF) { TDEFL_PUT_BITS(z & 0xFFFF, 16); } + } + } + + MZ_ASSERT(d->m_pOutput_buf < d->m_pOutput_buf_end); + + memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); + memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); + + d->m_pLZ_code_buf = d->m_lz_code_buf + 1; d->m_pLZ_flags = d->m_lz_code_buf; d->m_num_flags_left = 8; d->m_lz_code_buf_dict_pos += d->m_total_lz_bytes; d->m_total_lz_bytes = 0; d->m_block_index++; + + if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0) + { + if (d->m_pPut_buf_func) + { + *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf; + if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user)) + return (d->m_prev_return_status = TDEFL_STATUS_PUT_BUF_FAILED); + } + else if (pOutput_buf_start == d->m_output_buf) + { + int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs)); + memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf, bytes_to_copy); + d->m_out_buf_ofs += bytes_to_copy; + if ((n -= bytes_to_copy) != 0) + { + d->m_output_flush_ofs = bytes_to_copy; + d->m_output_flush_remaining = n; + } + } + else + { + d->m_out_buf_ofs += n; + } + } + + return d->m_output_flush_remaining; +} + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES +#define TDEFL_READ_UNALIGNED_WORD(p) *(const mz_uint16*)(p) +static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) +{ + mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len; + mz_uint num_probes_left = d->m_max_probes[match_len >= 32]; + const mz_uint16 *s = (const mz_uint16*)(d->m_dict + pos), *p, *q; + mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]), s01 = TDEFL_READ_UNALIGNED_WORD(s); + MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); if (max_match_len <= match_len) return; + for ( ; ; ) + { + for ( ; ; ) + { + if (--num_probes_left == 0) return; + #define TDEFL_PROBE \ + next_probe_pos = d->m_next[probe_pos]; \ + if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) return; \ + probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \ + if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) break; + TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE; + } + if (!dist) break; q = (const mz_uint16*)(d->m_dict + probe_pos); if (TDEFL_READ_UNALIGNED_WORD(q) != s01) continue; p = s; probe_len = 32; + do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && + (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) ); + if (!probe_len) + { + *pMatch_dist = dist; *pMatch_len = MZ_MIN(max_match_len, TDEFL_MAX_MATCH_LEN); break; + } + else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8*)p == *(const mz_uint8*)q)) > match_len) + { + *pMatch_dist = dist; if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len) break; + c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]); + } + } +} +#else +static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) +{ + mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len; + mz_uint num_probes_left = d->m_max_probes[match_len >= 32]; + const mz_uint8 *s = d->m_dict + pos, *p, *q; + mz_uint8 c0 = d->m_dict[pos + match_len], c1 = d->m_dict[pos + match_len - 1]; + MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); if (max_match_len <= match_len) return; + for ( ; ; ) + { + for ( ; ; ) + { + if (--num_probes_left == 0) return; + #define TDEFL_PROBE \ + next_probe_pos = d->m_next[probe_pos]; \ + if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) return; \ + probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \ + if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) break; + TDEFL_PROBE; TDEFL_PROBE; TDEFL_PROBE; + } + if (!dist) break; p = s; q = d->m_dict + probe_pos; for (probe_len = 0; probe_len < max_match_len; probe_len++) if (*p++ != *q++) break; + if (probe_len > match_len) + { + *pMatch_dist = dist; if ((*pMatch_len = match_len = probe_len) == max_match_len) return; + c0 = d->m_dict[pos + match_len]; c1 = d->m_dict[pos + match_len - 1]; + } + } +} +#endif // #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN +static mz_bool tdefl_compress_fast(tdefl_compressor *d) +{ + // Faster, minimally featured LZRW1-style match+parse loop with better register utilization. Intended for applications where raw throughput is valued more highly than ratio. + mz_uint lookahead_pos = d->m_lookahead_pos, lookahead_size = d->m_lookahead_size, dict_size = d->m_dict_size, total_lz_bytes = d->m_total_lz_bytes, num_flags_left = d->m_num_flags_left; + mz_uint8 *pLZ_code_buf = d->m_pLZ_code_buf, *pLZ_flags = d->m_pLZ_flags; + mz_uint cur_pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK; + + while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size))) + { + const mz_uint TDEFL_COMP_FAST_LOOKAHEAD_SIZE = 4096; + mz_uint dst_pos = (lookahead_pos + lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK; + mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size); + d->m_src_buf_left -= num_bytes_to_process; + lookahead_size += num_bytes_to_process; + + while (num_bytes_to_process) + { + mz_uint32 n = MZ_MIN(TDEFL_LZ_DICT_SIZE - dst_pos, num_bytes_to_process); + memcpy(d->m_dict + dst_pos, d->m_pSrc, n); + if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) + memcpy(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc, MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos)); + d->m_pSrc += n; + dst_pos = (dst_pos + n) & TDEFL_LZ_DICT_SIZE_MASK; + num_bytes_to_process -= n; + } + + dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - lookahead_size, dict_size); + if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE)) break; + + while (lookahead_size >= 4) + { + mz_uint cur_match_dist, cur_match_len = 1; + mz_uint8 *pCur_dict = d->m_dict + cur_pos; + mz_uint first_trigram = (*(const mz_uint32 *)pCur_dict) & 0xFFFFFF; + mz_uint hash = (first_trigram ^ (first_trigram >> (24 - (TDEFL_LZ_HASH_BITS - 8)))) & TDEFL_LEVEL1_HASH_SIZE_MASK; + mz_uint probe_pos = d->m_hash[hash]; + d->m_hash[hash] = (mz_uint16)lookahead_pos; + + if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((*(const mz_uint32 *)(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram)) + { + const mz_uint16 *p = (const mz_uint16 *)pCur_dict; + const mz_uint16 *q = (const mz_uint16 *)(d->m_dict + probe_pos); + mz_uint32 probe_len = 32; + do { } while ( (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && + (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (TDEFL_READ_UNALIGNED_WORD(++p) == TDEFL_READ_UNALIGNED_WORD(++q)) && (--probe_len > 0) ); + cur_match_len = ((mz_uint)(p - (const mz_uint16 *)pCur_dict) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q); + if (!probe_len) + cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0; + + if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U*1024U))) + { + cur_match_len = 1; + *pLZ_code_buf++ = (mz_uint8)first_trigram; + *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); + d->m_huff_count[0][(mz_uint8)first_trigram]++; + } + else + { + mz_uint32 s0, s1; + cur_match_len = MZ_MIN(cur_match_len, lookahead_size); + + MZ_ASSERT((cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE)); + + cur_match_dist--; + + pLZ_code_buf[0] = (mz_uint8)(cur_match_len - TDEFL_MIN_MATCH_LEN); + *(mz_uint16 *)(&pLZ_code_buf[1]) = (mz_uint16)cur_match_dist; + pLZ_code_buf += 3; + *pLZ_flags = (mz_uint8)((*pLZ_flags >> 1) | 0x80); + + s0 = s_tdefl_small_dist_sym[cur_match_dist & 511]; + s1 = s_tdefl_large_dist_sym[cur_match_dist >> 8]; + d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++; + + d->m_huff_count[0][s_tdefl_len_sym[cur_match_len - TDEFL_MIN_MATCH_LEN]]++; + } + } + else + { + *pLZ_code_buf++ = (mz_uint8)first_trigram; + *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); + d->m_huff_count[0][(mz_uint8)first_trigram]++; + } + + if (--num_flags_left == 0) { num_flags_left = 8; pLZ_flags = pLZ_code_buf++; } + + total_lz_bytes += cur_match_len; + lookahead_pos += cur_match_len; + dict_size = MZ_MIN(dict_size + cur_match_len, TDEFL_LZ_DICT_SIZE); + cur_pos = (cur_pos + cur_match_len) & TDEFL_LZ_DICT_SIZE_MASK; + MZ_ASSERT(lookahead_size >= cur_match_len); + lookahead_size -= cur_match_len; + + if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) + { + int n; + d->m_lookahead_pos = lookahead_pos; d->m_lookahead_size = lookahead_size; d->m_dict_size = dict_size; + d->m_total_lz_bytes = total_lz_bytes; d->m_pLZ_code_buf = pLZ_code_buf; d->m_pLZ_flags = pLZ_flags; d->m_num_flags_left = num_flags_left; + if ((n = tdefl_flush_block(d, 0)) != 0) + return (n < 0) ? MZ_FALSE : MZ_TRUE; + total_lz_bytes = d->m_total_lz_bytes; pLZ_code_buf = d->m_pLZ_code_buf; pLZ_flags = d->m_pLZ_flags; num_flags_left = d->m_num_flags_left; + } + } + + while (lookahead_size) + { + mz_uint8 lit = d->m_dict[cur_pos]; + + total_lz_bytes++; + *pLZ_code_buf++ = lit; + *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); + if (--num_flags_left == 0) { num_flags_left = 8; pLZ_flags = pLZ_code_buf++; } + + d->m_huff_count[0][lit]++; + + lookahead_pos++; + dict_size = MZ_MIN(dict_size + 1, TDEFL_LZ_DICT_SIZE); + cur_pos = (cur_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK; + lookahead_size--; + + if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) + { + int n; + d->m_lookahead_pos = lookahead_pos; d->m_lookahead_size = lookahead_size; d->m_dict_size = dict_size; + d->m_total_lz_bytes = total_lz_bytes; d->m_pLZ_code_buf = pLZ_code_buf; d->m_pLZ_flags = pLZ_flags; d->m_num_flags_left = num_flags_left; + if ((n = tdefl_flush_block(d, 0)) != 0) + return (n < 0) ? MZ_FALSE : MZ_TRUE; + total_lz_bytes = d->m_total_lz_bytes; pLZ_code_buf = d->m_pLZ_code_buf; pLZ_flags = d->m_pLZ_flags; num_flags_left = d->m_num_flags_left; + } + } + } + + d->m_lookahead_pos = lookahead_pos; d->m_lookahead_size = lookahead_size; d->m_dict_size = dict_size; + d->m_total_lz_bytes = total_lz_bytes; d->m_pLZ_code_buf = pLZ_code_buf; d->m_pLZ_flags = pLZ_flags; d->m_num_flags_left = num_flags_left; + return MZ_TRUE; +} +#endif // MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + +static MZ_FORCEINLINE void tdefl_record_literal(tdefl_compressor *d, mz_uint8 lit) +{ + d->m_total_lz_bytes++; + *d->m_pLZ_code_buf++ = lit; + *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> 1); if (--d->m_num_flags_left == 0) { d->m_num_flags_left = 8; d->m_pLZ_flags = d->m_pLZ_code_buf++; } + d->m_huff_count[0][lit]++; +} + +static MZ_FORCEINLINE void tdefl_record_match(tdefl_compressor *d, mz_uint match_len, mz_uint match_dist) +{ + mz_uint32 s0, s1; + + MZ_ASSERT((match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE)); + + d->m_total_lz_bytes += match_len; + + d->m_pLZ_code_buf[0] = (mz_uint8)(match_len - TDEFL_MIN_MATCH_LEN); + + match_dist -= 1; + d->m_pLZ_code_buf[1] = (mz_uint8)(match_dist & 0xFF); + d->m_pLZ_code_buf[2] = (mz_uint8)(match_dist >> 8); d->m_pLZ_code_buf += 3; + + *d->m_pLZ_flags = (mz_uint8)((*d->m_pLZ_flags >> 1) | 0x80); if (--d->m_num_flags_left == 0) { d->m_num_flags_left = 8; d->m_pLZ_flags = d->m_pLZ_code_buf++; } + + s0 = s_tdefl_small_dist_sym[match_dist & 511]; s1 = s_tdefl_large_dist_sym[(match_dist >> 8) & 127]; + d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++; + + if (match_len >= TDEFL_MIN_MATCH_LEN) d->m_huff_count[0][s_tdefl_len_sym[match_len - TDEFL_MIN_MATCH_LEN]]++; +} + +static mz_bool tdefl_compress_normal(tdefl_compressor *d) +{ + const mz_uint8 *pSrc = d->m_pSrc; size_t src_buf_left = d->m_src_buf_left; + tdefl_flush flush = d->m_flush; + + while ((src_buf_left) || ((flush) && (d->m_lookahead_size))) + { + mz_uint len_to_move, cur_match_dist, cur_match_len, cur_pos; + // Update dictionary and hash chains. Keeps the lookahead size equal to TDEFL_MAX_MATCH_LEN. + if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1)) + { + mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK, ins_pos = d->m_lookahead_pos + d->m_lookahead_size - 2; + mz_uint hash = (d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK]; + mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size); + const mz_uint8 *pSrc_end = pSrc + num_bytes_to_process; + src_buf_left -= num_bytes_to_process; + d->m_lookahead_size += num_bytes_to_process; + while (pSrc != pSrc_end) + { + mz_uint8 c = *pSrc++; d->m_dict[dst_pos] = c; if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c; + hash = ((hash << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1); + d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash]; d->m_hash[hash] = (mz_uint16)(ins_pos); + dst_pos = (dst_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK; ins_pos++; + } + } + else + { + while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) + { + mz_uint8 c = *pSrc++; + mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK; + src_buf_left--; + d->m_dict[dst_pos] = c; + if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) + d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c; + if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN) + { + mz_uint ins_pos = d->m_lookahead_pos + (d->m_lookahead_size - 1) - 2; + mz_uint hash = ((d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << (TDEFL_LZ_HASH_SHIFT * 2)) ^ (d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1); + d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash]; d->m_hash[hash] = (mz_uint16)(ins_pos); + } + } + } + d->m_dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - d->m_lookahead_size, d->m_dict_size); + if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) + break; + + // Simple lazy/greedy parsing state machine. + len_to_move = 1; cur_match_dist = 0; cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1); cur_pos = d->m_lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK; + if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS)) + { + if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))) + { + mz_uint8 c = d->m_dict[(cur_pos - 1) & TDEFL_LZ_DICT_SIZE_MASK]; + cur_match_len = 0; while (cur_match_len < d->m_lookahead_size) { if (d->m_dict[cur_pos + cur_match_len] != c) break; cur_match_len++; } + if (cur_match_len < TDEFL_MIN_MATCH_LEN) cur_match_len = 0; else cur_match_dist = 1; + } + } + else + { + tdefl_find_match(d, d->m_lookahead_pos, d->m_dict_size, d->m_lookahead_size, &cur_match_dist, &cur_match_len); + } + if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U*1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5))) + { + cur_match_dist = cur_match_len = 0; + } + if (d->m_saved_match_len) + { + if (cur_match_len > d->m_saved_match_len) + { + tdefl_record_literal(d, (mz_uint8)d->m_saved_lit); + if (cur_match_len >= 128) + { + tdefl_record_match(d, cur_match_len, cur_match_dist); + d->m_saved_match_len = 0; len_to_move = cur_match_len; + } + else + { + d->m_saved_lit = d->m_dict[cur_pos]; d->m_saved_match_dist = cur_match_dist; d->m_saved_match_len = cur_match_len; + } + } + else + { + tdefl_record_match(d, d->m_saved_match_len, d->m_saved_match_dist); + len_to_move = d->m_saved_match_len - 1; d->m_saved_match_len = 0; + } + } + else if (!cur_match_dist) + tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]); + else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128)) + { + tdefl_record_match(d, cur_match_len, cur_match_dist); + len_to_move = cur_match_len; + } + else + { + d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]; d->m_saved_match_dist = cur_match_dist; d->m_saved_match_len = cur_match_len; + } + // Move the lookahead forward by len_to_move bytes. + d->m_lookahead_pos += len_to_move; + MZ_ASSERT(d->m_lookahead_size >= len_to_move); + d->m_lookahead_size -= len_to_move; + d->m_dict_size = MZ_MIN(d->m_dict_size + len_to_move, TDEFL_LZ_DICT_SIZE); + // Check if it's time to flush the current LZ codes to the internal output buffer. + if ( (d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) || + ( (d->m_total_lz_bytes > 31*1024) && (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >= d->m_total_lz_bytes) || (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))) ) + { + int n; + d->m_pSrc = pSrc; d->m_src_buf_left = src_buf_left; + if ((n = tdefl_flush_block(d, 0)) != 0) + return (n < 0) ? MZ_FALSE : MZ_TRUE; + } + } + + d->m_pSrc = pSrc; d->m_src_buf_left = src_buf_left; + return MZ_TRUE; +} + +static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d) +{ + if (d->m_pIn_buf_size) + { + *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf; + } + + if (d->m_pOut_buf_size) + { + size_t n = MZ_MIN(*d->m_pOut_buf_size - d->m_out_buf_ofs, d->m_output_flush_remaining); + memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf + d->m_output_flush_ofs, n); + d->m_output_flush_ofs += (mz_uint)n; + d->m_output_flush_remaining -= (mz_uint)n; + d->m_out_buf_ofs += n; + + *d->m_pOut_buf_size = d->m_out_buf_ofs; + } + + return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY; +} + +tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush) +{ + if (!d) + { + if (pIn_buf_size) *pIn_buf_size = 0; + if (pOut_buf_size) *pOut_buf_size = 0; + return TDEFL_STATUS_BAD_PARAM; + } + + d->m_pIn_buf = pIn_buf; d->m_pIn_buf_size = pIn_buf_size; + d->m_pOut_buf = pOut_buf; d->m_pOut_buf_size = pOut_buf_size; + d->m_pSrc = (const mz_uint8 *)(pIn_buf); d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0; + d->m_out_buf_ofs = 0; + d->m_flush = flush; + + if ( ((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) || + (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf) ) + { + if (pIn_buf_size) *pIn_buf_size = 0; + if (pOut_buf_size) *pOut_buf_size = 0; + return (d->m_prev_return_status = TDEFL_STATUS_BAD_PARAM); + } + d->m_wants_to_finish |= (flush == TDEFL_FINISH); + + if ((d->m_output_flush_remaining) || (d->m_finished)) + return (d->m_prev_return_status = tdefl_flush_output_buffer(d)); + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) && + ((d->m_flags & TDEFL_GREEDY_PARSING_FLAG) != 0) && + ((d->m_flags & (TDEFL_FILTER_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS | TDEFL_RLE_MATCHES)) == 0)) + { + if (!tdefl_compress_fast(d)) + return d->m_prev_return_status; + } + else +#endif // #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + { + if (!tdefl_compress_normal(d)) + return d->m_prev_return_status; + } + + if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf)) + d->m_adler32 = (mz_uint32)mz_adler32(d->m_adler32, (const mz_uint8 *)pIn_buf, d->m_pSrc - (const mz_uint8 *)pIn_buf); + + if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining)) + { + if (tdefl_flush_block(d, flush) < 0) + return d->m_prev_return_status; + d->m_finished = (flush == TDEFL_FINISH); + if (flush == TDEFL_FULL_FLUSH) { MZ_CLEAR_OBJ(d->m_hash); MZ_CLEAR_OBJ(d->m_next); d->m_dict_size = 0; } + } + + return (d->m_prev_return_status = tdefl_flush_output_buffer(d)); +} + +tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush) +{ + MZ_ASSERT(d->m_pPut_buf_func); return tdefl_compress(d, pIn_buf, &in_buf_size, NULL, NULL, flush); +} + +tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + d->m_pPut_buf_func = pPut_buf_func; d->m_pPut_buf_user = pPut_buf_user; + d->m_flags = (mz_uint)(flags); d->m_max_probes[0] = 1 + ((flags & 0xFFF) + 2) / 3; d->m_greedy_parsing = (flags & TDEFL_GREEDY_PARSING_FLAG) != 0; + d->m_max_probes[1] = 1 + (((flags & 0xFFF) >> 2) + 2) / 3; + if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG)) MZ_CLEAR_OBJ(d->m_hash); + d->m_lookahead_pos = d->m_lookahead_size = d->m_dict_size = d->m_total_lz_bytes = d->m_lz_code_buf_dict_pos = d->m_bits_in = 0; + d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished = d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0; + d->m_pLZ_code_buf = d->m_lz_code_buf + 1; d->m_pLZ_flags = d->m_lz_code_buf; d->m_num_flags_left = 8; + d->m_pOutput_buf = d->m_output_buf; d->m_pOutput_buf_end = d->m_output_buf; d->m_prev_return_status = TDEFL_STATUS_OKAY; + d->m_saved_match_dist = d->m_saved_match_len = d->m_saved_lit = 0; d->m_adler32 = 1; + d->m_pIn_buf = NULL; d->m_pOut_buf = NULL; + d->m_pIn_buf_size = NULL; d->m_pOut_buf_size = NULL; + d->m_flush = TDEFL_NO_FLUSH; d->m_pSrc = NULL; d->m_src_buf_left = 0; d->m_out_buf_ofs = 0; + memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); + memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); + return TDEFL_STATUS_OKAY; +} + +tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d) +{ + return d->m_prev_return_status; +} + +mz_uint32 tdefl_get_adler32(tdefl_compressor *d) +{ + return d->m_adler32; +} + +mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + tdefl_compressor *pComp; mz_bool succeeded; if (((buf_len) && (!pBuf)) || (!pPut_buf_func)) return MZ_FALSE; + pComp = (tdefl_compressor*)MZ_MALLOC(sizeof(tdefl_compressor)); if (!pComp) return MZ_FALSE; + succeeded = (tdefl_init(pComp, pPut_buf_func, pPut_buf_user, flags) == TDEFL_STATUS_OKAY); + succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE); + MZ_FREE(pComp); return succeeded; +} + +typedef struct +{ + size_t m_size, m_capacity; + mz_uint8 *m_pBuf; + mz_bool m_expandable; +} tdefl_output_buffer; + +static mz_bool tdefl_output_buffer_putter(const void *pBuf, int len, void *pUser) +{ + tdefl_output_buffer *p = (tdefl_output_buffer *)pUser; + size_t new_size = p->m_size + len; + if (new_size > p->m_capacity) + { + size_t new_capacity = p->m_capacity; mz_uint8 *pNew_buf; if (!p->m_expandable) return MZ_FALSE; + do { new_capacity = MZ_MAX(128U, new_capacity << 1U); } while (new_size > new_capacity); + pNew_buf = (mz_uint8*)MZ_REALLOC(p->m_pBuf, new_capacity); if (!pNew_buf) return MZ_FALSE; + p->m_pBuf = pNew_buf; p->m_capacity = new_capacity; + } + memcpy((mz_uint8*)p->m_pBuf + p->m_size, pBuf, len); p->m_size = new_size; + return MZ_TRUE; +} + +void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) +{ + tdefl_output_buffer out_buf; MZ_CLEAR_OBJ(out_buf); + if (!pOut_len) return MZ_FALSE; else *pOut_len = 0; + out_buf.m_expandable = MZ_TRUE; + if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags)) return NULL; + *pOut_len = out_buf.m_size; return out_buf.m_pBuf; +} + +size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) +{ + tdefl_output_buffer out_buf; MZ_CLEAR_OBJ(out_buf); + if (!pOut_buf) return 0; + out_buf.m_pBuf = (mz_uint8*)pOut_buf; out_buf.m_capacity = out_buf_len; + if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags)) return 0; + return out_buf.m_size; +} + +#ifndef MINIZ_NO_ZLIB_APIS +static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 }; + +// level may actually range from [0,10] (10 is a "hidden" max level, where we want a bit more compression and it's fine if throughput to fall off a cliff on some files). +mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy) +{ + mz_uint comp_flags = s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0); + if (window_bits > 0) comp_flags |= TDEFL_WRITE_ZLIB_HEADER; + + if (!level) comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS; + else if (strategy == MZ_FILTERED) comp_flags |= TDEFL_FILTER_MATCHES; + else if (strategy == MZ_HUFFMAN_ONLY) comp_flags &= ~TDEFL_MAX_PROBES_MASK; + else if (strategy == MZ_FIXED) comp_flags |= TDEFL_FORCE_ALL_STATIC_BLOCKS; + else if (strategy == MZ_RLE) comp_flags |= TDEFL_RLE_MATCHES; + + return comp_flags; +} +#endif //MINIZ_NO_ZLIB_APIS + +#ifdef _MSC_VER +#pragma warning (push) +#pragma warning (disable:4204) // nonstandard extension used : non-constant aggregate initializer (also supported by GNU C and C99, so no big deal) +#endif + +// Simple PNG writer function by Alex Evans, 2011. Released into the public domain: https://gist.github.com/908299, more context at +// http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/. +void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int bpl, int num_chans, size_t *pLen_out) +{ + tdefl_compressor *pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); tdefl_output_buffer out_buf; int i, y, z; mz_uint32 c; *pLen_out = 0; + if (!pComp) return NULL; + MZ_CLEAR_OBJ(out_buf); out_buf.m_expandable = MZ_TRUE; out_buf.m_capacity = 57+MZ_MAX(64, (1+bpl)*h); if (NULL == (out_buf.m_pBuf = (mz_uint8*)MZ_MALLOC(out_buf.m_capacity))) { MZ_FREE(pComp); return NULL; } + // write dummy header + for (z = 41; z; --z) tdefl_output_buffer_putter(&z, 1, &out_buf); + // compress image data + tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, TDEFL_DEFAULT_MAX_PROBES | TDEFL_WRITE_ZLIB_HEADER); + for (y = 0; y < h; ++y) { tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); tdefl_compress_buffer(pComp, (mz_uint8*)pImage + y * bpl, bpl, TDEFL_NO_FLUSH); } + if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) { MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; } + // write real header + *pLen_out = out_buf.m_size-41; + { + mz_uint8 pnghdr[41]={0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, + 0,0,(mz_uint8)(w>>8),(mz_uint8)w,0,0,(mz_uint8)(h>>8),(mz_uint8)h,8,"\0\0\04\02\06"[num_chans],0,0,0,0,0,0,0, + (mz_uint8)(*pLen_out>>24),(mz_uint8)(*pLen_out>>16),(mz_uint8)(*pLen_out>>8),(mz_uint8)*pLen_out,0x49,0x44,0x41,0x54}; + c=(mz_uint32)mz_crc32(MZ_CRC32_INIT,pnghdr+12,17); for (i=0; i<4; ++i, c<<=8) ((mz_uint8*)(pnghdr+29))[i]=(mz_uint8)(c>>24); + memcpy(out_buf.m_pBuf, pnghdr, 41); + } + // write footer (IDAT CRC-32, followed by IEND chunk) + if (!tdefl_output_buffer_putter("\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16, &out_buf)) { *pLen_out = 0; MZ_FREE(pComp); MZ_FREE(out_buf.m_pBuf); return NULL; } + c = (mz_uint32)mz_crc32(MZ_CRC32_INIT,out_buf.m_pBuf+41-4, *pLen_out+4); for (i=0; i<4; ++i, c<<=8) (out_buf.m_pBuf+out_buf.m_size-16)[i] = (mz_uint8)(c >> 24); + // compute final size of file, grab compressed data buffer and return + *pLen_out += 57; MZ_FREE(pComp); return out_buf.m_pBuf; +} + +#ifdef _MSC_VER +#pragma warning (pop) +#endif + +// ------------------- .ZIP archive reading + +#ifndef MINIZ_NO_ARCHIVE_APIS + +#ifdef MINIZ_NO_STDIO + #define MZ_FILE void * +#else + #include + #include + #if defined(_MSC_VER) || defined(__MINGW64__) + #include + #define MZ_FILE FILE + #define MZ_FOPEN fopen + #define MZ_FCLOSE fclose + #define MZ_FREAD fread + #define MZ_FWRITE fwrite + #define MZ_FTELL64 _ftelli64 + #define MZ_FSEEK64 _fseeki64 + #define MZ_FILE_STAT_STRUCT _stat + #define MZ_FILE_STAT _stat + #define MZ_FFLUSH fflush + #define MZ_FREOPEN freopen + #define MZ_DELETE_FILE remove + #elif defined(__MINGW32__) + #include + #define MZ_FILE FILE + #define MZ_FOPEN fopen + #define MZ_FCLOSE fclose + #define MZ_FREAD fread + #define MZ_FWRITE fwrite + #define MZ_FTELL64 ftello64 + #define MZ_FSEEK64 fseeko64 + #define MZ_FILE_STAT_STRUCT _stat + #define MZ_FILE_STAT _stat + #define MZ_FFLUSH fflush + #define MZ_FREOPEN freopen + #define MZ_DELETE_FILE remove + #else + #include + #define MZ_FILE FILE + #define MZ_FOPEN fopen + #define MZ_FCLOSE fclose + #define MZ_FREAD fread + #define MZ_FWRITE fwrite + #define MZ_FTELL64 ftello + #define MZ_FSEEK64 fseeko + #define MZ_FILE_STAT_STRUCT stat + #define MZ_FILE_STAT stat + #define MZ_FFLUSH fflush + #define MZ_FREOPEN freopen + #define MZ_DELETE_FILE remove + #endif // #ifdef _MSC_VER +#endif // #ifdef MINIZ_NO_STDIO + +#define MZ_TOLOWER(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c) - 'A' + 'a') : (c)) + +// Various ZIP archive enums. To completely avoid cross platform compiler alignment and platform endian issues, miniz.c doesn't use structs for any of this stuff. +enum +{ + // ZIP archive identifiers and record sizes + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06054b50, MZ_ZIP_CENTRAL_DIR_HEADER_SIG = 0x02014b50, MZ_ZIP_LOCAL_DIR_HEADER_SIG = 0x04034b50, + MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22, + // Central directory header record offsets + MZ_ZIP_CDH_SIG_OFS = 0, MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4, MZ_ZIP_CDH_VERSION_NEEDED_OFS = 6, MZ_ZIP_CDH_BIT_FLAG_OFS = 8, + MZ_ZIP_CDH_METHOD_OFS = 10, MZ_ZIP_CDH_FILE_TIME_OFS = 12, MZ_ZIP_CDH_FILE_DATE_OFS = 14, MZ_ZIP_CDH_CRC32_OFS = 16, + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS = 20, MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS = 24, MZ_ZIP_CDH_FILENAME_LEN_OFS = 28, MZ_ZIP_CDH_EXTRA_LEN_OFS = 30, + MZ_ZIP_CDH_COMMENT_LEN_OFS = 32, MZ_ZIP_CDH_DISK_START_OFS = 34, MZ_ZIP_CDH_INTERNAL_ATTR_OFS = 36, MZ_ZIP_CDH_EXTERNAL_ATTR_OFS = 38, MZ_ZIP_CDH_LOCAL_HEADER_OFS = 42, + // Local directory header offsets + MZ_ZIP_LDH_SIG_OFS = 0, MZ_ZIP_LDH_VERSION_NEEDED_OFS = 4, MZ_ZIP_LDH_BIT_FLAG_OFS = 6, MZ_ZIP_LDH_METHOD_OFS = 8, MZ_ZIP_LDH_FILE_TIME_OFS = 10, + MZ_ZIP_LDH_FILE_DATE_OFS = 12, MZ_ZIP_LDH_CRC32_OFS = 14, MZ_ZIP_LDH_COMPRESSED_SIZE_OFS = 18, MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22, + MZ_ZIP_LDH_FILENAME_LEN_OFS = 26, MZ_ZIP_LDH_EXTRA_LEN_OFS = 28, + // End of central directory offsets + MZ_ZIP_ECDH_SIG_OFS = 0, MZ_ZIP_ECDH_NUM_THIS_DISK_OFS = 4, MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS = 6, MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 8, + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS = 10, MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12, MZ_ZIP_ECDH_CDIR_OFS_OFS = 16, MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20, +}; + +typedef struct +{ + void *m_p; + size_t m_size, m_capacity; + mz_uint m_element_size; +} mz_zip_array; + +struct mz_zip_internal_state_tag +{ + mz_zip_array m_central_dir; + mz_zip_array m_central_dir_offsets; + mz_zip_array m_sorted_central_dir_offsets; + MZ_FILE *m_pFile; + void *m_pMem; + size_t m_mem_size; + size_t m_mem_capacity; +}; + +#define MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(array_ptr, element_size) (array_ptr)->m_element_size = element_size +#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) ((element_type *)((array_ptr)->m_p))[index] + +static MZ_FORCEINLINE void mz_zip_array_clear(mz_zip_archive *pZip, mz_zip_array *pArray) +{ + pZip->m_pFree(pZip->m_pAlloc_opaque, pArray->m_p); + memset(pArray, 0, sizeof(mz_zip_array)); +} + +static mz_bool mz_zip_array_ensure_capacity(mz_zip_archive *pZip, mz_zip_array *pArray, size_t min_new_capacity, mz_uint growing) +{ + void *pNew_p; size_t new_capacity = min_new_capacity; MZ_ASSERT(pArray->m_element_size); if (pArray->m_capacity >= min_new_capacity) return MZ_TRUE; + if (growing) { new_capacity = MZ_MAX(1, pArray->m_capacity); while (new_capacity < min_new_capacity) new_capacity *= 2; } + if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity))) return MZ_FALSE; + pArray->m_p = pNew_p; pArray->m_capacity = new_capacity; + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_reserve(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_capacity, mz_uint growing) +{ + if (new_capacity > pArray->m_capacity) { if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing)) return MZ_FALSE; } + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_resize(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_size, mz_uint growing) +{ + if (new_size > pArray->m_capacity) { if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing)) return MZ_FALSE; } + pArray->m_size = new_size; + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_ensure_room(mz_zip_archive *pZip, mz_zip_array *pArray, size_t n) +{ + return mz_zip_array_reserve(pZip, pArray, pArray->m_size + n, MZ_TRUE); +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_push_back(mz_zip_archive *pZip, mz_zip_array *pArray, const void *pElements, size_t n) +{ + size_t orig_size = pArray->m_size; if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE)) return MZ_FALSE; + memcpy((mz_uint8*)pArray->m_p + orig_size * pArray->m_element_size, pElements, n * pArray->m_element_size); + return MZ_TRUE; +} + +#ifndef MINIZ_NO_TIME +static time_t mz_zip_dos_to_time_t(int dos_time, int dos_date) +{ + struct tm tm; + memset(&tm, 0, sizeof(tm)); tm.tm_isdst = -1; + tm.tm_year = ((dos_date >> 9) & 127) + 1980 - 1900; tm.tm_mon = ((dos_date >> 5) & 15) - 1; tm.tm_mday = dos_date & 31; + tm.tm_hour = (dos_time >> 11) & 31; tm.tm_min = (dos_time >> 5) & 63; tm.tm_sec = (dos_time << 1) & 62; + return mktime(&tm); +} + +static void mz_zip_time_to_dos_time(time_t time, mz_uint16 *pDOS_time, mz_uint16 *pDOS_date) +{ + struct tm *tm = localtime(&time); + *pDOS_time = (mz_uint16)(((tm->tm_hour) << 11) + ((tm->tm_min) << 5) + ((tm->tm_sec) >> 1)); + *pDOS_date = (mz_uint16)(((tm->tm_year + 1900 - 1980) << 9) + ((tm->tm_mon + 1) << 5) + tm->tm_mday); +} +#endif + +#ifndef MINIZ_NO_STDIO +static mz_bool mz_zip_get_file_modified_time(const char *pFilename, mz_uint16 *pDOS_time, mz_uint16 *pDOS_date) +{ +#ifdef MINIZ_NO_TIME + (void)pFilename; *pDOS_date = *pDOS_time = 0; +#else + struct MZ_FILE_STAT_STRUCT file_stat; if (MZ_FILE_STAT(pFilename, &file_stat) != 0) return MZ_FALSE; + mz_zip_time_to_dos_time(file_stat.st_mtime, pDOS_time, pDOS_date); +#endif // #ifdef MINIZ_NO_TIME + return MZ_TRUE; +} + +static mz_bool mz_zip_set_file_times(const char *pFilename, time_t access_time, time_t modified_time) +{ +#ifndef MINIZ_NO_TIME + struct utimbuf t; t.actime = access_time; t.modtime = modified_time; + return !utime(pFilename, &t); +#else + pFilename, access_time, modified_time; + return MZ_TRUE; +#endif // #ifndef MINIZ_NO_TIME +} +#endif + +static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip, mz_uint32 flags) +{ + (void)flags; + if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID)) + return MZ_FALSE; + + if (!pZip->m_pAlloc) pZip->m_pAlloc = def_alloc_func; + if (!pZip->m_pFree) pZip->m_pFree = def_free_func; + if (!pZip->m_pRealloc) pZip->m_pRealloc = def_realloc_func; + + pZip->m_zip_mode = MZ_ZIP_MODE_READING; + pZip->m_archive_size = 0; + pZip->m_central_directory_file_ofs = 0; + pZip->m_total_files = 0; + + if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state)))) + return MZ_FALSE; + memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32)); + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_reader_filename_less(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, mz_uint r_index) +{ + const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE; + const mz_uint8 *pR = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, r_index)); + mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS), r_len = MZ_READ_LE16(pR + MZ_ZIP_CDH_FILENAME_LEN_OFS); + mz_uint8 l = 0, r = 0; + pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; pR += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + pE = pL + MZ_MIN(l_len, r_len); + while (pL < pE) + { + if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) + break; + pL++; pR++; + } + return (pL == pE) ? (l_len < r_len) : (l < r); +} + +#define MZ_SWAP_UINT32(a, b) do { mz_uint32 t = a; a = b; b = t; } MZ_MACRO_END + +// Heap sort of lowercased filenames, used to help accelerate plain central directory searches by mz_zip_reader_locate_file(). (Could also use qsort(), but it could allocate memory.) +static void mz_zip_reader_sort_central_dir_offsets_by_filename(mz_zip_archive *pZip) +{ + mz_zip_internal_state *pState = pZip->m_pState; + const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets; + const mz_zip_array *pCentral_dir = &pState->m_central_dir; + mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0); + const int size = pZip->m_total_files; + int start = (size - 2) >> 1, end; + while (start >= 0) + { + int child, root = start; + for ( ; ; ) + { + if ((child = (root << 1) + 1) >= size) + break; + child += (((child + 1) < size) && (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1]))); + if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child])) + break; + MZ_SWAP_UINT32(pIndices[root], pIndices[child]); root = child; + } + start--; + } + + end = size - 1; + while (end > 0) + { + int child, root = 0; + MZ_SWAP_UINT32(pIndices[end], pIndices[0]); + for ( ; ; ) + { + if ((child = (root << 1) + 1) >= end) + break; + child += (((child + 1) < end) && mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1])); + if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child])) + break; + MZ_SWAP_UINT32(pIndices[root], pIndices[child]); root = child; + } + end--; + } +} + +static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, mz_uint32 flags) +{ + mz_uint cdir_size, num_this_disk, cdir_disk_index; + mz_uint64 cdir_ofs; + mz_int64 cur_file_ofs; + const mz_uint8 *p; + mz_uint32 buf_u32[4096 / sizeof(mz_uint32)]; mz_uint8 *pBuf = (mz_uint8 *)buf_u32; + // Basic sanity checks - reject files which are too small, and check the first 4 bytes of the file to make sure a local header is there. + if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return MZ_FALSE; + // Find the end of central directory record by scanning the file from the end towards the beginning. + cur_file_ofs = MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0); + for ( ; ; ) + { + int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n) + return MZ_FALSE; + for (i = n - 4; i >= 0; --i) + if (MZ_READ_LE32(pBuf + i) == MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) + break; + if (i >= 0) + { + cur_file_ofs += i; + break; + } + if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= (0xFFFF + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE))) + return MZ_FALSE; + cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0); + } + // Read and verify the end of central directory record. + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return MZ_FALSE; + if ((MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) || + ((pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS)) != MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS))) + return MZ_FALSE; + + num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS); + cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS); + if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1))) + return MZ_FALSE; + + if ((cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS)) < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) + return MZ_FALSE; + + cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS); + if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size) + return MZ_FALSE; + + pZip->m_central_directory_file_ofs = cdir_ofs; + + if (pZip->m_total_files) + { + mz_uint i, n; + // Read the entire central directory into a heap block, and allocate another heap block to hold the unsorted central dir file record offsets, and another to hold the sorted indices. + if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) || + (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE)) || + (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))) + return MZ_FALSE; + if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size) + return MZ_FALSE; + + // Now create an index into the central directory file records, do some basic sanity checking on each record, and check for zip64 entries (which are not yet supported). + p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p; + for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i) + { + mz_uint total_header_size, comp_size, decomp_size, disk_index; + if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)) + return MZ_FALSE; + MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, i) = (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p); + MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets, mz_uint32, i) = i; + comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); + decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); + if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size) || (decomp_size == 0xFFFFFFFF) || (comp_size == 0xFFFFFFFF)) + return MZ_FALSE; + disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS); + if ((disk_index != num_this_disk) && (disk_index != 1)) + return MZ_FALSE; + if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size) + return MZ_FALSE; + if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > n) + return MZ_FALSE; + n -= total_header_size; p += total_header_size; + } + } + + if ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) + mz_zip_reader_sort_central_dir_offsets_by_filename(pZip); + + return MZ_TRUE; +} + +mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint32 flags) +{ + if ((!pZip) || (!pZip->m_pRead)) + return MZ_FALSE; + if (!mz_zip_reader_init_internal(pZip, flags)) + return MZ_FALSE; + pZip->m_archive_size = size; + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end(pZip); + return MZ_FALSE; + } + return MZ_TRUE; +} + +static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n); + memcpy(pBuf, (const mz_uint8 *)pZip->m_pState->m_pMem + file_ofs, s); + return s; +} + +mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint32 flags) +{ + if (!mz_zip_reader_init_internal(pZip, flags)) + return MZ_FALSE; + pZip->m_archive_size = size; + pZip->m_pRead = mz_zip_mem_read_func; + pZip->m_pIO_opaque = pZip; + pZip->m_pState->m_pMem = (void *)pMem; + pZip->m_pState->m_mem_size = size; + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end(pZip); + return MZ_FALSE; + } + return MZ_TRUE; +} + +#ifndef MINIZ_NO_STDIO +static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); + if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET)))) + return 0; + return MZ_FREAD(pBuf, 1, n, pZip->m_pState->m_pFile); +} + +mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags) +{ + mz_uint64 file_size; + MZ_FILE *pFile = MZ_FOPEN(pFilename, "rb"); + if (!pFile) + return MZ_FALSE; + if (MZ_FSEEK64(pFile, 0, SEEK_END)) + return MZ_FALSE; + file_size = MZ_FTELL64(pFile); + if (!mz_zip_reader_init_internal(pZip, flags)) + { + MZ_FCLOSE(pFile); + return MZ_FALSE; + } + pZip->m_pRead = mz_zip_file_read_func; + pZip->m_pIO_opaque = pZip; + pZip->m_pState->m_pFile = pFile; + pZip->m_archive_size = file_size; + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end(pZip); + return MZ_FALSE; + } + return MZ_TRUE; +} +#endif // #ifndef MINIZ_NO_STDIO + +mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip) +{ + return pZip ? pZip->m_total_files : 0; +} + +static MZ_FORCEINLINE const mz_uint8 *mz_zip_reader_get_cdh(mz_zip_archive *pZip, mz_uint file_index) +{ + if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) + return NULL; + return &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index)); +} + +mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index) +{ + mz_uint m_bit_flag; + const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); + if (!p) + return MZ_FALSE; + m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); + return (m_bit_flag & 1); +} + +mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index) +{ + mz_uint filename_len, internal_attr, external_attr; + const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); + if (!p) + return MZ_FALSE; + + internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS); + external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS); + if ((!internal_attr) && ((external_attr & 0x10) != 0)) + return MZ_TRUE; + + filename_len = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + if (filename_len) + { + if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/') + return MZ_TRUE; + } + + return MZ_FALSE; +} + +mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat) +{ + mz_uint n; + const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); + if ((!p) || (!pStat)) + return MZ_FALSE; + + // Unpack the central directory record. + pStat->m_file_index = file_index; + pStat->m_central_dir_ofs = MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index); + pStat->m_version_made_by = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS); + pStat->m_version_needed = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_NEEDED_OFS); + pStat->m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); + pStat->m_method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS); +#ifndef MINIZ_NO_TIME + pStat->m_time = mz_zip_dos_to_time_t(MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_TIME_OFS), MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_DATE_OFS)); +#endif + pStat->m_crc32 = MZ_READ_LE32(p + MZ_ZIP_CDH_CRC32_OFS); + pStat->m_comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); + pStat->m_uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); + pStat->m_internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS); + pStat->m_external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS); + pStat->m_local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS); + + // Copy as much of the filename and comment as possible. + n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE - 1); + memcpy(pStat->m_filename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); pStat->m_filename[n] = '\0'; + + n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS); n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1); + pStat->m_comment_size = n; + memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), n); pStat->m_comment[n] = '\0'; + + return MZ_TRUE; +} + +mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size) +{ + mz_uint n; + const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); + if (!p) { if (filename_buf_size) pFilename[0] = '\0'; return 0; } + n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + if (filename_buf_size) + { + n = MZ_MIN(n, filename_buf_size - 1); + memcpy(pFilename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); + pFilename[n] = '\0'; + } + return n + 1; +} + +static MZ_FORCEINLINE mz_bool mz_zip_reader_string_equal(const char *pA, const char *pB, mz_uint len, mz_uint flags) +{ + mz_uint i; + if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE) + return 0 == memcmp(pA, pB, len); + for (i = 0; i < len; ++i) + if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i])) + return MZ_FALSE; + return MZ_TRUE; +} + +static MZ_FORCEINLINE int mz_zip_reader_filename_compare(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, const char *pR, mz_uint r_len) +{ + const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE; + mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS); + mz_uint8 l = 0, r = 0; + pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + pE = pL + MZ_MIN(l_len, r_len); + while (pL < pE) + { + if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) + break; + pL++; pR++; + } + return (pL == pE) ? (int)(l_len - r_len) : (l - r); +} + +static int mz_zip_reader_locate_file_binary_search(mz_zip_archive *pZip, const char *pFilename) +{ + mz_zip_internal_state *pState = pZip->m_pState; + const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets; + const mz_zip_array *pCentral_dir = &pState->m_central_dir; + mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0); + const int size = pZip->m_total_files; + const mz_uint filename_len = (mz_uint)strlen(pFilename); + int l = 0, h = size - 1; + while (l <= h) + { + int m = (l + h) >> 1, file_index = pIndices[m], comp = mz_zip_reader_filename_compare(pCentral_dir, pCentral_dir_offsets, file_index, pFilename, filename_len); + if (!comp) + return file_index; + else if (comp < 0) + l = m + 1; + else + h = m - 1; + } + return -1; +} + +int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags) +{ + mz_uint file_index; size_t name_len, comment_len; + if ((!pZip) || (!pZip->m_pState) || (!pName) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) + return -1; + if (((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_p)) + return mz_zip_reader_locate_file_binary_search(pZip, pName); + name_len = strlen(pName); if (name_len > 0xFFFF) return -1; + comment_len = pComment ? strlen(pComment) : 0; if (comment_len > 0xFFFF) return -1; + for (file_index = 0; file_index < pZip->m_total_files; file_index++) + { + const mz_uint8 *pHeader = &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index)); + mz_uint filename_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_FILENAME_LEN_OFS); + const char *pFilename = (const char *)pHeader + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + if (filename_len < name_len) + continue; + if (comment_len) + { + mz_uint file_extra_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_EXTRA_LEN_OFS), file_comment_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_COMMENT_LEN_OFS); + const char *pFile_comment = pFilename + filename_len + file_extra_len; + if ((file_comment_len != comment_len) || (!mz_zip_reader_string_equal(pComment, pFile_comment, file_comment_len, flags))) + continue; + } + if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len)) + { + int ofs = filename_len - 1; + do + { + if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':')) + break; + } while (--ofs >= 0); + ofs++; + pFilename += ofs; filename_len -= ofs; + } + if ((filename_len == name_len) && (mz_zip_reader_string_equal(pName, pFilename, filename_len, flags))) + return file_index; + } + return -1; +} + +mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) +{ + int status = TINFL_STATUS_DONE; + mz_uint64 needed_size, cur_file_ofs, comp_remaining, out_buf_ofs = 0, read_buf_size, read_buf_ofs = 0, read_buf_avail; + mz_zip_archive_file_stat file_stat; + void *pRead_buf; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + tinfl_decompressor inflator; + + if ((buf_size) && (!pBuf)) + return MZ_FALSE; + + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + + if (!file_stat.m_comp_size) + return MZ_TRUE; + + // Encryption and patch files are not supported. + if (file_stat.m_bit_flag & (1 | 32)) + return MZ_FALSE; + + // This function only supports stored and deflate. + if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) + return MZ_FALSE; + + // Ensure supplied output buffer is large enough. + needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size; + if (buf_size < needed_size) + return MZ_FALSE; + + // Read and parse the local directory entry. + cur_file_ofs = file_stat.m_local_header_ofs; + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return MZ_FALSE; + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return MZ_FALSE; + + cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size) + return MZ_FALSE; + + if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) + { + // The file is stored or the caller has requested the compressed data. + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size) + return MZ_FALSE; + return ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) != 0) || (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) == file_stat.m_crc32); + } + + // Decompress the file either directly from memory or from a file input buffer. + tinfl_init(&inflator); + + if (pZip->m_pState->m_pMem) + { + // Read directly from the archive in memory. + pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs; + read_buf_size = read_buf_avail = file_stat.m_comp_size; + comp_remaining = 0; + } + else if (pUser_read_buf) + { + // Use a user provided read buffer. + if (!user_read_buf_size) + return MZ_FALSE; + pRead_buf = (mz_uint8 *)pUser_read_buf; + read_buf_size = user_read_buf_size; + read_buf_avail = 0; + comp_remaining = file_stat.m_uncomp_size; + } + else + { + // Temporarily allocate a read buffer. + read_buf_size = MZ_MIN(file_stat.m_comp_size, MZ_ZIP_MAX_IO_BUF_SIZE); +#ifdef _MSC_VER + if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF)) +#else + if (((sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF)) +#endif + return MZ_FALSE; + if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size))) + return MZ_FALSE; + read_buf_avail = 0; + comp_remaining = file_stat.m_comp_size; + } + + do + { + size_t in_buf_size, out_buf_size = (size_t)(file_stat.m_uncomp_size - out_buf_ofs); + if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) + { + read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + status = TINFL_STATUS_FAILED; + break; + } + cur_file_ofs += read_buf_avail; + comp_remaining -= read_buf_avail; + read_buf_ofs = 0; + } + in_buf_size = (size_t)read_buf_avail; + status = tinfl_decompress(&inflator, (mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pBuf, (mz_uint8 *)pBuf + out_buf_ofs, &out_buf_size, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF | (comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0)); + read_buf_avail -= in_buf_size; + read_buf_ofs += in_buf_size; + out_buf_ofs += out_buf_size; + } while (status == TINFL_STATUS_NEEDS_MORE_INPUT); + + if (status == TINFL_STATUS_DONE) + { + // Make sure the entire file was decompressed, and check its CRC. + if ((out_buf_ofs != file_stat.m_uncomp_size) || (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)) + status = TINFL_STATUS_FAILED; + } + + if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf)) + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + + return status == TINFL_STATUS_DONE; +} + +mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) +{ + int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags); + if (file_index < 0) + return MZ_FALSE; + return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size, flags, pUser_read_buf, user_read_buf_size); +} + +mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags) +{ + return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size, flags, NULL, 0); +} + +mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags) +{ + return mz_zip_reader_extract_file_to_mem_no_alloc(pZip, pFilename, pBuf, buf_size, flags, NULL, 0); +} + +void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags) +{ + mz_uint64 comp_size, uncomp_size, alloc_size; + const mz_uint8 *p = mz_zip_reader_get_cdh(pZip, file_index); + void *pBuf; + + if (pSize) + *pSize = 0; + if (!p) + return NULL; + + comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); + uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); + + alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? comp_size : uncomp_size; +#ifdef _MSC_VER + if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF)) +#else + if (((sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF)) +#endif + return NULL; + if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size))) + return NULL; + + if (!mz_zip_reader_extract_to_mem(pZip, file_index, pBuf, (size_t)alloc_size, flags)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return NULL; + } + + if (pSize) *pSize = (size_t)alloc_size; + return pBuf; +} + +void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags) +{ + int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags); + if (file_index < 0) + { + if (pSize) *pSize = 0; + return MZ_FALSE; + } + return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags); +} + +mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags) +{ + int status = TINFL_STATUS_DONE; mz_uint file_crc32 = MZ_CRC32_INIT; + mz_uint64 read_buf_size, read_buf_ofs = 0, read_buf_avail, comp_remaining, out_buf_ofs = 0, cur_file_ofs; + mz_zip_archive_file_stat file_stat; + void *pRead_buf = NULL; void *pWrite_buf = NULL; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + + if (!file_stat.m_comp_size) + return MZ_TRUE; + + // Encryption and patch files are not supported. + if (file_stat.m_bit_flag & (1 | 32)) + return MZ_FALSE; + + // This function only supports stored and deflate. + if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) + return MZ_FALSE; + + // Read and parse the local directory entry. + cur_file_ofs = file_stat.m_local_header_ofs; + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return MZ_FALSE; + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return MZ_FALSE; + + cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size) + return MZ_FALSE; + + // Decompress the file either directly from memory or from a file input buffer. + if (pZip->m_pState->m_pMem) + { + pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs; + read_buf_size = read_buf_avail = file_stat.m_comp_size; + comp_remaining = 0; + } + else + { + read_buf_size = MZ_MIN(file_stat.m_comp_size, MZ_ZIP_MAX_IO_BUF_SIZE); + if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size))) + return MZ_FALSE; + read_buf_avail = 0; + comp_remaining = file_stat.m_comp_size; + } + + if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) + { + // The file is stored or the caller has requested the compressed data. + if (pZip->m_pState->m_pMem) + { +#ifdef _MSC_VER + if (((0, sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > 0xFFFFFFFF)) +#else + if (((sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > 0xFFFFFFFF)) +#endif + return MZ_FALSE; + if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size) + status = TINFL_STATUS_FAILED; + else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)file_stat.m_comp_size); + cur_file_ofs += file_stat.m_comp_size; + out_buf_ofs += file_stat.m_comp_size; + comp_remaining = 0; + } + else + { + while (comp_remaining) + { + read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + status = TINFL_STATUS_FAILED; + break; + } + + if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)read_buf_avail); + + if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + status = TINFL_STATUS_FAILED; + break; + } + cur_file_ofs += read_buf_avail; + out_buf_ofs += read_buf_avail; + comp_remaining -= read_buf_avail; + } + } + } + else + { + tinfl_decompressor inflator; + tinfl_init(&inflator); + + if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE))) + status = TINFL_STATUS_FAILED; + else + { + do + { + mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pWrite_buf + (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); + size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); + if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) + { + read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + status = TINFL_STATUS_FAILED; + break; + } + cur_file_ofs += read_buf_avail; + comp_remaining -= read_buf_avail; + read_buf_ofs = 0; + } + + in_buf_size = (size_t)read_buf_avail; + status = tinfl_decompress(&inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size, comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0); + read_buf_avail -= in_buf_size; + read_buf_ofs += in_buf_size; + + if (out_buf_size) + { + if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size) + { + status = TINFL_STATUS_FAILED; + break; + } + file_crc32 = (mz_uint32)mz_crc32(file_crc32, pWrite_buf_cur, out_buf_size); + if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size) + { + status = TINFL_STATUS_FAILED; + break; + } + } + } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT)); + } + } + + if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) + { + // Make sure the entire file was decompressed, and check its CRC. + if ((out_buf_ofs != file_stat.m_uncomp_size) || (file_crc32 != file_stat.m_crc32)) + status = TINFL_STATUS_FAILED; + } + + if (!pZip->m_pState->m_pMem) + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + if (pWrite_buf) + pZip->m_pFree(pZip->m_pAlloc_opaque, pWrite_buf); + + return status == TINFL_STATUS_DONE; +} + +mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags) +{ + int file_index = mz_zip_reader_locate_file(pZip, pFilename, NULL, flags); + if (file_index < 0) + return MZ_FALSE; + return mz_zip_reader_extract_to_callback(pZip, file_index, pCallback, pOpaque, flags); +} + +#ifndef MINIZ_NO_STDIO +static size_t mz_zip_file_write_callback(void *pOpaque, mz_uint64 ofs, const void *pBuf, size_t n) +{ + (void)ofs; return MZ_FWRITE(pBuf, 1, n, (MZ_FILE*)pOpaque); +} + +mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags) +{ + mz_bool status; + mz_zip_archive_file_stat file_stat; + MZ_FILE *pFile; + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + pFile = MZ_FOPEN(pDst_filename, "wb"); + if (!pFile) + return MZ_FALSE; + status = mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags); + if (MZ_FCLOSE(pFile) == EOF) + return MZ_FALSE; +#ifndef MINIZ_NO_TIME + if (status) + mz_zip_set_file_times(pDst_filename, file_stat.m_time, file_stat.m_time); +#endif + return status; +} +#endif // #ifndef MINIZ_NO_STDIO + +mz_bool mz_zip_reader_end(mz_zip_archive *pZip) +{ + if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) + return MZ_FALSE; + + if (pZip->m_pState) + { + mz_zip_internal_state *pState = pZip->m_pState; pZip->m_pState = NULL; + mz_zip_array_clear(pZip, &pState->m_central_dir); + mz_zip_array_clear(pZip, &pState->m_central_dir_offsets); + mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets); + +#ifndef MINIZ_NO_STDIO + if (pState->m_pFile) + { + MZ_FCLOSE(pState->m_pFile); + pState->m_pFile = NULL; + } +#endif // #ifndef MINIZ_NO_STDIO + + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + } + pZip->m_zip_mode = MZ_ZIP_MODE_INVALID; + + return MZ_TRUE; +} + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags) +{ + int file_index = mz_zip_reader_locate_file(pZip, pArchive_filename, NULL, flags); + if (file_index < 0) + return MZ_FALSE; + return mz_zip_reader_extract_to_file(pZip, file_index, pDst_filename, flags); +} +#endif + +// ------------------- .ZIP archive writing + +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +static void mz_write_le16(mz_uint8 *p, mz_uint16 v) { p[0] = (mz_uint8)v; p[1] = (mz_uint8)(v >> 8); } +static void mz_write_le32(mz_uint8 *p, mz_uint32 v) { p[0] = (mz_uint8)v; p[1] = (mz_uint8)(v >> 8); p[2] = (mz_uint8)(v >> 16); p[3] = (mz_uint8)(v >> 24); } +#define MZ_WRITE_LE16(p, v) mz_write_le16((mz_uint8 *)(p), (mz_uint16)(v)) +#define MZ_WRITE_LE32(p, v) mz_write_le32((mz_uint8 *)(p), (mz_uint32)(v)) + +mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size) +{ + if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID)) + return MZ_FALSE; + + if (pZip->m_file_offset_alignment) + { + // Ensure user specified file offset alignment is a power of 2. + if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1)) + return MZ_FALSE; + } + + if (!pZip->m_pAlloc) pZip->m_pAlloc = def_alloc_func; + if (!pZip->m_pFree) pZip->m_pFree = def_free_func; + if (!pZip->m_pRealloc) pZip->m_pRealloc = def_realloc_func; + + pZip->m_zip_mode = MZ_ZIP_MODE_WRITING; + pZip->m_archive_size = existing_size; + pZip->m_central_directory_file_ofs = 0; + pZip->m_total_files = 0; + + if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state)))) + return MZ_FALSE; + memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32)); + return MZ_TRUE; +} + +static size_t mz_zip_heap_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + mz_zip_internal_state *pState = pZip->m_pState; + mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size); +#ifdef _MSC_VER + if ((!n) || ((0, sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF))) +#else + if ((!n) || ((sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF))) +#endif + return 0; + if (new_size > pState->m_mem_capacity) + { + void *pNew_block; + size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity); while (new_capacity < new_size) new_capacity *= 2; + if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity))) + return 0; + pState->m_pMem = pNew_block; pState->m_mem_capacity = new_capacity; + } + memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n); + pState->m_mem_size = (size_t)new_size; + return n; +} + +mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size) +{ + pZip->m_pWrite = mz_zip_heap_write_func; + pZip->m_pIO_opaque = pZip; + if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) + return MZ_FALSE; + if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning))) + { + if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size))) + { + mz_zip_writer_end(pZip); + return MZ_FALSE; + } + pZip->m_pState->m_mem_capacity = initial_allocation_size; + } + return MZ_TRUE; +} + +#ifndef MINIZ_NO_STDIO +static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); + if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET)))) + return 0; + return MZ_FWRITE(pBuf, 1, n, pZip->m_pState->m_pFile); +} + +mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning) +{ + MZ_FILE *pFile; + pZip->m_pWrite = mz_zip_file_write_func; + pZip->m_pIO_opaque = pZip; + if (!mz_zip_writer_init(pZip, size_to_reserve_at_beginning)) + return MZ_FALSE; + if (NULL == (pFile = MZ_FOPEN(pFilename, "wb"))) + { + mz_zip_writer_end(pZip); + return MZ_FALSE; + } + pZip->m_pState->m_pFile = pFile; + if (size_to_reserve_at_beginning) + { + mz_uint64 cur_ofs = 0; char buf[4096]; MZ_CLEAR_OBJ(buf); + do + { + size_t n = (size_t)MZ_MIN(sizeof(buf), size_to_reserve_at_beginning); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n) + { + mz_zip_writer_end(pZip); + return MZ_FALSE; + } + cur_ofs += n; size_to_reserve_at_beginning -= n; + } while (size_to_reserve_at_beginning); + } + return MZ_TRUE; +} +#endif // #ifndef MINIZ_NO_STDIO + +mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename) +{ + mz_zip_internal_state *pState; + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) + return MZ_FALSE; + // No sense in trying to write to an archive that's already at the support max size + if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > 0xFFFFFFFF)) + return MZ_FALSE; + + pState = pZip->m_pState; + + if (pState->m_pFile) + { +#ifdef MINIZ_NO_STDIO + pFilename; return MZ_FALSE; +#else + // Archive is being read from stdio - try to reopen as writable. + if (pZip->m_pIO_opaque != pZip) + return MZ_FALSE; + if (!pFilename) + return MZ_FALSE; + pZip->m_pWrite = mz_zip_file_write_func; + if (NULL == (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile))) + { + // The mz_zip_archive is now in a bogus state because pState->m_pFile is NULL, so just close it. + mz_zip_reader_end(pZip); + return MZ_FALSE; + } +#endif // #ifdef MINIZ_NO_STDIO + } + else if (pState->m_pMem) + { + // Archive lives in a memory block. Assume it's from the heap that we can resize using the realloc callback. + if (pZip->m_pIO_opaque != pZip) + return MZ_FALSE; + pState->m_mem_capacity = pState->m_mem_size; + pZip->m_pWrite = mz_zip_heap_write_func; + } + // Archive is being read via a user provided read function - make sure the user has specified a write function too. + else if (!pZip->m_pWrite) + return MZ_FALSE; + + // Start writing new files at the archive's current central directory location. + pZip->m_archive_size = pZip->m_central_directory_file_ofs; + pZip->m_zip_mode = MZ_ZIP_MODE_WRITING; + pZip->m_central_directory_file_ofs = 0; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags) +{ + return mz_zip_writer_add_mem_ex(pZip, pArchive_name, pBuf, buf_size, NULL, 0, level_and_flags, 0, 0); +} + +typedef struct +{ + mz_zip_archive *m_pZip; + mz_uint64 m_cur_archive_file_ofs; + mz_uint64 m_comp_size; +} mz_zip_writer_add_state; + +static mz_bool mz_zip_writer_add_put_buf_callback(const void* pBuf, int len, void *pUser) +{ + mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser; + if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len) + return MZ_FALSE; + pState->m_cur_archive_file_ofs += len; + pState->m_comp_size += len; + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_create_local_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date) +{ + (void)pZip; + memset(pDst, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_SIG_OFS, MZ_ZIP_LOCAL_DIR_HEADER_SIG); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_BIT_FLAG_OFS, bit_flags); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_METHOD_OFS, method); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_TIME_OFS, dos_time); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_DATE_OFS, dos_date); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_CRC32_OFS, uncomp_crc32); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, comp_size); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, uncomp_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILENAME_LEN_OFS, filename_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_EXTRA_LEN_OFS, extra_size); + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_create_central_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint16 comment_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, mz_uint64 local_header_ofs, mz_uint32 ext_attributes) +{ + (void)pZip; + memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_DATE_OFS, dos_date); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_CRC32_OFS, uncomp_crc32); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, comp_size); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, uncomp_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILENAME_LEN_OFS, filename_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_EXTRA_LEN_OFS, extra_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_COMMENT_LEN_OFS, comment_size); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS, ext_attributes); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_header_ofs); + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_add_to_central_dir(mz_zip_archive *pZip, const char *pFilename, mz_uint16 filename_size, const void *pExtra, mz_uint16 extra_size, const void *pComment, mz_uint16 comment_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, mz_uint64 local_header_ofs, mz_uint32 ext_attributes) +{ + mz_zip_internal_state *pState = pZip->m_pState; + mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size; + size_t orig_central_dir_size = pState->m_central_dir.m_size; + mz_uint8 central_dir_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE]; + + // No zip64 support yet + if ((local_header_ofs > 0xFFFFFFFF) || (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + extra_size + comment_size) > 0xFFFFFFFF)) + return MZ_FALSE; + + if (!mz_zip_writer_create_central_dir_header(pZip, central_dir_header, filename_size, extra_size, comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_header_ofs, ext_attributes)) + return MZ_FALSE; + + if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, ¢ral_dir_ofs, 1))) + { + // Try to push the central directory array back into its original state. + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return MZ_FALSE; + } + + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_validate_archive_name(const char *pArchive_name) +{ + // Basic ZIP archive filename validity checks: Valid filenames cannot start with a forward slash, cannot contain a drive letter, and cannot use DOS-style backward slashes. + if (*pArchive_name == '/') + return MZ_FALSE; + while (*pArchive_name) + { + if ((*pArchive_name == '\\') || (*pArchive_name == ':')) + return MZ_FALSE; + pArchive_name++; + } + return MZ_TRUE; +} + +static mz_uint mz_zip_writer_compute_padding_needed_for_file_alignment(mz_zip_archive *pZip) +{ + mz_uint32 n; + if (!pZip->m_file_offset_alignment) + return 0; + n = (mz_uint32)(pZip->m_archive_size & (pZip->m_file_offset_alignment - 1)); + return (pZip->m_file_offset_alignment - n) & (pZip->m_file_offset_alignment - 1); +} + +static mz_bool mz_zip_writer_write_zeros(mz_zip_archive *pZip, mz_uint64 cur_file_ofs, mz_uint32 n) +{ + char buf[4096]; + memset(buf, 0, MZ_MIN(sizeof(buf), n)); + while (n) + { + mz_uint32 s = MZ_MIN(sizeof(buf), n); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s) + return MZ_FALSE; + cur_file_ofs += s; n -= s; + } + return MZ_TRUE; +} + +mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32) +{ + mz_uint16 method = 0, dos_time = 0, dos_date = 0; + mz_uint level, ext_attributes = 0, num_alignment_padding_bytes; + mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, comp_size = 0; + size_t archive_name_size; + mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; + tdefl_compressor *pComp = NULL; + mz_bool store_data_uncompressed; + mz_zip_internal_state *pState; + + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + level = level_and_flags & 0xF; + store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)); + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (pZip->m_total_files == 0xFFFF) || (level > MZ_UBER_COMPRESSION)) + return MZ_FALSE; + + pState = pZip->m_pState; + + if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size)) + return MZ_FALSE; + // No zip64 support yet + if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF)) + return MZ_FALSE; + if (!mz_zip_writer_validate_archive_name(pArchive_name)) + return MZ_FALSE; + +#ifndef MINIZ_NO_TIME + { + time_t cur_time; time(&cur_time); + mz_zip_time_to_dos_time(cur_time, &dos_time, &dos_date); + } +#endif // #ifndef MINIZ_NO_TIME + + archive_name_size = strlen(pArchive_name); + if (archive_name_size > 0xFFFF) + return MZ_FALSE; + + num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); + + // no zip64 support yet + if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + comment_size + archive_name_size) > 0xFFFFFFFF)) + return MZ_FALSE; + + if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/')) + { + // Set DOS Subdirectory attribute bit. + ext_attributes |= 0x10; + // Subdirectories cannot contain data. + if ((buf_size) || (uncomp_size)) + return MZ_FALSE; + } + + // Try to do any allocations before writing to the archive, so if an allocation fails the file remains unmodified. (A good idea if we're doing an in-place modification.) + if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size)) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1))) + return MZ_FALSE; + + if ((!store_data_uncompressed) && (buf_size)) + { + if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor)))) + return MZ_FALSE; + } + + if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes + sizeof(local_dir_header))) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return MZ_FALSE; + } + local_dir_header_ofs += num_alignment_padding_bytes; + if (pZip->m_file_offset_alignment) { MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); } + cur_archive_file_ofs += num_alignment_padding_bytes + sizeof(local_dir_header); + + MZ_CLEAR_OBJ(local_dir_header); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return MZ_FALSE; + } + cur_archive_file_ofs += archive_name_size; + + if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + { + uncomp_crc32 = (mz_uint32)mz_crc32(MZ_CRC32_INIT, (const mz_uint8*)pBuf, buf_size); + uncomp_size = buf_size; + if (uncomp_size <= 3) + { + level = 0; + store_data_uncompressed = MZ_TRUE; + } + } + + if (store_data_uncompressed) + { + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return MZ_FALSE; + } + + cur_archive_file_ofs += buf_size; + comp_size = buf_size; + + if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) + method = MZ_DEFLATED; + } + else if (buf_size) + { + mz_zip_writer_add_state state; + + state.m_pZip = pZip; + state.m_cur_archive_file_ofs = cur_archive_file_ofs; + state.m_comp_size = 0; + + if ((tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) || + (tdefl_compress_buffer(pComp, pBuf, buf_size, TDEFL_FINISH) != TDEFL_STATUS_DONE)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return MZ_FALSE; + } + + comp_size = state.m_comp_size; + cur_archive_file_ofs = state.m_cur_archive_file_ofs; + + method = MZ_DEFLATED; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + pComp = NULL; + + // no zip64 support yet + if ((comp_size > 0xFFFFFFFF) || (cur_archive_file_ofs > 0xFFFFFFFF)) + return MZ_FALSE; + + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, 0, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date)) + return MZ_FALSE; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return MZ_FALSE; + + if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, NULL, 0, pComment, comment_size, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date, local_dir_header_ofs, ext_attributes)) + return MZ_FALSE; + + pZip->m_total_files++; + pZip->m_archive_size = cur_archive_file_ofs; + + return MZ_TRUE; +} + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags) +{ + mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes; + mz_uint16 method = 0, dos_time = 0, dos_date = 0, ext_attributes = 0; + mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, uncomp_size = 0, comp_size = 0; + size_t archive_name_size; + mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; + MZ_FILE *pSrc_file = NULL; + + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + level = level_and_flags & 0xF; + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION)) + return MZ_FALSE; + if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) + return MZ_FALSE; + if (!mz_zip_writer_validate_archive_name(pArchive_name)) + return MZ_FALSE; + + archive_name_size = strlen(pArchive_name); + if (archive_name_size > 0xFFFF) + return MZ_FALSE; + + num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); + + // no zip64 support yet + if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + comment_size + archive_name_size) > 0xFFFFFFFF)) + return MZ_FALSE; + + if (!mz_zip_get_file_modified_time(pSrc_filename, &dos_time, &dos_date)) + return MZ_FALSE; + + pSrc_file = MZ_FOPEN(pSrc_filename, "rb"); + if (!pSrc_file) + return MZ_FALSE; + MZ_FSEEK64(pSrc_file, 0, SEEK_END); + uncomp_size = MZ_FTELL64(pSrc_file); + MZ_FSEEK64(pSrc_file, 0, SEEK_SET); + + if (uncomp_size > 0xFFFFFFFF) + { + // No zip64 support yet + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + if (uncomp_size <= 3) + level = 0; + + if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes + sizeof(local_dir_header))) + return MZ_FALSE; + local_dir_header_ofs += num_alignment_padding_bytes; + if (pZip->m_file_offset_alignment) { MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); } + cur_archive_file_ofs += num_alignment_padding_bytes + sizeof(local_dir_header); + + MZ_CLEAR_OBJ(local_dir_header); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + cur_archive_file_ofs += archive_name_size; + + if (uncomp_size) + { + mz_uint64 uncomp_remaining = uncomp_size; + void *pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, MZ_ZIP_MAX_IO_BUF_SIZE); + if (!pRead_buf) + { + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + + if (!level) + { + while (uncomp_remaining) + { + mz_uint n = (mz_uint)MZ_MIN(MZ_ZIP_MAX_IO_BUF_SIZE, uncomp_remaining); + if ((MZ_FREAD(pRead_buf, 1, n, pSrc_file) != n) || (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n); + uncomp_remaining -= n; + cur_archive_file_ofs += n; + } + comp_size = uncomp_size; + } + else + { + mz_bool result = MZ_FALSE; + mz_zip_writer_add_state state; + tdefl_compressor *pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor)); + if (!pComp) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + + state.m_pZip = pZip; + state.m_cur_archive_file_ofs = cur_archive_file_ofs; + state.m_comp_size = 0; + + if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + + for ( ; ; ) + { + size_t in_buf_size = (mz_uint32)MZ_MIN(uncomp_remaining, MZ_ZIP_MAX_IO_BUF_SIZE); + tdefl_status status; + + if (MZ_FREAD(pRead_buf, 1, in_buf_size, pSrc_file) != in_buf_size) + break; + + uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, in_buf_size); + uncomp_remaining -= in_buf_size; + + status = tdefl_compress_buffer(pComp, pRead_buf, in_buf_size, uncomp_remaining ? TDEFL_NO_FLUSH : TDEFL_FINISH); + if (status == TDEFL_STATUS_DONE) + { + result = MZ_TRUE; + break; + } + else if (status != TDEFL_STATUS_OKAY) + break; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + + if (!result) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + MZ_FCLOSE(pSrc_file); + return MZ_FALSE; + } + + comp_size = state.m_comp_size; + cur_archive_file_ofs = state.m_cur_archive_file_ofs; + + method = MZ_DEFLATED; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + } + + MZ_FCLOSE(pSrc_file); pSrc_file = NULL; + + // no zip64 support yet + if ((comp_size > 0xFFFFFFFF) || (cur_archive_file_ofs > 0xFFFFFFFF)) + return MZ_FALSE; + + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, 0, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date)) + return MZ_FALSE; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return MZ_FALSE; + + if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, NULL, 0, pComment, comment_size, uncomp_size, comp_size, uncomp_crc32, method, 0, dos_time, dos_date, local_dir_header_ofs, ext_attributes)) + return MZ_FALSE; + + pZip->m_total_files++; + pZip->m_archive_size = cur_archive_file_ofs; + + return MZ_TRUE; +} +#endif // #ifndef MINIZ_NO_STDIO + +mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint file_index) +{ + mz_uint n, bit_flags, num_alignment_padding_bytes; + mz_uint64 comp_bytes_remaining, local_dir_header_ofs; + mz_uint64 cur_src_file_ofs, cur_dst_file_ofs; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + mz_uint8 central_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE]; + size_t orig_central_dir_size; + mz_zip_internal_state *pState; + void *pBuf; const mz_uint8 *pSrc_central_header; + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING)) + return MZ_FALSE; + if (NULL == (pSrc_central_header = mz_zip_reader_get_cdh(pSource_zip, file_index))) + return MZ_FALSE; + pState = pZip->m_pState; + + num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); + + // no zip64 support yet + if ((pZip->m_total_files == 0xFFFF) || ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) > 0xFFFFFFFF)) + return MZ_FALSE; + + cur_src_file_ofs = MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS); + cur_dst_file_ofs = pZip->m_archive_size; + + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return MZ_FALSE; + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return MZ_FALSE; + cur_src_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE; + + if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes)) + return MZ_FALSE; + cur_dst_file_ofs += num_alignment_padding_bytes; + local_dir_header_ofs = cur_dst_file_ofs; + if (pZip->m_file_offset_alignment) { MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); } + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return MZ_FALSE; + cur_dst_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE; + + n = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + comp_bytes_remaining = n + MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); + + if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)MZ_MAX(sizeof(mz_uint32) * 4, MZ_MIN(MZ_ZIP_MAX_IO_BUF_SIZE, comp_bytes_remaining))))) + return MZ_FALSE; + + while (comp_bytes_remaining) + { + n = (mz_uint)MZ_MIN(MZ_ZIP_MAX_IO_BUF_SIZE, comp_bytes_remaining); + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return MZ_FALSE; + } + cur_src_file_ofs += n; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return MZ_FALSE; + } + cur_dst_file_ofs += n; + + comp_bytes_remaining -= n; + } + + bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS); + if (bit_flags & 8) + { + // Copy data descriptor + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, sizeof(mz_uint32) * 4) != sizeof(mz_uint32) * 4) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return MZ_FALSE; + } + + n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == 0x08074b50) ? 4 : 3); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return MZ_FALSE; + } + + cur_src_file_ofs += n; + cur_dst_file_ofs += n; + } + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + + // no zip64 support yet + if (cur_dst_file_ofs > 0xFFFFFFFF) + return MZ_FALSE; + + orig_central_dir_size = pState->m_central_dir.m_size; + + memcpy(central_header, pSrc_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); + MZ_WRITE_LE32(central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_dir_header_ofs); + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) + return MZ_FALSE; + + n = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_COMMENT_LEN_OFS); + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n)) + { + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return MZ_FALSE; + } + + if (pState->m_central_dir.m_size > 0xFFFFFFFF) + return MZ_FALSE; + n = (mz_uint32)pState->m_central_dir.m_size; + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1)) + { + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return MZ_FALSE; + } + + pZip->m_total_files++; + pZip->m_archive_size = cur_dst_file_ofs; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip) +{ + mz_zip_internal_state *pState; + mz_uint64 central_dir_ofs, central_dir_size; + mz_uint8 hdr[MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE]; + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING)) + return MZ_FALSE; + + pState = pZip->m_pState; + + // no zip64 support yet + if ((pZip->m_total_files > 0xFFFF) || ((pZip->m_archive_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > 0xFFFFFFFF)) + return MZ_FALSE; + + central_dir_ofs = 0; + central_dir_size = 0; + if (pZip->m_total_files) + { + // Write central directory + central_dir_ofs = pZip->m_archive_size; + central_dir_size = pState->m_central_dir.m_size; + pZip->m_central_directory_file_ofs = central_dir_ofs; + if (pZip->m_pWrite(pZip->m_pIO_opaque, central_dir_ofs, pState->m_central_dir.m_p, (size_t)central_dir_size) != central_dir_size) + return MZ_FALSE; + pZip->m_archive_size += central_dir_size; + } + + // Write end of central directory record + MZ_CLEAR_OBJ(hdr); + MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_SIG_OFS, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG); + MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, pZip->m_total_files); + MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, pZip->m_total_files); + MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, central_dir_size); + MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, central_dir_ofs); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, sizeof(hdr)) != sizeof(hdr)) + return MZ_FALSE; +#ifndef MINIZ_NO_STDIO + if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF)) + return MZ_FALSE; +#endif // #ifndef MINIZ_NO_STDIO + + pZip->m_archive_size += sizeof(hdr); + + pZip->m_zip_mode = MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED; + return MZ_TRUE; +} + +mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **pBuf, size_t *pSize) +{ + if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pSize)) + return MZ_FALSE; + if (pZip->m_pWrite != mz_zip_heap_write_func) + return MZ_FALSE; + if (!mz_zip_writer_finalize_archive(pZip)) + return MZ_FALSE; + + *pBuf = pZip->m_pState->m_pMem; + *pSize = pZip->m_pState->m_mem_size; + pZip->m_pState->m_pMem = NULL; + pZip->m_pState->m_mem_size = pZip->m_pState->m_mem_capacity = 0; + return MZ_TRUE; +} + +mz_bool mz_zip_writer_end(mz_zip_archive *pZip) +{ + mz_zip_internal_state *pState; + mz_bool status = MZ_TRUE; + if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED))) + return MZ_FALSE; + + pState = pZip->m_pState; + pZip->m_pState = NULL; + mz_zip_array_clear(pZip, &pState->m_central_dir); + mz_zip_array_clear(pZip, &pState->m_central_dir_offsets); + mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets); + +#ifndef MINIZ_NO_STDIO + if (pState->m_pFile) + { + MZ_FCLOSE(pState->m_pFile); + pState->m_pFile = NULL; + } +#endif // #ifndef MINIZ_NO_STDIO + + if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem); + pState->m_pMem = NULL; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + pZip->m_zip_mode = MZ_ZIP_MODE_INVALID; + return status; +} + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags) +{ + mz_bool status, created_new_archive = MZ_FALSE; + mz_zip_archive zip_archive; + struct MZ_FILE_STAT_STRUCT file_stat; + MZ_CLEAR_OBJ(zip_archive); + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION)) + return MZ_FALSE; + if (!mz_zip_writer_validate_archive_name(pArchive_name)) + return MZ_FALSE; + if (MZ_FILE_STAT(pZip_filename, &file_stat) != 0) + { + // Create a new archive. + if (!mz_zip_writer_init_file(&zip_archive, pZip_filename, 0)) + return MZ_FALSE; + created_new_archive = MZ_TRUE; + } + else + { + // Append to an existing archive. + if (!mz_zip_reader_init_file(&zip_archive, pZip_filename, level_and_flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY)) + return MZ_FALSE; + if (!mz_zip_writer_init_from_reader(&zip_archive, pZip_filename)) + { + mz_zip_reader_end(&zip_archive); + return MZ_FALSE; + } + } + status = mz_zip_writer_add_mem_ex(&zip_archive, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, 0, 0); + // Always finalize, even if adding failed for some reason, so we have a valid central directory. (This may not always succeed, but we can try.) + if (!mz_zip_writer_finalize_archive(&zip_archive)) + status = MZ_FALSE; + if (!mz_zip_writer_end(&zip_archive)) + status = MZ_FALSE; + if ((!status) && (created_new_archive)) + { + // It's a new archive and something went wrong, so just delete it. + int ignoredStatus = MZ_DELETE_FILE(pZip_filename); + (void)ignoredStatus; + } + return status; +} + +void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags) +{ + int file_index; + mz_zip_archive zip_archive; + void *p = NULL; + + if (pSize) + *pSize = 0; + + if ((!pZip_filename) || (!pArchive_name)) + return NULL; + + MZ_CLEAR_OBJ(zip_archive); + if (!mz_zip_reader_init_file(&zip_archive, pZip_filename, flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY)) + return NULL; + + if ((file_index = mz_zip_reader_locate_file(&zip_archive, pArchive_name, NULL, flags)) >= 0) + p = mz_zip_reader_extract_to_heap(&zip_archive, file_index, pSize, flags); + + mz_zip_reader_end(&zip_archive); + return p; +} + +#endif // #ifndef MINIZ_NO_STDIO + +#endif // #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +#endif // #ifndef MINIZ_NO_ARCHIVE_APIS + +#ifdef __cplusplus +} +#endif + +#endif // MINIZ_HEADER_FILE_ONLY + +/* + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + For more information, please refer to +*/ diff --git a/SDL/include/music_cmd.h b/SDL/include/music_cmd.h new file mode 100644 index 0000000..5b5b077 --- /dev/null +++ b/SDL/include/music_cmd.h @@ -0,0 +1,62 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* This file supports an external command for playing music */ + +#ifdef CMD_MUSIC + +#include +#include +#include +#if defined(__linux__) && defined(__arm__) +# include +#endif +typedef struct { + char *file; + char *cmd; + pid_t pid; +} MusicCMD; + +/* Unimplemented */ +extern void MusicCMD_SetVolume(int volume); + +/* Load a music stream from the given file */ +extern MusicCMD *MusicCMD_LoadSong(const char *cmd, const char *file); + +/* Start playback of a given music stream */ +extern void MusicCMD_Start(MusicCMD *music); + +/* Stop playback of a stream previously started with MusicCMD_Start() */ +extern void MusicCMD_Stop(MusicCMD *music); + +/* Pause playback of a given music stream */ +extern void MusicCMD_Pause(MusicCMD *music); + +/* Resume playback of a given music stream */ +extern void MusicCMD_Resume(MusicCMD *music); + +/* Close the given music stream */ +extern void MusicCMD_FreeSong(MusicCMD *music); + +/* Return non-zero if a stream is currently playing */ +extern int MusicCMD_Active(MusicCMD *music); + +#endif /* CMD_MUSIC */ diff --git a/SDL/include/music_flac.h b/SDL/include/music_flac.h new file mode 100644 index 0000000..a514923 --- /dev/null +++ b/SDL/include/music_flac.h @@ -0,0 +1,90 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Header to handle loading FLAC music files in SDL. + ~ Austen Dicken (admin@cvpcs.org) +*/ + +/* $Id: $ */ + +#ifdef FLAC_MUSIC + +#include + +typedef struct { + FLAC__uint64 sample_size; + unsigned sample_rate; + unsigned channels; + unsigned bits_per_sample; + FLAC__uint64 total_samples; + + // the following are used to handle the callback nature of the writer + int max_to_read; + char *data; // pointer to beginning of data array + int data_len; // size of data array + int data_read; // amount of data array used + char *overflow; // pointer to beginning of overflow array + int overflow_len; // size of overflow array + int overflow_read; // amount of overflow array used +} FLAC_Data; + +typedef struct { + int playing; + int volume; + int section; + FLAC__StreamDecoder *flac_decoder; + FLAC_Data flac_data; + SDL_RWops *src; + int freesrc; + SDL_AudioCVT cvt; + int len_available; + Uint8 *snd_available; +} FLAC_music; + +/* Initialize the FLAC player, with the given mixer settings + This function returns 0, or -1 if there was an error. + */ +extern int FLAC_init(SDL_AudioSpec *mixer); + +/* Set the volume for a FLAC stream */ +extern void FLAC_setvolume(FLAC_music *music, int volume); + +/* Load an FLAC stream from an SDL_RWops object */ +extern FLAC_music *FLAC_new_RW(SDL_RWops *src, int freesrc); + +/* Start playback of a given FLAC stream */ +extern void FLAC_play(FLAC_music *music); + +/* Return non-zero if a stream is currently playing */ +extern int FLAC_playing(FLAC_music *music); + +/* Play some of a stream previously started with FLAC_play() */ +extern int FLAC_playAudio(FLAC_music *music, Uint8 *stream, int len); + +/* Stop playback of a stream previously started with FLAC_play() */ +extern void FLAC_stop(FLAC_music *music); + +/* Close the given FLAC stream */ +extern void FLAC_delete(FLAC_music *music); + +/* Jump (seek) to a given position (time is in seconds) */ +extern void FLAC_jump_to_time(FLAC_music *music, double time); + +#endif /* FLAC_MUSIC */ diff --git a/SDL/include/music_mad.h b/SDL/include/music_mad.h new file mode 100644 index 0000000..297826b --- /dev/null +++ b/SDL/include/music_mad.h @@ -0,0 +1,72 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef MP3_MAD_MUSIC + +#include "mad.h" +#include "SDL_rwops.h" +#include "SDL_audio.h" +#include "SDL_mixer.h" + +#define MAD_INPUT_BUFFER_SIZE (5*8192) +#define MAD_OUTPUT_BUFFER_SIZE 8192 + +enum { + MS_input_eof = 0x0001, + MS_input_error = 0x0001, + MS_decode_eof = 0x0002, + MS_decode_error = 0x0004, + MS_error_flags = 0x000f, + + MS_playing = 0x0100, + MS_cvt_decoded = 0x0200, +}; + +typedef struct { + SDL_RWops *src; + int freesrc; + struct mad_stream stream; + struct mad_frame frame; + struct mad_synth synth; + int frames_read; + mad_timer_t next_frame_start; + int volume; + int status; + int output_begin, output_end; + SDL_AudioSpec mixer; + SDL_AudioCVT cvt; + + unsigned char input_buffer[MAD_INPUT_BUFFER_SIZE + MAD_BUFFER_GUARD]; + unsigned char output_buffer[MAD_OUTPUT_BUFFER_SIZE]; +} mad_data; + +mad_data *mad_openFileRW(SDL_RWops *src, SDL_AudioSpec *mixer, int freesrc); +void mad_closeFile(mad_data *mp3_mad); + +void mad_start(mad_data *mp3_mad); +void mad_stop(mad_data *mp3_mad); +int mad_isPlaying(mad_data *mp3_mad); + +int mad_getSamples(mad_data *mp3_mad, Uint8 *stream, int len); +void mad_seek(mad_data *mp3_mad, double position); +void mad_setVolume(mad_data *mp3_mad, int volume); + +#endif diff --git a/SDL/include/music_mod.h b/SDL/include/music_mod.h new file mode 100644 index 0000000..f142268 --- /dev/null +++ b/SDL/include/music_mod.h @@ -0,0 +1,62 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* $Id: music_mod.h 4211 2008-12-08 00:27:32Z slouken $ */ + +#ifdef MOD_MUSIC + +/* This file supports MOD tracker music streams */ + +struct MODULE; + +/* Initialize the Ogg Vorbis player, with the given mixer settings + This function returns 0, or -1 if there was an error. + */ +extern int MOD_init(SDL_AudioSpec *mixer); + +/* Uninitialize the music players */ +extern void MOD_exit(void); + +/* Set the volume for a MOD stream */ +extern void MOD_setvolume(struct MODULE *music, int volume); + +/* Load a MOD stream from an SDL_RWops object */ +extern struct MODULE *MOD_new_RW(SDL_RWops *rw, int freerw); + +/* Start playback of a given MOD stream */ +extern void MOD_play(struct MODULE *music); + +/* Return non-zero if a stream is currently playing */ +extern int MOD_playing(struct MODULE *music); + +/* Play some of a stream previously started with MOD_play() */ +extern int MOD_playAudio(struct MODULE *music, Uint8 *stream, int len); + +/* Stop playback of a stream previously started with MOD_play() */ +extern void MOD_stop(struct MODULE *music); + +/* Close the given MOD stream */ +extern void MOD_delete(struct MODULE *music); + +/* Jump (seek) to a given position (time is in seconds) */ +extern void MOD_jump_to_time(struct MODULE *music, double time); + +#endif /* MOD_MUSIC */ diff --git a/SDL/include/music_modplug.h b/SDL/include/music_modplug.h new file mode 100644 index 0000000..d9cfb04 --- /dev/null +++ b/SDL/include/music_modplug.h @@ -0,0 +1,63 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifdef MODPLUG_MUSIC + +#include "modplug.h" +#include "SDL_rwops.h" +#include "SDL_audio.h" +#include "SDL_mixer.h" + +typedef struct { + ModPlugFile *file; + int playing; +} modplug_data; + +int modplug_init(SDL_AudioSpec *mixer); + +/* Uninitialize the music players */ +void modplug_exit(void); + +/* Set the volume for a modplug stream */ +void modplug_setvolume(modplug_data *music, int volume); + +/* Load a modplug stream from an SDL_RWops object */ +modplug_data *modplug_new_RW(SDL_RWops *rw, int freerw); + +/* Start playback of a given modplug stream */ +void modplug_play(modplug_data *music); + +/* Return non-zero if a stream is currently playing */ +int modplug_playing(modplug_data *music); + +/* Play some of a stream previously started with modplug_play() */ +int modplug_playAudio(modplug_data *music, Uint8 *stream, int len); + +/* Stop playback of a stream previously started with modplug_play() */ +void modplug_stop(modplug_data *music); + +/* Close the given modplug stream */ +void modplug_delete(modplug_data *music); + +/* Jump (seek) to a given position (time is in seconds) */ +void modplug_jump_to_time(modplug_data *music, double time); + +#endif /* MODPLUG_MUSIC */ diff --git a/SDL/include/music_ogg.h b/SDL/include/music_ogg.h new file mode 100644 index 0000000..5510064 --- /dev/null +++ b/SDL/include/music_ogg.h @@ -0,0 +1,75 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* $Id$ */ + +#ifdef OGG_MUSIC + +/* This file supports Ogg Vorbis music streams */ + +#ifdef OGG_USE_TREMOR +#include +#else +#include +#endif + +typedef struct { + SDL_RWops *src; + int freesrc; + int playing; + int volume; + OggVorbis_File vf; + int section; + SDL_AudioCVT cvt; + int len_available; + Uint8 *snd_available; +} OGG_music; + +/* Initialize the Ogg Vorbis player, with the given mixer settings + This function returns 0, or -1 if there was an error. + */ +extern int OGG_init(SDL_AudioSpec *mixer); + +/* Set the volume for an OGG stream */ +extern void OGG_setvolume(OGG_music *music, int volume); + +/* Load an OGG stream from an SDL_RWops object */ +extern OGG_music *OGG_new_RW(SDL_RWops *src, int freesrc); + +/* Start playback of a given OGG stream */ +extern void OGG_play(OGG_music *music); + +/* Return non-zero if a stream is currently playing */ +extern int OGG_playing(OGG_music *music); + +/* Play some of a stream previously started with OGG_play() */ +extern int OGG_playAudio(OGG_music *music, Uint8 *stream, int len); + +/* Stop playback of a stream previously started with OGG_play() */ +extern void OGG_stop(OGG_music *music); + +/* Close the given OGG stream */ +extern void OGG_delete(OGG_music *music); + +/* Jump (seek) to a given position (time is in seconds) */ +extern void OGG_jump_to_time(OGG_music *music, double time); + +#endif /* OGG_MUSIC */ diff --git a/SDL/include/wavestream.h b/SDL/include/wavestream.h new file mode 100644 index 0000000..fb0c702 --- /dev/null +++ b/SDL/include/wavestream.h @@ -0,0 +1,60 @@ +/* + SDL_mixer: An audio mixer library based on the SDL library + Copyright (C) 1997-2013 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +/* $Id$ */ + +/* This file supports streaming WAV files, without volume adjustment */ + +#include + +typedef struct { + SDL_RWops *src; + SDL_bool freesrc; + long start; + long stop; + SDL_AudioCVT cvt; +} WAVStream; + +/* Initialize the WAVStream player, with the given mixer settings + This function returns 0, or -1 if there was an error. + */ +extern int WAVStream_Init(SDL_AudioSpec *mixer); + +/* Unimplemented */ +extern void WAVStream_SetVolume(int volume); + +/* Load a WAV stream from an SDL_RWops object */ +extern WAVStream *WAVStream_LoadSong_RW(SDL_RWops *src, int freesrc); + +/* Start playback of a given WAV stream */ +extern void WAVStream_Start(WAVStream *wave); + +/* Play some of a stream previously started with WAVStream_Start() */ +extern int WAVStream_PlaySome(Uint8 *stream, int len); + +/* Stop playback of a stream previously started with WAVStream_Start() */ +extern void WAVStream_Stop(void); + +/* Close the given WAV stream */ +extern void WAVStream_FreeSong(WAVStream *wave); + +/* Return non-zero if a stream is currently playing */ +extern int WAVStream_Active(void); diff --git a/SDL/lib/libSDL.a b/SDL/lib/libSDL.a new file mode 100644 index 0000000..53bf563 Binary files /dev/null and b/SDL/lib/libSDL.a differ diff --git a/SDL/lib/libSDL_image.a b/SDL/lib/libSDL_image.a new file mode 100644 index 0000000..b3f479a Binary files /dev/null and b/SDL/lib/libSDL_image.a differ diff --git a/SDL/lib/libSDL_mixer.a b/SDL/lib/libSDL_mixer.a new file mode 100644 index 0000000..6131daf Binary files /dev/null and b/SDL/lib/libSDL_mixer.a differ diff --git a/SDL/lib/libSDL_ttf.a b/SDL/lib/libSDL_ttf.a new file mode 100644 index 0000000..48743f2 Binary files /dev/null and b/SDL/lib/libSDL_ttf.a differ diff --git a/SmashBros.xcodeproj/luis.mode1v3 b/SmashBros.xcodeproj/luis.mode1v3 new file mode 100644 index 0000000..a160d22 --- /dev/null +++ b/SmashBros.xcodeproj/luis.mode1v3 @@ -0,0 +1,1563 @@ + + + + + ActivePerspectiveName + Project + AllowedModules + + + BundleLoadPath + + MaxInstances + n + Module + PBXSmartGroupTreeModule + Name + Groups and Files Outline View + + + BundleLoadPath + + MaxInstances + n + Module + PBXNavigatorGroup + Name + Editor + + + BundleLoadPath + + MaxInstances + n + Module + XCTaskListModule + Name + Task List + + + BundleLoadPath + + MaxInstances + n + Module + XCDetailModule + Name + File and Smart Group Detail Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXBuildResultsModule + Name + Detailed Build Results Viewer + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXProjectFindModule + Name + Project Batch Find Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCProjectFormatConflictsModule + Name + Project Format Conflicts List + + + BundleLoadPath + + MaxInstances + n + Module + PBXBookmarksModule + Name + Bookmarks Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXClassBrowserModule + Name + Class Browser + + + BundleLoadPath + + MaxInstances + n + Module + PBXCVSModule + Name + Source Code Control Tool + + + BundleLoadPath + + MaxInstances + n + Module + PBXDebugBreakpointsModule + Name + Debug Breakpoints Tool + + + BundleLoadPath + + MaxInstances + n + Module + XCDockableInspector + Name + Inspector + + + BundleLoadPath + + MaxInstances + n + Module + PBXOpenQuicklyModule + Name + Open Quickly Tool + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugSessionModule + Name + Debugger + + + BundleLoadPath + + MaxInstances + 1 + Module + PBXDebugCLIModule + Name + Debug Console + + + BundleLoadPath + + MaxInstances + n + Module + XCSnapshotModule + Name + Snapshots Tool + + + BundlePath + /Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources + Description + DefaultDescriptionKey + DockingSystemVisible + + Extension + mode1v3 + FavBarConfig + + PBXProjectModuleGUID + A0A7DC5417CD5F7A00BBC65E + XCBarModuleItemNames + + XCBarModuleItems + + + FirstTimeWindowDisplayed + + Identifier + com.apple.perspectives.project.mode1v3 + MajorVersion + 33 + MinorVersion + 0 + Name + Default + Notifications + + OpenEditors + + PerspectiveWidths + + -1 + -1 + + Perspectives + + + ChosenToolbarItems + + active-combo-popup + action + NSToolbarFlexibleSpaceItem + debugger-enable-breakpoints + build-and-go + com.apple.ide.PBXToolbarStopButton + get-info + NSToolbarFlexibleSpaceItem + com.apple.pbx.toolbar.searchfield + + ControllerClassBaseName + + IconName + WindowOfProjectWithEditor + Identifier + perspective.project + IsVertical + + Layout + + + BecomeActive + + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FABC05509CD000000102 + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 29B97317FDCFA39411CA2CEA + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 2 + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 636}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 654}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 148 167 1299 695 0 0 1600 878 + + Module + PBXSmartGroupTreeModule + Proportion + 203pt + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20306471E060097A5F4 + PBXProjectModuleLabel + Default.png + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CE0B20406471E060097A5F4 + PBXProjectModuleLabel + Default.png + _historyCapacity + 0 + bookmark + A0EB08011955F31900B6E8C2 + history + + A0A7DE6817CD613C00BBC65E + A0BF9B7617CE4F1300ECBEF4 + A0BF9B7E17CE4F1300ECBEF4 + A0BF9B8A17CE4F1300ECBEF4 + A0BF9C0117D118D900ECBEF4 + A0BF9C7F17D658C200ECBEF4 + A0BF9D7F17D7AC4C00ECBEF4 + A0BF9D8217D7AC4C00ECBEF4 + A0BF9D8417D7AC4C00ECBEF4 + A00135A117DFABF1005B6829 + A0DA85F317E27F0E00A0E71B + A086B38017E9089C00FBD4FC + A086B40917EA7F2500FBD4FC + A0289DA117EB8E99006B27DB + A0289DA517EB8E99006B27DB + A0289DA617EB8E99006B27DB + A0289DA717EB8E99006B27DB + A0289DA917EB8E99006B27DB + A0289E1517EBE326006B27DB + A0870E3E17F20A410036E374 + A00656BC17F6231A00B54DF7 + A006571B17F8BB0400B54DF7 + A006580A17F8C0CF00B54DF7 + A04AA4C917F8FF61006DD6E3 + A04AA4CA17F8FF61006DD6E3 + A04AA4CB17F8FF61006DD6E3 + A04AA4D917F90011006DD6E3 + A04AA4DA17F90011006DD6E3 + A04AA4DB17F90011006DD6E3 + A04AA4DC17F90011006DD6E3 + A04AA4DD17F90011006DD6E3 + A04AA4DE17F90011006DD6E3 + A04AA4DF17F90011006DD6E3 + A04AA4E017F90011006DD6E3 + A05C8A9618047A3200A30C28 + A05C8A9818047A3200A30C28 + A00F744D1811DE220036FD0D + A050BB2F1816B2830093ECD5 + A0E583DE18195CA10060C035 + A0E583DF18195CA10060C035 + A0E583E418195CA10060C035 + A0E583E518195CA10060C035 + A0E583E818195CA10060C035 + A0E583E918195CA10060C035 + A0E583EA18195CA10060C035 + A0E583EB18195CA10060C035 + A0E583EC18195CA10060C035 + A0E583ED18195CA10060C035 + A0E583EE18195CA10060C035 + A0E583EF18195CA10060C035 + A0E583F118195CA10060C035 + A0E583F218195CA10060C035 + A0E583F718195CA10060C035 + A08EDEB7182ADF6C007AA38D + A08EDF5C182D3BEB007AA38D + A08EDF66182E55FF007AA38D + A08EDF67182E55FF007AA38D + A08EDF791830102B007AA38D + A08EDF8F1830142A007AA38D + A08EDFD518301DF2007AA38D + A08EE09518307E0B007AA38D + A08EE09618307E0B007AA38D + A08EE0F81832AF78007AA38D + A08EE0FE1832AF78007AA38D + A08EE0FF1832AF78007AA38D + A08EE1011832AF78007AA38D + A08EE10E1832B2F4007AA38D + A0C570AD1834050900EC50FC + A0C570AE1834050900EC50FC + A0C570AF1834050900EC50FC + A091942F183546750038BF65 + A0919432183546750038BF65 + A0919433183546750038BF65 + A08E0F7618383D17007A5DE6 + A08E0F7F18383D17007A5DE6 + A08E0F8718383D17007A5DE6 + A08E0F8818383D17007A5DE6 + A08E0F9718383D17007A5DE6 + A02A42EE183E878F0088CF1E + A02A42F3183E878F0088CF1E + A02A42F4183E878F0088CF1E + A02A42F5183E878F0088CF1E + A02A42F6183E878F0088CF1E + A02A42F7183E878F0088CF1E + A02A42F8183E878F0088CF1E + A02A4330183FE2080088CF1E + A08791E21875DBA100467ACB + A08791E41875DBA100467ACB + A08791EC1875DBA100467ACB + A08791F21875DBA100467ACB + A08792371875ECC200467ACB + A004598E187683B8005C20BB + A004598F187683B8005C20BB + A0045A6218774012005C20BB + A0045B03187763AF005C20BB + A0045B0B187763AF005C20BB + A0045B1B18776445005C20BB + A0045B1C18776445005C20BB + A0045B24187767EF005C20BB + A0045B25187767EF005C20BB + A0045B26187767EF005C20BB + A0045B27187767EF005C20BB + A0045B28187767EF005C20BB + A0045B3918776A9B005C20BB + A0045B4E187770C1005C20BB + A0045B79187777B0005C20BB + A0045B7C187777B0005C20BB + A0045B7D187777B0005C20BB + A0045B7E187777B0005C20BB + A0045B7F187777B0005C20BB + A0045B80187777B0005C20BB + A0045B81187777B0005C20BB + A0045B82187777B0005C20BB + A0045B83187777B0005C20BB + A0045B85187777B0005C20BB + A0045B86187777B0005C20BB + A0045B87187777B0005C20BB + A0045B89187777B0005C20BB + A0045B90187777B0005C20BB + A0045B91187777B0005C20BB + A0045B93187777B0005C20BB + A0045B94187777B0005C20BB + A0045BC118777FD6005C20BB + A0045BC418777FD6005C20BB + A0045BC518777FD6005C20BB + A0045BC618777FD6005C20BB + A0045BC718777FD6005C20BB + A0045BE7187784F3005C20BB + A0045BE8187784F3005C20BB + A0045BEA187784F3005C20BB + A0045C0018778936005C20BB + A0045C0218778936005C20BB + A0045C0318778936005C20BB + A0045C0518778A6F005C20BB + A0045C0618778A6F005C20BB + A0045C1118779950005C20BB + A0045C1218779950005C20BB + A0045C17187799B0005C20BB + A0962B341878F28A0031D5B1 + A0962B361878F28A0031D5B1 + A0962B371878F28A0031D5B1 + A0962B381878F28A0031D5B1 + A0962B3A1878F28A0031D5B1 + A0962B3B1878F28A0031D5B1 + A0962B421878F28A0031D5B1 + A0962B431878F28A0031D5B1 + A0962B5E1878F68F0031D5B1 + A0962B601878F68F0031D5B1 + A0962B611878F68F0031D5B1 + A0962B631878F68F0031D5B1 + A0962B761878FD220031D5B1 + A0962B771878FD220031D5B1 + A0962B781878FD220031D5B1 + A0962B791878FD220031D5B1 + A0962B7B1878FD220031D5B1 + A0962B7C1878FD220031D5B1 + A0962B9A187903370031D5B1 + A0962B9B187903370031D5B1 + A0962B9E187903370031D5B1 + A0962BA6187905BD0031D5B1 + A0962C25187DD6690031D5B1 + A0962C36187DD83F0031D5B1 + A0D9D1C71884BC33005CD3D8 + A0D9D1C81884BC33005CD3D8 + A0D9D1C91884BC33005CD3D8 + A0D9D1CA1884BC33005CD3D8 + A06368081884C680007B789C + A06368191884C9B3007B789C + A06368301884CE58007B789C + A08A15B7188EC4290028A41E + A08A15B8188EC4290028A41E + A02F1E531936763E00D8C5E9 + A0DD32F51954CC980000D832 + A0DD32F61954CC980000D832 + A0DD32F71954CC980000D832 + A0DD32F81954CC980000D832 + A0DD33101954CED10000D832 + A0DD33111954CED10000D832 + A0DD33121954CED10000D832 + A0DD33141954CED10000D832 + + + SplitCount + 1 + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {1091, 409}} + RubberWindowFrame + 148 167 1299 695 0 0 1600 878 + + Module + PBXNavigatorGroup + Proportion + 409pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CE0B20506471E060097A5F4 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{0, 414}, {1091, 240}} + RubberWindowFrame + 148 167 1299 695 0 0 1600 878 + + Module + XCDetailModule + Proportion + 240pt + + + Proportion + 1091pt + + + Name + Project + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + XCModuleDock + PBXNavigatorGroup + XCDetailModule + + TableOfContents + + A0EB07F71955F31900B6E8C2 + 1CE0B1FE06471DED0097A5F4 + A0EB07F81955F31900B6E8C2 + 1CE0B20306471E060097A5F4 + 1CE0B20506471E060097A5F4 + + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarConfiguration + xcode.toolbar.config.defaultV3 + + + ControllerClassBaseName + + IconName + WindowOfProject + Identifier + perspective.morph + IsVertical + 0 + Layout + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C37FBAC04509CD000000102 + 1C37FAAC04509CD000000102 + 1C08E77C0454961000C914BD + 1C37FABC05509CD000000102 + 1C37FABC05539CD112110102 + E2644B35053B69B200211256 + 1C37FABC04509CD000100104 + 1CC0EA4004350EF90044410B + 1CC0EA4004350EF90041110B + + PBXProjectModuleGUID + 11E0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + yes + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 186 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 29B97314FDCFA39411CA2CEA + 1C37FABC05509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {186, 337}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 1 + XCSharingToken + com.apple.Xcode.GFSharingToken + + GeometryConfiguration + + Frame + {{0, 0}, {203, 355}} + GroupTreeTableConfiguration + + MainColumn + 186 + + RubberWindowFrame + 373 269 690 397 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 100% + + + Name + Morph + PreferredWidth + 300 + ServiceClasses + + XCModuleDock + PBXSmartGroupTreeModule + + TableOfContents + + 11E0B1FE06471DED0097A5F4 + + ToolbarConfiguration + xcode.toolbar.config.default.shortV3 + + + PerspectivesBarVisible + + ShelfIsVisible + + SourceDescription + file at '/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' + StatusbarIsVisible + + TimeStamp + 0.0 + ToolbarConfigUserDefaultsMinorVersion + 2 + ToolbarDisplayMode + 1 + ToolbarIsVisible + + ToolbarSizeMode + 1 + Type + Perspectives + UpdateMessage + The Default Workspace in this version of Xcode now includes support to hide and show the detail view (what has been referred to as the "Metro-Morph" feature). You must discard your current Default Workspace settings and update to the latest Default Workspace in order to gain this feature. Do you wish to update to the latest Workspace defaults for project '%@'? + WindowJustification + 5 + WindowOrderList + + 1C78EAAD065D492600B07095 + 1CD10A99069EF8BA00B06720 + A0A7DC5517CD5F7A00BBC65E + /Users/luis/Documents/Xcode/SmashBros/SmashBros.xcodeproj + + WindowString + 148 167 1299 695 0 0 1600 878 + WindowToolsV3 + + + FirstTimeWindowDisplayed + + Identifier + windowTool.build + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528F0623707200166675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {927, 340}} + RubberWindowFrame + 544 195 927 622 0 0 1600 878 + + Module + PBXNavigatorGroup + Proportion + 340pt + + + ContentConfiguration + + PBXProjectModuleGUID + XCMainBuildResultsModuleGUID + PBXProjectModuleLabel + Build Results + XCBuildResultsTrigger_Collapse + 1021 + XCBuildResultsTrigger_Open + 1011 + + GeometryConfiguration + + Frame + {{0, 345}, {927, 236}} + RubberWindowFrame + 544 195 927 622 0 0 1600 878 + + Module + PBXBuildResultsModule + Proportion + 236pt + + + Proportion + 581pt + + + Name + Build Results + ServiceClasses + + PBXBuildResultsModule + + StatusbarIsVisible + + TableOfContents + + A0A7DC5517CD5F7A00BBC65E + A0EB07F91955F31900B6E8C2 + 1CD0528F0623707200166675 + XCMainBuildResultsModuleGUID + + ToolbarConfiguration + xcode.toolbar.config.buildV3 + WindowContentMinSize + 486 300 + WindowString + 544 195 927 622 0 0 1600 878 + WindowToolGUID + A0A7DC5517CD5F7A00BBC65E + WindowToolIsVisible + + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debugger + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + Debugger + + HorizontalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {316, 203}} + {{316, 0}, {378, 203}} + + + VerticalSplitView + + _collapsingFrameDimension + 0.0 + _indexOfCollapsedView + 0 + _percentageOfCollapsedView + 0.0 + isCollapsed + yes + sizes + + {{0, 0}, {694, 203}} + {{0, 203}, {694, 178}} + + + + LauncherConfigVersion + 8 + PBXProjectModuleGUID + 1C162984064C10D400B95A72 + PBXProjectModuleLabel + Debug - GLUTExamples (Underwater) + + GeometryConfiguration + + DebugConsoleVisible + None + DebugConsoleWindowFrame + {{200, 200}, {500, 300}} + DebugSTDIOWindowFrame + {{200, 200}, {500, 300}} + Frame + {{0, 0}, {694, 381}} + PBXDebugSessionStackFrameViewKey + + DebugVariablesTableConfiguration + + Name + 120 + Value + 85 + Summary + 148 + + Frame + {{316, 0}, {378, 203}} + RubberWindowFrame + 227 357 694 422 0 0 1600 878 + + RubberWindowFrame + 227 357 694 422 0 0 1600 878 + + Module + PBXDebugSessionModule + Proportion + 381pt + + + Proportion + 381pt + + + Name + Debugger + ServiceClasses + + PBXDebugSessionModule + + StatusbarIsVisible + + TableOfContents + + 1CD10A99069EF8BA00B06720 + A0EB07FA1955F31900B6E8C2 + 1C162984064C10D400B95A72 + A0EB07FB1955F31900B6E8C2 + A0EB07FC1955F31900B6E8C2 + A0EB07FD1955F31900B6E8C2 + A0EB07FE1955F31900B6E8C2 + A0EB07FF1955F31900B6E8C2 + + ToolbarConfiguration + xcode.toolbar.config.debugV3 + WindowString + 227 357 694 422 0 0 1600 878 + WindowToolGUID + 1CD10A99069EF8BA00B06720 + WindowToolIsVisible + + + + FirstTimeWindowDisplayed + + Identifier + windowTool.find + IsVertical + + Layout + + + Dock + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1CDD528C0622207200134675 + PBXProjectModuleLabel + + StatusBarVisibility + + + GeometryConfiguration + + Frame + {{0, 0}, {781, 212}} + RubberWindowFrame + 650 381 781 470 0 0 1600 878 + + Module + PBXNavigatorGroup + Proportion + 781pt + + + Proportion + 212pt + + + BecomeActive + + ContentConfiguration + + PBXProjectModuleGUID + 1CD0528E0623707200166675 + PBXProjectModuleLabel + Project Find + + GeometryConfiguration + + Frame + {{0, 217}, {781, 212}} + RubberWindowFrame + 650 381 781 470 0 0 1600 878 + + Module + PBXProjectFindModule + Proportion + 212pt + + + Proportion + 429pt + + + Name + Project Find + ServiceClasses + + PBXProjectFindModule + + StatusbarIsVisible + + TableOfContents + + 1C530D57069F1CE1000CFCEE + A0962C32187DD7420031D5B1 + A0962C33187DD7420031D5B1 + 1CDD528C0622207200134675 + 1CD0528E0623707200166675 + + WindowString + 650 381 781 470 0 0 1600 878 + WindowToolGUID + 1C530D57069F1CE1000CFCEE + WindowToolIsVisible + + + + Identifier + MENUSEPARATOR + + + FirstTimeWindowDisplayed + + Identifier + windowTool.debuggerConsole + IsVertical + + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAAC065D492600B07095 + PBXProjectModuleLabel + Debugger Console + + GeometryConfiguration + + Frame + {{0, 0}, {649, 208}} + RubberWindowFrame + 920 424 649 249 0 0 1600 878 + + Module + PBXDebugCLIModule + Proportion + 208pt + + + Proportion + 208pt + + + Name + Debugger Console + ServiceClasses + + PBXDebugCLIModule + + StatusbarIsVisible + + TableOfContents + + 1C78EAAD065D492600B07095 + A0EB08001955F31900B6E8C2 + 1C78EAAC065D492600B07095 + + ToolbarConfiguration + xcode.toolbar.config.consoleV3 + WindowString + 920 424 649 249 0 0 1600 878 + WindowToolGUID + 1C78EAAD065D492600B07095 + WindowToolIsVisible + + + + Identifier + windowTool.snapshots + Layout + + + Dock + + + Module + XCSnapshotModule + Proportion + 100% + + + Proportion + 100% + + + Name + Snapshots + ServiceClasses + + XCSnapshotModule + + StatusbarIsVisible + Yes + ToolbarConfiguration + xcode.toolbar.config.snapshots + WindowString + 315 824 300 550 0 0 1440 878 + WindowToolIsVisible + Yes + + + Identifier + windowTool.scm + Layout + + + Dock + + + ContentConfiguration + + PBXProjectModuleGUID + 1C78EAB2065D492600B07095 + PBXProjectModuleLabel + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1C78EAB3065D492600B07095 + + SplitCount + 1 + + StatusBarVisibility + 1 + + GeometryConfiguration + + Frame + {{0, 0}, {452, 0}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + + Module + PBXNavigatorGroup + Proportion + 0pt + + + BecomeActive + 1 + ContentConfiguration + + PBXProjectModuleGUID + 1CD052920623707200166675 + PBXProjectModuleLabel + SCM + + GeometryConfiguration + + ConsoleFrame + {{0, 259}, {452, 0}} + Frame + {{0, 7}, {452, 259}} + RubberWindowFrame + 743 379 452 308 0 0 1280 1002 + TableConfiguration + + Status + 30 + FileName + 199 + Path + 197.0950012207031 + + TableFrame + {{0, 0}, {452, 250}} + + Module + PBXCVSModule + Proportion + 262pt + + + Proportion + 266pt + + + Name + SCM + ServiceClasses + + PBXCVSModule + + StatusbarIsVisible + 1 + TableOfContents + + 1C78EAB4065D492600B07095 + 1C78EAB5065D492600B07095 + 1C78EAB2065D492600B07095 + 1CD052920623707200166675 + + ToolbarConfiguration + xcode.toolbar.config.scm + WindowString + 743 379 452 308 0 0 1280 1002 + + + Identifier + windowTool.breakpoints + IsVertical + 0 + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + PBXBottomSmartGroupGIDs + + 1C77FABC04509CD000000102 + + PBXProjectModuleGUID + 1CE0B1FE06471DED0097A5F4 + PBXProjectModuleLabel + Files + PBXProjectStructureProvided + no + PBXSmartGroupTreeModuleColumnData + + PBXSmartGroupTreeModuleColumnWidthsKey + + 168 + + PBXSmartGroupTreeModuleColumnsKey_v4 + + MainColumn + + + PBXSmartGroupTreeModuleOutlineStateKey_v7 + + PBXSmartGroupTreeModuleOutlineStateExpansionKey + + 1C77FABC04509CD000000102 + + PBXSmartGroupTreeModuleOutlineStateSelectionKey + + + 0 + + + PBXSmartGroupTreeModuleOutlineStateVisibleRectKey + {{0, 0}, {168, 350}} + + PBXTopSmartGroupGIDs + + XCIncludePerspectivesSwitch + 0 + + GeometryConfiguration + + Frame + {{0, 0}, {185, 368}} + GroupTreeTableConfiguration + + MainColumn + 168 + + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + PBXSmartGroupTreeModule + Proportion + 185pt + + + ContentConfiguration + + PBXProjectModuleGUID + 1CA1AED706398EBD00589147 + PBXProjectModuleLabel + Detail + + GeometryConfiguration + + Frame + {{190, 0}, {554, 368}} + RubberWindowFrame + 315 424 744 409 0 0 1440 878 + + Module + XCDetailModule + Proportion + 554pt + + + Proportion + 368pt + + + MajorVersion + 3 + MinorVersion + 0 + Name + Breakpoints + ServiceClasses + + PBXSmartGroupTreeModule + XCDetailModule + + StatusbarIsVisible + 1 + TableOfContents + + 1CDDB66807F98D9800BB5817 + 1CDDB66907F98D9800BB5817 + 1CE0B1FE06471DED0097A5F4 + 1CA1AED706398EBD00589147 + + ToolbarConfiguration + xcode.toolbar.config.breakpointsV3 + WindowString + 315 424 744 409 0 0 1440 878 + WindowToolGUID + 1CDDB66807F98D9800BB5817 + WindowToolIsVisible + 1 + + + Identifier + windowTool.debugAnimator + Layout + + + Dock + + + Module + PBXNavigatorGroup + Proportion + 100% + + + Proportion + 100% + + + Name + Debug Visualizer + ServiceClasses + + PBXNavigatorGroup + + StatusbarIsVisible + 1 + ToolbarConfiguration + xcode.toolbar.config.debugAnimatorV3 + WindowString + 100 100 700 500 0 0 1280 1002 + + + Identifier + windowTool.bookmarks + Layout + + + Dock + + + Module + PBXBookmarksModule + Proportion + 100% + + + Proportion + 100% + + + Name + Bookmarks + ServiceClasses + + PBXBookmarksModule + + StatusbarIsVisible + 0 + WindowString + 538 42 401 187 0 0 1280 1002 + + + Identifier + windowTool.projectFormatConflicts + Layout + + + Dock + + + Module + XCProjectFormatConflictsModule + Proportion + 100% + + + Proportion + 100% + + + Name + Project Format Conflicts + ServiceClasses + + XCProjectFormatConflictsModule + + StatusbarIsVisible + 0 + WindowContentMinSize + 450 300 + WindowString + 50 850 472 307 0 0 1440 877 + + + Identifier + windowTool.classBrowser + Layout + + + Dock + + + BecomeActive + 1 + ContentConfiguration + + OptionsSetName + Hierarchy, all classes + PBXProjectModuleGUID + 1CA6456E063B45B4001379D8 + PBXProjectModuleLabel + Class Browser - NSObject + + GeometryConfiguration + + ClassesFrame + {{0, 0}, {374, 96}} + ClassesTreeTableConfiguration + + PBXClassNameColumnIdentifier + 208 + PBXClassBookColumnIdentifier + 22 + + Frame + {{0, 0}, {630, 331}} + MembersFrame + {{0, 105}, {374, 395}} + MembersTreeTableConfiguration + + PBXMemberTypeIconColumnIdentifier + 22 + PBXMemberNameColumnIdentifier + 216 + PBXMemberTypeColumnIdentifier + 97 + PBXMemberBookColumnIdentifier + 22 + + PBXModuleWindowStatusBarHidden2 + 1 + RubberWindowFrame + 385 179 630 352 0 0 1440 878 + + Module + PBXClassBrowserModule + Proportion + 332pt + + + Proportion + 332pt + + + Name + Class Browser + ServiceClasses + + PBXClassBrowserModule + + StatusbarIsVisible + 0 + TableOfContents + + 1C0AD2AF069F1E9B00FABCE6 + 1C0AD2B0069F1E9B00FABCE6 + 1CA6456E063B45B4001379D8 + + ToolbarConfiguration + xcode.toolbar.config.classbrowser + WindowString + 385 179 630 352 0 0 1440 878 + WindowToolGUID + 1C0AD2AF069F1E9B00FABCE6 + WindowToolIsVisible + 0 + + + Identifier + windowTool.refactoring + IncludeInToolsMenu + 0 + Layout + + + Dock + + + BecomeActive + 1 + GeometryConfiguration + + Frame + {0, 0}, {500, 335} + RubberWindowFrame + {0, 0}, {500, 335} + + Module + XCRefactoringModule + Proportion + 100% + + + Proportion + 100% + + + Name + Refactoring + ServiceClasses + + XCRefactoringModule + + WindowString + 200 200 500 356 0 0 1920 1200 + + + + diff --git a/SmashBros.xcodeproj/luis.pbxuser b/SmashBros.xcodeproj/luis.pbxuser new file mode 100644 index 0000000..de9f4ad --- /dev/null +++ b/SmashBros.xcodeproj/luis.pbxuser @@ -0,0 +1,3714 @@ +// !$*UTF8*$! +{ + 1D6058900D05DD3D006BFB54 /* GameEngine */ = { + activeExec = 0; + executables = ( + A0A7DC3A17CD5F7500BBC65E /* GameEngine */, + ); + }; + 29B97313FDCFA39411CA2CEA /* Project object */ = { + activeArchitecturePreference = armv6; + activeBuildConfigurationName = Debug; + activeExecutable = A0A7DC3A17CD5F7500BBC65E /* GameEngine */; + activeSDKPreference = iphonesimulator4.2; + activeTarget = 1D6058900D05DD3D006BFB54 /* GameEngine */; + addToTargets = ( + 1D6058900D05DD3D006BFB54 /* GameEngine */, + ); + breakpoints = ( + ); + codeSenseManager = A0A7DC5817CD5F7A00BBC65E /* Code sense */; + executables = ( + A0A7DC3A17CD5F7500BBC65E /* GameEngine */, + ); + perUserDictionary = { + PBXConfiguration.PBXFileTableDataSource3.PBXBookmarksDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXBookmarksDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 200, + 200, + 629, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXBookmarksDataSource_LocationID, + PBXBookmarksDataSource_NameID, + PBXBookmarksDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXExecutablesDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXExecutablesDataSource_NameID; + PBXFileTableDataSourceColumnWidthsKey = ( + 22, + 300, + 707, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXExecutablesDataSource_ActiveFlagID, + PBXExecutablesDataSource_NameID, + PBXExecutablesDataSource_CommentsID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = 1; + PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID; + PBXFileTableDataSourceColumnWidthsKey = ( + 20, + 852, + 20, + 48, + 43, + 43, + 20, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFileDataSource_FiletypeID, + PBXFileDataSource_Filename_ColumnID, + PBXFileDataSource_Built_ColumnID, + PBXFileDataSource_ObjectSize_ColumnID, + PBXFileDataSource_Errors_ColumnID, + PBXFileDataSource_Warnings_ColumnID, + PBXFileDataSource_Target_ColumnID, + ); + }; + PBXConfiguration.PBXFileTableDataSource3.PBXFindDataSource = { + PBXFileTableDataSourceColumnSortingDirectionKey = "-1"; + PBXFileTableDataSourceColumnSortingKey = PBXFindDataSource_LocationID; + PBXFileTableDataSourceColumnWidthsKey = ( + 200, + 842, + ); + PBXFileTableDataSourceColumnsKey = ( + PBXFindDataSource_MessageID, + PBXFindDataSource_LocationID, + ); + }; + PBXPerProjectTemplateStateSaveDate = 425063172; + PBXWorkspaceStateSaveDate = 425063172; + }; + perUserProjectItems = { + A00135A117DFABF1005B6829 /* PBXBookmark */ = A00135A117DFABF1005B6829 /* PBXBookmark */; + A004598E187683B8005C20BB /* PBXTextBookmark */ = A004598E187683B8005C20BB /* PBXTextBookmark */; + A004598F187683B8005C20BB /* PBXTextBookmark */ = A004598F187683B8005C20BB /* PBXTextBookmark */; + A0045A6218774012005C20BB /* PBXTextBookmark */ = A0045A6218774012005C20BB /* PBXTextBookmark */; + A0045B03187763AF005C20BB /* PBXTextBookmark */ = A0045B03187763AF005C20BB /* PBXTextBookmark */; + A0045B0B187763AF005C20BB /* PBXTextBookmark */ = A0045B0B187763AF005C20BB /* PBXTextBookmark */; + A0045B1B18776445005C20BB /* PBXTextBookmark */ = A0045B1B18776445005C20BB /* PBXTextBookmark */; + A0045B1C18776445005C20BB /* PBXTextBookmark */ = A0045B1C18776445005C20BB /* PBXTextBookmark */; + A0045B24187767EF005C20BB /* PBXTextBookmark */ = A0045B24187767EF005C20BB /* PBXTextBookmark */; + A0045B25187767EF005C20BB /* PBXTextBookmark */ = A0045B25187767EF005C20BB /* PBXTextBookmark */; + A0045B26187767EF005C20BB /* PBXTextBookmark */ = A0045B26187767EF005C20BB /* PBXTextBookmark */; + A0045B27187767EF005C20BB /* PBXTextBookmark */ = A0045B27187767EF005C20BB /* PBXTextBookmark */; + A0045B28187767EF005C20BB /* PBXTextBookmark */ = A0045B28187767EF005C20BB /* PBXTextBookmark */; + A0045B3918776A9B005C20BB /* PBXTextBookmark */ = A0045B3918776A9B005C20BB /* PBXTextBookmark */; + A0045B4E187770C1005C20BB /* PBXTextBookmark */ = A0045B4E187770C1005C20BB /* PBXTextBookmark */; + A0045B79187777B0005C20BB /* PBXTextBookmark */ = A0045B79187777B0005C20BB /* PBXTextBookmark */; + A0045B7C187777B0005C20BB /* PBXTextBookmark */ = A0045B7C187777B0005C20BB /* PBXTextBookmark */; + A0045B7D187777B0005C20BB /* PBXTextBookmark */ = A0045B7D187777B0005C20BB /* PBXTextBookmark */; + A0045B7E187777B0005C20BB /* PBXTextBookmark */ = A0045B7E187777B0005C20BB /* PBXTextBookmark */; + A0045B7F187777B0005C20BB /* PBXTextBookmark */ = A0045B7F187777B0005C20BB /* PBXTextBookmark */; + A0045B80187777B0005C20BB /* PBXTextBookmark */ = A0045B80187777B0005C20BB /* PBXTextBookmark */; + A0045B81187777B0005C20BB /* PBXTextBookmark */ = A0045B81187777B0005C20BB /* PBXTextBookmark */; + A0045B82187777B0005C20BB /* PBXTextBookmark */ = A0045B82187777B0005C20BB /* PBXTextBookmark */; + A0045B83187777B0005C20BB /* PBXTextBookmark */ = A0045B83187777B0005C20BB /* PBXTextBookmark */; + A0045B85187777B0005C20BB /* PBXTextBookmark */ = A0045B85187777B0005C20BB /* PBXTextBookmark */; + A0045B86187777B0005C20BB /* PBXTextBookmark */ = A0045B86187777B0005C20BB /* PBXTextBookmark */; + A0045B87187777B0005C20BB /* PBXTextBookmark */ = A0045B87187777B0005C20BB /* PBXTextBookmark */; + A0045B89187777B0005C20BB /* PBXTextBookmark */ = A0045B89187777B0005C20BB /* PBXTextBookmark */; + A0045B90187777B0005C20BB /* PBXTextBookmark */ = A0045B90187777B0005C20BB /* PBXTextBookmark */; + A0045B91187777B0005C20BB /* PBXTextBookmark */ = A0045B91187777B0005C20BB /* PBXTextBookmark */; + A0045B93187777B0005C20BB /* PBXTextBookmark */ = A0045B93187777B0005C20BB /* PBXTextBookmark */; + A0045B94187777B0005C20BB /* PBXTextBookmark */ = A0045B94187777B0005C20BB /* PBXTextBookmark */; + A0045BC118777FD6005C20BB /* PBXTextBookmark */ = A0045BC118777FD6005C20BB /* PBXTextBookmark */; + A0045BC418777FD6005C20BB /* PBXTextBookmark */ = A0045BC418777FD6005C20BB /* PBXTextBookmark */; + A0045BC518777FD6005C20BB /* PBXTextBookmark */ = A0045BC518777FD6005C20BB /* PBXTextBookmark */; + A0045BC618777FD6005C20BB /* PBXTextBookmark */ = A0045BC618777FD6005C20BB /* PBXTextBookmark */; + A0045BC718777FD6005C20BB /* PBXTextBookmark */ = A0045BC718777FD6005C20BB /* PBXTextBookmark */; + A0045BE7187784F3005C20BB /* PBXTextBookmark */ = A0045BE7187784F3005C20BB /* PBXTextBookmark */; + A0045BE8187784F3005C20BB /* PBXTextBookmark */ = A0045BE8187784F3005C20BB /* PBXTextBookmark */; + A0045BEA187784F3005C20BB /* PBXTextBookmark */ = A0045BEA187784F3005C20BB /* PBXTextBookmark */; + A0045C0018778936005C20BB /* PBXTextBookmark */ = A0045C0018778936005C20BB /* PBXTextBookmark */; + A0045C0218778936005C20BB /* PBXTextBookmark */ = A0045C0218778936005C20BB /* PBXTextBookmark */; + A0045C0318778936005C20BB /* PBXTextBookmark */ = A0045C0318778936005C20BB /* PBXTextBookmark */; + A0045C0518778A6F005C20BB /* PBXTextBookmark */ = A0045C0518778A6F005C20BB /* PBXTextBookmark */; + A0045C0618778A6F005C20BB /* PBXTextBookmark */ = A0045C0618778A6F005C20BB /* PBXTextBookmark */; + A0045C1118779950005C20BB /* PBXTextBookmark */ = A0045C1118779950005C20BB /* PBXTextBookmark */; + A0045C1218779950005C20BB /* PBXTextBookmark */ = A0045C1218779950005C20BB /* PBXTextBookmark */; + A0045C17187799B0005C20BB /* PBXTextBookmark */ = A0045C17187799B0005C20BB /* PBXTextBookmark */; + A00656BC17F6231A00B54DF7 /* PBXTextBookmark */ = A00656BC17F6231A00B54DF7 /* PBXTextBookmark */; + A006571B17F8BB0400B54DF7 /* PBXTextBookmark */ = A006571B17F8BB0400B54DF7 /* PBXTextBookmark */; + A006580A17F8C0CF00B54DF7 /* PBXTextBookmark */ = A006580A17F8C0CF00B54DF7 /* PBXTextBookmark */; + A00F744D1811DE220036FD0D /* PBXBookmark */ = A00F744D1811DE220036FD0D /* PBXBookmark */; + A0289DA117EB8E99006B27DB /* PBXTextBookmark */ = A0289DA117EB8E99006B27DB /* PBXTextBookmark */; + A0289DA517EB8E99006B27DB /* PBXTextBookmark */ = A0289DA517EB8E99006B27DB /* PBXTextBookmark */; + A0289DA617EB8E99006B27DB /* PBXTextBookmark */ = A0289DA617EB8E99006B27DB /* PBXTextBookmark */; + A0289DA717EB8E99006B27DB /* PBXTextBookmark */ = A0289DA717EB8E99006B27DB /* PBXTextBookmark */; + A0289DA917EB8E99006B27DB /* PBXTextBookmark */ = A0289DA917EB8E99006B27DB /* PBXTextBookmark */; + A0289E1517EBE326006B27DB /* PBXTextBookmark */ = A0289E1517EBE326006B27DB /* PBXTextBookmark */; + A02A42EE183E878F0088CF1E /* PBXTextBookmark */ = A02A42EE183E878F0088CF1E /* PBXTextBookmark */; + A02A42F3183E878F0088CF1E /* PBXTextBookmark */ = A02A42F3183E878F0088CF1E /* PBXTextBookmark */; + A02A42F4183E878F0088CF1E /* PBXTextBookmark */ = A02A42F4183E878F0088CF1E /* PBXTextBookmark */; + A02A42F5183E878F0088CF1E /* PBXTextBookmark */ = A02A42F5183E878F0088CF1E /* PBXTextBookmark */; + A02A42F6183E878F0088CF1E /* PBXTextBookmark */ = A02A42F6183E878F0088CF1E /* PBXTextBookmark */; + A02A42F7183E878F0088CF1E /* PBXTextBookmark */ = A02A42F7183E878F0088CF1E /* PBXTextBookmark */; + A02A42F8183E878F0088CF1E /* PBXTextBookmark */ = A02A42F8183E878F0088CF1E /* PBXTextBookmark */; + A02A4330183FE2080088CF1E /* PBXTextBookmark */ = A02A4330183FE2080088CF1E /* PBXTextBookmark */; + A02F1E531936763E00D8C5E9 /* PBXTextBookmark */ = A02F1E531936763E00D8C5E9 /* PBXTextBookmark */; + A04AA4C917F8FF61006DD6E3 /* PBXTextBookmark */ = A04AA4C917F8FF61006DD6E3 /* PBXTextBookmark */; + A04AA4CA17F8FF61006DD6E3 /* PBXTextBookmark */ = A04AA4CA17F8FF61006DD6E3 /* PBXTextBookmark */; + A04AA4CB17F8FF61006DD6E3 /* PBXTextBookmark */ = A04AA4CB17F8FF61006DD6E3 /* PBXTextBookmark */; + A04AA4D917F90011006DD6E3 /* PBXTextBookmark */ = A04AA4D917F90011006DD6E3 /* PBXTextBookmark */; + A04AA4DA17F90011006DD6E3 /* PBXTextBookmark */ = A04AA4DA17F90011006DD6E3 /* PBXTextBookmark */; + A04AA4DB17F90011006DD6E3 /* PBXTextBookmark */ = A04AA4DB17F90011006DD6E3 /* PBXTextBookmark */; + A04AA4DC17F90011006DD6E3 /* PBXTextBookmark */ = A04AA4DC17F90011006DD6E3 /* PBXTextBookmark */; + A04AA4DD17F90011006DD6E3 /* PBXTextBookmark */ = A04AA4DD17F90011006DD6E3 /* PBXTextBookmark */; + A04AA4DE17F90011006DD6E3 /* PBXTextBookmark */ = A04AA4DE17F90011006DD6E3 /* PBXTextBookmark */; + A04AA4DF17F90011006DD6E3 /* PBXTextBookmark */ = A04AA4DF17F90011006DD6E3 /* PBXTextBookmark */; + A04AA4E017F90011006DD6E3 /* PBXTextBookmark */ = A04AA4E017F90011006DD6E3 /* PBXTextBookmark */; + A050BB2F1816B2830093ECD5 /* PBXTextBookmark */ = A050BB2F1816B2830093ECD5 /* PBXTextBookmark */; + A05C8A9618047A3200A30C28 /* PBXTextBookmark */ = A05C8A9618047A3200A30C28 /* PBXTextBookmark */; + A05C8A9818047A3200A30C28 /* PBXTextBookmark */ = A05C8A9818047A3200A30C28 /* PBXTextBookmark */; + A06368081884C680007B789C /* PBXTextBookmark */ = A06368081884C680007B789C /* PBXTextBookmark */; + A06368191884C9B3007B789C /* PBXTextBookmark */ = A06368191884C9B3007B789C /* PBXTextBookmark */; + A06368301884CE58007B789C /* PBXTextBookmark */ = A06368301884CE58007B789C /* PBXTextBookmark */; + A086B38017E9089C00FBD4FC /* PBXTextBookmark */ = A086B38017E9089C00FBD4FC /* PBXTextBookmark */; + A086B40917EA7F2500FBD4FC /* PBXTextBookmark */ = A086B40917EA7F2500FBD4FC /* PBXTextBookmark */; + A0870E3E17F20A410036E374 /* PBXTextBookmark */ = A0870E3E17F20A410036E374 /* PBXTextBookmark */; + A08791E21875DBA100467ACB /* PBXTextBookmark */ = A08791E21875DBA100467ACB /* PBXTextBookmark */; + A08791E41875DBA100467ACB /* PBXTextBookmark */ = A08791E41875DBA100467ACB /* PBXTextBookmark */; + A08791EC1875DBA100467ACB /* PBXTextBookmark */ = A08791EC1875DBA100467ACB /* PBXTextBookmark */; + A08791F21875DBA100467ACB /* PBXTextBookmark */ = A08791F21875DBA100467ACB /* PBXTextBookmark */; + A08792371875ECC200467ACB /* PBXTextBookmark */ = A08792371875ECC200467ACB /* PBXTextBookmark */; + A08A15B7188EC4290028A41E /* PBXTextBookmark */ = A08A15B7188EC4290028A41E /* PBXTextBookmark */; + A08A15B8188EC4290028A41E /* PBXTextBookmark */ = A08A15B8188EC4290028A41E /* PBXTextBookmark */; + A08E0F7618383D17007A5DE6 /* PBXTextBookmark */ = A08E0F7618383D17007A5DE6 /* PBXTextBookmark */; + A08E0F7F18383D17007A5DE6 /* PBXTextBookmark */ = A08E0F7F18383D17007A5DE6 /* PBXTextBookmark */; + A08E0F8718383D17007A5DE6 /* PBXTextBookmark */ = A08E0F8718383D17007A5DE6 /* PBXTextBookmark */; + A08E0F8818383D17007A5DE6 /* PBXTextBookmark */ = A08E0F8818383D17007A5DE6 /* PBXTextBookmark */; + A08E0F9718383D17007A5DE6 /* PBXTextBookmark */ = A08E0F9718383D17007A5DE6 /* PBXTextBookmark */; + A08EDEB7182ADF6C007AA38D /* PBXTextBookmark */ = A08EDEB7182ADF6C007AA38D /* PBXTextBookmark */; + A08EDF5C182D3BEB007AA38D /* PBXTextBookmark */ = A08EDF5C182D3BEB007AA38D /* PBXTextBookmark */; + A08EDF66182E55FF007AA38D /* PBXTextBookmark */ = A08EDF66182E55FF007AA38D /* PBXTextBookmark */; + A08EDF67182E55FF007AA38D /* PBXTextBookmark */ = A08EDF67182E55FF007AA38D /* PBXTextBookmark */; + A08EDF791830102B007AA38D /* PBXTextBookmark */ = A08EDF791830102B007AA38D /* PBXTextBookmark */; + A08EDF8F1830142A007AA38D /* PBXTextBookmark */ = A08EDF8F1830142A007AA38D /* PBXTextBookmark */; + A08EDFD518301DF2007AA38D /* PBXTextBookmark */ = A08EDFD518301DF2007AA38D /* PBXTextBookmark */; + A08EE09518307E0B007AA38D /* PBXTextBookmark */ = A08EE09518307E0B007AA38D /* PBXTextBookmark */; + A08EE09618307E0B007AA38D /* PBXTextBookmark */ = A08EE09618307E0B007AA38D /* PBXTextBookmark */; + A08EE0F81832AF78007AA38D /* PBXTextBookmark */ = A08EE0F81832AF78007AA38D /* PBXTextBookmark */; + A08EE0FE1832AF78007AA38D /* PBXTextBookmark */ = A08EE0FE1832AF78007AA38D /* PBXTextBookmark */; + A08EE0FF1832AF78007AA38D /* PBXTextBookmark */ = A08EE0FF1832AF78007AA38D /* PBXTextBookmark */; + A08EE1011832AF78007AA38D /* PBXTextBookmark */ = A08EE1011832AF78007AA38D /* PBXTextBookmark */; + A08EE10E1832B2F4007AA38D /* PBXTextBookmark */ = A08EE10E1832B2F4007AA38D /* PBXTextBookmark */; + A091942F183546750038BF65 /* PBXTextBookmark */ = A091942F183546750038BF65 /* PBXTextBookmark */; + A0919432183546750038BF65 /* PBXTextBookmark */ = A0919432183546750038BF65 /* PBXTextBookmark */; + A0919433183546750038BF65 /* PBXTextBookmark */ = A0919433183546750038BF65 /* PBXTextBookmark */; + A0962B341878F28A0031D5B1 /* PBXTextBookmark */ = A0962B341878F28A0031D5B1 /* PBXTextBookmark */; + A0962B361878F28A0031D5B1 /* PBXTextBookmark */ = A0962B361878F28A0031D5B1 /* PBXTextBookmark */; + A0962B371878F28A0031D5B1 /* PBXTextBookmark */ = A0962B371878F28A0031D5B1 /* PBXTextBookmark */; + A0962B381878F28A0031D5B1 /* PBXTextBookmark */ = A0962B381878F28A0031D5B1 /* PBXTextBookmark */; + A0962B3A1878F28A0031D5B1 /* PBXTextBookmark */ = A0962B3A1878F28A0031D5B1 /* PBXTextBookmark */; + A0962B3B1878F28A0031D5B1 /* PBXTextBookmark */ = A0962B3B1878F28A0031D5B1 /* PBXTextBookmark */; + A0962B421878F28A0031D5B1 /* PBXTextBookmark */ = A0962B421878F28A0031D5B1 /* PBXTextBookmark */; + A0962B431878F28A0031D5B1 /* PBXTextBookmark */ = A0962B431878F28A0031D5B1 /* PBXTextBookmark */; + A0962B5E1878F68F0031D5B1 /* PBXTextBookmark */ = A0962B5E1878F68F0031D5B1 /* PBXTextBookmark */; + A0962B601878F68F0031D5B1 /* PBXTextBookmark */ = A0962B601878F68F0031D5B1 /* PBXTextBookmark */; + A0962B611878F68F0031D5B1 /* PBXTextBookmark */ = A0962B611878F68F0031D5B1 /* PBXTextBookmark */; + A0962B631878F68F0031D5B1 /* PBXTextBookmark */ = A0962B631878F68F0031D5B1 /* PBXTextBookmark */; + A0962B761878FD220031D5B1 /* PBXTextBookmark */ = A0962B761878FD220031D5B1 /* PBXTextBookmark */; + A0962B771878FD220031D5B1 /* PBXTextBookmark */ = A0962B771878FD220031D5B1 /* PBXTextBookmark */; + A0962B781878FD220031D5B1 /* PBXTextBookmark */ = A0962B781878FD220031D5B1 /* PBXTextBookmark */; + A0962B791878FD220031D5B1 /* PBXTextBookmark */ = A0962B791878FD220031D5B1 /* PBXTextBookmark */; + A0962B7B1878FD220031D5B1 /* PBXTextBookmark */ = A0962B7B1878FD220031D5B1 /* PBXTextBookmark */; + A0962B7C1878FD220031D5B1 /* PBXTextBookmark */ = A0962B7C1878FD220031D5B1 /* PBXTextBookmark */; + A0962B9A187903370031D5B1 /* PBXTextBookmark */ = A0962B9A187903370031D5B1 /* PBXTextBookmark */; + A0962B9B187903370031D5B1 /* PBXTextBookmark */ = A0962B9B187903370031D5B1 /* PBXTextBookmark */; + A0962B9E187903370031D5B1 /* PBXTextBookmark */ = A0962B9E187903370031D5B1 /* PBXTextBookmark */; + A0962BA6187905BD0031D5B1 /* PBXTextBookmark */ = A0962BA6187905BD0031D5B1 /* PBXTextBookmark */; + A0962C25187DD6690031D5B1 /* PBXTextBookmark */ = A0962C25187DD6690031D5B1 /* PBXTextBookmark */; + A0962C36187DD83F0031D5B1 /* PBXTextBookmark */ = A0962C36187DD83F0031D5B1 /* PBXTextBookmark */; + A0A7DE6817CD613C00BBC65E /* PBXBookmark */ = A0A7DE6817CD613C00BBC65E /* PBXBookmark */; + A0BF9B7617CE4F1300ECBEF4 /* PBXTextBookmark */ = A0BF9B7617CE4F1300ECBEF4 /* PBXTextBookmark */; + A0BF9B7E17CE4F1300ECBEF4 /* PBXTextBookmark */ = A0BF9B7E17CE4F1300ECBEF4 /* PBXTextBookmark */; + A0BF9B8A17CE4F1300ECBEF4 /* PBXTextBookmark */ = A0BF9B8A17CE4F1300ECBEF4 /* PBXTextBookmark */; + A0BF9C0117D118D900ECBEF4 /* PBXTextBookmark */ = A0BF9C0117D118D900ECBEF4 /* PBXTextBookmark */; + A0BF9C7F17D658C200ECBEF4 /* PBXTextBookmark */ = A0BF9C7F17D658C200ECBEF4 /* PBXTextBookmark */; + A0BF9D7F17D7AC4C00ECBEF4 /* PBXTextBookmark */ = A0BF9D7F17D7AC4C00ECBEF4 /* PBXTextBookmark */; + A0BF9D8217D7AC4C00ECBEF4 /* PBXBookmark */ = A0BF9D8217D7AC4C00ECBEF4 /* PBXBookmark */; + A0BF9D8417D7AC4C00ECBEF4 /* PBXBookmark */ = A0BF9D8417D7AC4C00ECBEF4 /* PBXBookmark */; + A0C570AD1834050900EC50FC /* PBXTextBookmark */ = A0C570AD1834050900EC50FC /* PBXTextBookmark */; + A0C570AE1834050900EC50FC /* PBXTextBookmark */ = A0C570AE1834050900EC50FC /* PBXTextBookmark */; + A0C570AF1834050900EC50FC /* PBXTextBookmark */ = A0C570AF1834050900EC50FC /* PBXTextBookmark */; + A0D9D1C71884BC33005CD3D8 /* PBXTextBookmark */ = A0D9D1C71884BC33005CD3D8 /* PBXTextBookmark */; + A0D9D1C81884BC33005CD3D8 /* PBXTextBookmark */ = A0D9D1C81884BC33005CD3D8 /* PBXTextBookmark */; + A0D9D1C91884BC33005CD3D8 /* PBXTextBookmark */ = A0D9D1C91884BC33005CD3D8 /* PBXTextBookmark */; + A0D9D1CA1884BC33005CD3D8 /* PBXTextBookmark */ = A0D9D1CA1884BC33005CD3D8 /* PBXTextBookmark */; + A0DA85F317E27F0E00A0E71B /* PBXTextBookmark */ = A0DA85F317E27F0E00A0E71B /* PBXTextBookmark */; + A0DD32F51954CC980000D832 /* PBXTextBookmark */ = A0DD32F51954CC980000D832 /* PBXTextBookmark */; + A0DD32F61954CC980000D832 /* PlistBookmark */ = A0DD32F61954CC980000D832 /* PlistBookmark */; + A0DD32F71954CC980000D832 /* PBXTextBookmark */ = A0DD32F71954CC980000D832 /* PBXTextBookmark */; + A0DD32F81954CC980000D832 /* PBXTextBookmark */ = A0DD32F81954CC980000D832 /* PBXTextBookmark */; + A0DD33101954CED10000D832 /* PBXTextBookmark */ = A0DD33101954CED10000D832 /* PBXTextBookmark */; + A0DD33111954CED10000D832 /* PBXBookmark */ = A0DD33111954CED10000D832 /* PBXBookmark */; + A0DD33121954CED10000D832 /* PBXBookmark */ = A0DD33121954CED10000D832 /* PBXBookmark */; + A0DD33141954CED10000D832 /* PBXBookmark */ = A0DD33141954CED10000D832 /* PBXBookmark */; + A0E583DE18195CA10060C035 /* PBXTextBookmark */ = A0E583DE18195CA10060C035 /* PBXTextBookmark */; + A0E583DF18195CA10060C035 /* PBXTextBookmark */ = A0E583DF18195CA10060C035 /* PBXTextBookmark */; + A0E583E418195CA10060C035 /* PBXTextBookmark */ = A0E583E418195CA10060C035 /* PBXTextBookmark */; + A0E583E518195CA10060C035 /* PBXTextBookmark */ = A0E583E518195CA10060C035 /* PBXTextBookmark */; + A0E583E818195CA10060C035 /* PBXTextBookmark */ = A0E583E818195CA10060C035 /* PBXTextBookmark */; + A0E583E918195CA10060C035 /* PBXTextBookmark */ = A0E583E918195CA10060C035 /* PBXTextBookmark */; + A0E583EA18195CA10060C035 /* PBXTextBookmark */ = A0E583EA18195CA10060C035 /* PBXTextBookmark */; + A0E583EB18195CA10060C035 /* PBXTextBookmark */ = A0E583EB18195CA10060C035 /* PBXTextBookmark */; + A0E583EC18195CA10060C035 /* PBXTextBookmark */ = A0E583EC18195CA10060C035 /* PBXTextBookmark */; + A0E583ED18195CA10060C035 /* PBXTextBookmark */ = A0E583ED18195CA10060C035 /* PBXTextBookmark */; + A0E583EE18195CA10060C035 /* PBXTextBookmark */ = A0E583EE18195CA10060C035 /* PBXTextBookmark */; + A0E583EF18195CA10060C035 /* PBXTextBookmark */ = A0E583EF18195CA10060C035 /* PBXTextBookmark */; + A0E583F118195CA10060C035 /* PBXTextBookmark */ = A0E583F118195CA10060C035 /* PBXTextBookmark */; + A0E583F218195CA10060C035 /* PBXTextBookmark */ = A0E583F218195CA10060C035 /* PBXTextBookmark */; + A0E583F718195CA10060C035 /* PBXTextBookmark */ = A0E583F718195CA10060C035 /* PBXTextBookmark */; + A0EB08011955F31900B6E8C2 /* PBXBookmark */ = A0EB08011955F31900B6E8C2 /* PBXBookmark */; + }; + sourceControlManager = A0A7DC5717CD5F7A00BBC65E /* Source Control */; + userBuildSettings = { + }; + }; + A00135A117DFABF1005B6829 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A036ED9517DE45E000F0B721 /* button_a.png */; + }; + A004598E187683B8005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB295418194C220077AFC2 /* PrimitiveActor.h */; + name = "PrimitiveActor.h: 31"; + rLen = 0; + rLoc = 888; + rType = 0; + vrLen = 965; + vrLoc = 274; + }; + A004598F187683B8005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8317CD627E00BBC65E /* AttackTemplates.cpp */; + name = "AttackTemplates.cpp: 37"; + rLen = 0; + rLoc = 999; + rType = 0; + vrLen = 571; + vrLoc = 814; + }; + A0045A6218774012005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29FB18194ECC0077AFC2 /* Preferences.h */; + name = "Preferences.h: 24"; + rLen = 0; + rLoc = 391; + rType = 0; + vrLen = 602; + vrLoc = 113; + }; + A0045B03187763AF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29F818194ECC0077AFC2 /* PoisonMushroom.cpp */; + name = "PoisonMushroom.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 546; + vrLoc = 0; + }; + A0045B0B187763AF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0045B0C187763AF005C20BB /* UISwipeGestureRecognizer.h */; + name = "UISwipeGestureRecognizer.h: 43"; + rLen = 0; + rLoc = 1689; + rType = 0; + vrLen = 1068; + vrLoc = 973; + }; + A0045B0C187763AF005C20BB /* UISwipeGestureRecognizer.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = UISwipeGestureRecognizer.h; + path = /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UISwipeGestureRecognizer.h; + sourceTree = ""; + }; + A0045B1B18776445005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB417CD627E00BBC65E /* Mario.h */; + name = "Mario.h: 15"; + rLen = 0; + rLoc = 212; + rType = 0; + vrLen = 419; + vrLoc = 0; + }; + A0045B1C18776445005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEAE17CD627E00BBC65E /* Ichigo.h */; + name = "Ichigo.h: 22"; + rLen = 0; + rLoc = 359; + rType = 0; + vrLen = 405; + vrLoc = 0; + }; + A0045B24187767EF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEAD17CD627E00BBC65E /* Ichigo.cpp */; + name = "Ichigo.cpp: 8"; + rLen = 0; + rLoc = 203; + rType = 0; + vrLen = 543; + vrLoc = 0; + }; + A0045B25187767EF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DED717CD627E00BBC65E /* Sonic.h */; + name = "Sonic.h: 65"; + rLen = 0; + rLoc = 1286; + rType = 0; + vrLen = 667; + vrLoc = 1044; + }; + A0045B26187767EF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB317CD627E00BBC65E /* Mario.cpp */; + name = "Mario.cpp: 9"; + rLen = 0; + rLoc = 201; + rType = 0; + vrLen = 530; + vrLoc = 0; + }; + A0045B27187767EF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DED617CD627E00BBC65E /* Sonic.cpp */; + name = "Sonic.cpp: 131"; + rLen = 0; + rLoc = 2639; + rType = 0; + vrLen = 680; + vrLoc = 2321; + }; + A0045B28187767EF005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9617CD627E00BBC65E /* Fox.h */; + name = "Fox.h: 73"; + rLen = 0; + rLoc = 1480; + rType = 0; + vrLen = 564; + vrLoc = 1051; + }; + A0045B3918776A9B005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9517CD627E00BBC65E /* Fox.cpp */; + name = "Fox.cpp: 59"; + rLen = 0; + rLoc = 1123; + rType = 0; + vrLen = 402; + vrLoc = 934; + }; + A0045B4E187770C1005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29D618194ECC0077AFC2 /* HitBox.cpp */; + name = "HitBox.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 373; + vrLoc = 0; + }; + A0045B79187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8E17CD627E00BBC65E /* CharSelectScreen.h */; + name = "CharSelectScreen.h: 100"; + rLen = 0; + rLoc = 2403; + rType = 0; + vrLen = 921; + vrLoc = 1786; + }; + A0045B7C187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEDC17CD627E00BBC65E /* SuperMushroom.cpp */; + name = "SuperMushroom.cpp: 9"; + rLen = 0; + rLoc = 204; + rType = 0; + vrLen = 532; + vrLoc = 0; + }; + A0045B7D187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A0F18194ECC0077AFC2 /* SuperMushroom.h */; + name = "SuperMushroom.h: 3"; + rLen = 0; + rLoc = 33; + rType = 0; + vrLen = 529; + vrLoc = 0; + }; + A0045B7E187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DED517CD627E00BBC65E /* SmashBall.h */; + name = "SmashBall.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 477; + vrLoc = 0; + }; + A0045B7F187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A0218194ECC0077AFC2 /* RayGun.h */; + name = "RayGun.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 380; + vrLoc = 0; + }; + A0045B80187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29F918194ECC0077AFC2 /* PoisonMushroom.h */; + name = "PoisonMushroom.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 532; + vrLoc = 0; + }; + A0045B81187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29D218194ECC0077AFC2 /* HeartContainer.cpp */; + name = "HeartContainer.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 623; + vrLoc = 0; + }; + A0045B82187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEA417CD627E00BBC65E /* HeartContainer.h */; + name = "HeartContainer.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 394; + vrLoc = 0; + }; + A0045B83187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8817CD627E00BBC65E /* BeamSword.h */; + name = "BeamSword.h: 10"; + rLen = 0; + rLoc = 125; + rType = 0; + vrLen = 546; + vrLoc = 0; + }; + A0045B85187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A0B18194ECC0077AFC2 /* Stage.h */; + name = "Stage.h: 17"; + rLen = 0; + rLoc = 306; + rType = 0; + vrLen = 673; + vrLoc = 2217; + }; + A0045B86187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29FD18194ECC0077AFC2 /* Projectile.cpp */; + name = "Projectile.cpp: 223"; + rLen = 0; + rLoc = 4371; + rType = 0; + vrLen = 574; + vrLoc = 1581; + }; + A0045B87187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29FE18194ECC0077AFC2 /* Projectile.h */; + name = "Projectile.h: 58"; + rLen = 0; + rLoc = 1392; + rType = 0; + vrLen = 868; + vrLoc = 999; + }; + A0045B89187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29F018194ECC0077AFC2 /* MusicManager.cpp */; + name = "MusicManager.cpp: 44"; + rLen = 0; + rLoc = 883; + rType = 0; + vrLen = 385; + vrLoc = 711; + }; + A0045B90187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8117CD627E00BBC65E /* AttackRandomizer.cpp */; + name = "AttackRandomizer.cpp: 226"; + rLen = 0; + rLoc = 5023; + rType = 0; + vrLen = 641; + vrLoc = 4549; + }; + A0045B91187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8417CD627E00BBC65E /* AttackTemplates.h */; + name = "AttackTemplates.h: 15"; + rLen = 0; + rLoc = 440; + rType = 0; + vrLen = 1022; + vrLoc = 0; + }; + A0045B93187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A0918194ECC0077AFC2 /* SoundManager.h */; + name = "SoundManager.h: 31"; + rLen = 0; + rLoc = 515; + rType = 0; + vrLen = 429; + vrLoc = 50; + }; + A0045B94187777B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0289D9D17EB8E94006B27DB /* SoundManager.cpp */; + name = "SoundManager.cpp: 70"; + rLen = 0; + rLoc = 1103; + rType = 0; + vrLen = 377; + vrLoc = 27; + }; + A0045BC118777FD6005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29FF18194ECC0077AFC2 /* ProjectileManager.cpp */; + name = "ProjectileManager.cpp: 33"; + rLen = 0; + rLoc = 771; + rType = 0; + vrLen = 570; + vrLoc = 272; + }; + A0045BC418777FD6005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29BA18194ECC0077AFC2 /* Chargebar.cpp */; + name = "Chargebar.cpp: 12"; + rLen = 0; + rLoc = 240; + rType = 0; + vrLen = 476; + vrLoc = 68; + }; + A0045BC518777FD6005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29BC18194ECC0077AFC2 /* CollisionManager.cpp */; + name = "CollisionManager.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 427; + vrLoc = 0; + }; + A0045BC618777FD6005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8C17CD627E00BBC65E /* Chargebar.h */; + name = "Chargebar.h: 18"; + rLen = 0; + rLoc = 275; + rType = 0; + vrLen = 388; + vrLoc = 0; + }; + A0045BC718777FD6005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29CA18194ECC0077AFC2 /* GameScreen.cpp */; + name = "GameScreen.cpp: 34"; + rLen = 0; + rLoc = 600; + rType = 0; + vrLen = 451; + vrLoc = 334; + }; + A0045BE7187784F3005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29C818194ECC0077AFC2 /* GameElement.cpp */; + name = "GameElement.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 488; + vrLoc = 70; + }; + A0045BE8187784F3005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29DF18194ECC0077AFC2 /* ItemManager.h */; + name = "ItemManager.h: 16"; + rLen = 0; + rLoc = 227; + rType = 0; + vrLen = 470; + vrLoc = 0; + }; + A0045BEA187784F3005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29F118194ECC0077AFC2 /* MusicManager.h */; + name = "MusicManager.h: 17"; + rLen = 0; + rLoc = 202; + rType = 0; + vrLen = 462; + vrLoc = 0; + }; + A0045C0018778936005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29C918194ECC0077AFC2 /* GameElement.h */; + name = "GameElement.h: 17"; + rLen = 0; + rLoc = 334; + rType = 0; + vrLen = 636; + vrLoc = 0; + }; + A0045C0218778936005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8A17CD627E00BBC65E /* Camera.h */; + name = "Camera.h: 36"; + rLen = 0; + rLoc = 620; + rType = 0; + vrLen = 583; + vrLoc = 311; + }; + A0045C0318778936005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29B618194ECC0077AFC2 /* Camera.cpp */; + name = "Camera.cpp: 143"; + rLen = 0; + rLoc = 2872; + rType = 0; + vrLen = 370; + vrLoc = 2669; + }; + A0045C0518778A6F005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29DD18194ECC0077AFC2 /* Item.h */; + name = "Item.h: 24"; + rLen = 0; + rLoc = 401; + rType = 0; + vrLen = 433; + vrLoc = 0; + }; + A0045C0618778A6F005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29DC18194ECC0077AFC2 /* Item.cpp */; + name = "Item.cpp: 99"; + rLen = 0; + rLoc = 1837; + rType = 0; + vrLen = 543; + vrLoc = 1721; + }; + A0045C1118779950005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DED817CD627E00BBC65E /* Stage.cpp */; + name = "Stage.cpp: 102"; + rLen = 17; + rLoc = 1669; + rType = 0; + vrLen = 538; + vrLoc = 1376; + }; + A0045C1218779950005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEA517CD627E00BBC65E /* HillsideBattleground.cpp */; + name = "HillsideBattleground.cpp: 15"; + rLen = 0; + rLoc = 376; + rType = 0; + vrLen = 591; + vrLoc = 37; + }; + A0045C17187799B0005C20BB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEC217CD627E00BBC65E /* Menus.h */; + name = "Menus.h: 40"; + rLen = 0; + rLoc = 1167; + rType = 0; + vrLen = 1059; + vrLoc = 436; + }; + A00656BC17F6231A00B54DF7 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8617CD627E00BBC65E /* BattlefieldBrawl.h */; + name = "BattlefieldBrawl.h: 7"; + rLen = 0; + rLoc = 100; + rType = 0; + vrLen = 338; + vrLoc = 0; + }; + A006570217F8B2C500B54DF7 /* NSObjCRuntime.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = NSObjCRuntime.h; + path = /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h; + sourceTree = ""; + }; + A006571B17F8BB0400B54DF7 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A006570217F8B2C500B54DF7 /* NSObjCRuntime.h */; + name = "NSObjCRuntime.h: 247"; + rLen = 0; + rLoc = 9671; + rType = 0; + vrLen = 548; + vrLoc = 9413; + }; + A006580A17F8C0CF00B54DF7 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A006580B17F8C0CF00B54DF7 /* MFMailComposeViewController.h */; + name = "MFMailComposeViewController.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1273; + vrLoc = 0; + }; + A006580B17F8C0CF00B54DF7 /* MFMailComposeViewController.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = MFMailComposeViewController.h; + path = /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h; + sourceTree = ""; + }; + A00F744D1811DE220036FD0D /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A00F744E1811DE220036FD0D /* 2.png */; + }; + A00F744E1811DE220036FD0D /* 2.png */ = { + isa = PBXFileReference; + lastKnownFileType = image.png; + name = 2.png; + path = /Users/luis/Documents/Xcode/SmashBros/Images/Game/HUD/PercentText/2.png; + sourceTree = ""; + }; + A0289D9D17EB8E94006B27DB /* SoundManager.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = SoundManager.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/SoundManager.cpp; + sourceTree = ""; + }; + A0289DA117EB8E99006B27DB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEAC17CD627E00BBC65E /* HyruleTemple.h */; + name = "HyruleTemple.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 426; + vrLoc = 0; + }; + A0289DA517EB8E99006B27DB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9417CD627E00BBC65E /* FinalDestinationBrawl.h */; + name = "FinalDestinationBrawl.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 423; + vrLoc = 0; + }; + A0289DA617EB8E99006B27DB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9317CD627E00BBC65E /* FinalDestinationBrawl.cpp */; + name = "FinalDestinationBrawl.cpp: 34"; + rLen = 0; + rLoc = 796; + rType = 0; + vrLen = 488; + vrLoc = 481; + }; + A0289DA717EB8E99006B27DB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9717CD627E00BBC65E /* FractalStage.cpp */; + name = "FractalStage.cpp: 260"; + rLen = 0; + rLoc = 6493; + rType = 0; + vrLen = 554; + vrLoc = 3752; + }; + A0289DA917EB8E99006B27DB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEAB17CD627E00BBC65E /* HyruleTemple.cpp */; + name = "HyruleTemple.cpp: 40"; + rLen = 0; + rLoc = 882; + rType = 0; + vrLen = 489; + vrLoc = 494; + }; + A0289E1517EBE326006B27DB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0289E1617EBE326006B27DB /* stdio.h */; + name = "stdio.h: 348"; + rLen = 103; + rLoc = 13539; + rType = 0; + vrLen = 1305; + vrLoc = 13074; + }; + A0289E1617EBE326006B27DB /* stdio.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = stdio.h; + path = /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/stdio.h; + sourceTree = ""; + }; + A02A428D183962EB0088CF1E /* Bitset.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {866, 780}}"; + sepNavSelRange = "{667, 0}"; + sepNavVisRange = "{380, 291}"; + }; + }; + A02A428E183962EB0088CF1E /* Bitset.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1008, 442}}"; + sepNavSelRange = "{119, 0}"; + sepNavVisRange = "{1, 612}"; + }; + }; + A02A42EE183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A1718194ECC0077AFC2 /* WinnerScreen.h */; + name = "WinnerScreen.h: 6"; + rLen = 0; + rLoc = 76; + rType = 0; + vrLen = 665; + vrLoc = 0; + }; + A02A42F3183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293E18194C220077AFC2 /* GlobalDefs.h */; + name = "GlobalDefs.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 401; + vrLoc = 0; + }; + A02A42F4183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293D18194C220077AFC2 /* GameEngine.h */; + name = "GameEngine.h: 8"; + rLen = 0; + rLoc = 198; + rType = 0; + vrLen = 708; + vrLoc = 0; + }; + A02A42F5183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292E18194C220077AFC2 /* ArrayList.h */; + name = "ArrayList.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 358; + vrLoc = 0; + }; + A02A42F6183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293318194C220077AFC2 /* BufferedImage.cpp */; + name = "BufferedImage.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 677; + vrLoc = 0; + }; + A02A42F7183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293718194C220077AFC2 /* Color.cpp */; + name = "Color.cpp: 143"; + rLen = 0; + rLoc = 2425; + rType = 0; + vrLen = 488; + vrLoc = 2144; + }; + A02A42F8183E878F0088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293818194C220077AFC2 /* Color.h */; + name = "Color.h: 47"; + rLen = 0; + rLoc = 1146; + rType = 0; + vrLen = 885; + vrLoc = 396; + }; + A02A4330183FE2080088CF1E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A02A428D183962EB0088CF1E /* Bitset.cpp */; + name = "Bitset.cpp: 37"; + rLen = 0; + rLoc = 384; + rType = 0; + vrLen = 347; + vrLoc = 134; + }; + A02F1E531936763E00D8C5E9 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294518194C220077AFC2 /* MailViewController.h */; + name = "MailViewController.h: 5"; + rLen = 0; + rLoc = 70; + rType = 0; + vrLen = 324; + vrLoc = 0; + }; + A036ED9517DE45E000F0B721 /* button_a.png */ = { + isa = PBXFileReference; + lastKnownFileType = image.png; + name = button_a.png; + path = /Users/luis/Documents/Xcode/SmashBros/Images/Game/Controls/button_a.png; + sourceTree = ""; + }; + A04AA4C917F8FF61006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9A317C2E0F70002DD96 /* SDL.h */; + name = "SDL.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 451; + vrLoc = 4839; + }; + A04AA4CA17F8FF61006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9ED17C2E0F70002DD96 /* SDL_video.h */; + name = "SDL_video.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 939; + vrLoc = 0; + }; + A04AA4CB17F8FF61006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9EC17C2E0F70002DD96 /* SDL_version.h */; + name = "SDL_version.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 475; + vrLoc = 4686; + }; + A04AA4D917F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9EE17C2E0F70002DD96 /* wavestream.h */; + name = "wavestream.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 933; + vrLoc = 126; + }; + A04AA4DA17F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9D917C2E0F70002DD96 /* SDL_system.h */; + name = "SDL_system.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 589; + vrLoc = 1200; + }; + A04AA4DB17F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED98D17C2E0F70002DD96 /* begin_code.h */; + name = "begin_code.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 506; + vrLoc = 3875; + }; + A04AA4DC17F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED99217C2E0F70002DD96 /* dynamic_mod.h */; + name = "dynamic_mod.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 974; + vrLoc = 0; + }; + A04AA4DD17F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED98F17C2E0F70002DD96 /* doxyfile */; + name = "doxyfile: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 886; + vrLoc = 0; + }; + A04AA4DE17F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED98E17C2E0F70002DD96 /* close_code.h */; + name = "close_code.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 558; + vrLoc = 859; + }; + A04AA4DF17F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9AA17C2E0F70002DD96 /* SDL_config.h */; + name = "SDL_config.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 526; + vrLoc = 1137; + }; + A04AA4E017F90011006DD6E3 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9A517C2E0F70002DD96 /* SDL_atomic.h */; + name = "SDL_atomic.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 297; + vrLoc = 11510; + }; + A050BB2F1816B2830093ECD5 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9CD17C2E0F70002DD96 /* SDL_pixels.h */; + name = "SDL_pixels.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 1026; + vrLoc = 0; + }; + A05C8A9618047A3200A30C28 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEC417CD627E00BBC65E /* OffScreenExplode.h */; + name = "OffScreenExplode.h: 12"; + rLen = 0; + rLoc = 165; + rType = 0; + vrLen = 367; + vrLoc = 0; + }; + A05C8A9818047A3200A30C28 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEC317CD627E00BBC65E /* OffScreenExplode.cpp */; + name = "OffScreenExplode.cpp: 8"; + rLen = 0; + rLoc = 180; + rType = 0; + vrLen = 464; + vrLoc = 0; + }; + A06368081884C680007B789C /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29CE18194ECC0077AFC2 /* HUD.cpp */; + name = "HUD.cpp: 272"; + rLen = 0; + rLoc = 6377; + rType = 0; + vrLen = 390; + vrLoc = 6270; + }; + A06368191884C9B3007B789C /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29EC18194ECC0077AFC2 /* MenuClasses.cpp */; + name = "MenuClasses.cpp: 1413"; + rLen = 0; + rLoc = 37009; + rType = 0; + vrLen = 533; + vrLoc = 36600; + }; + A06368301884CE58007B789C /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A0018194ECC0077AFC2 /* ProjectileManager.h */; + name = "ProjectileManager.h: 16"; + rLen = 0; + rLoc = 311; + rType = 0; + vrLen = 406; + vrLoc = 0; + }; + A086B38017E9089C00FBD4FC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9D417C2E0F70002DD96 /* SDL_rwops.h */; + name = "SDL_rwops.h: 188"; + rLen = 72; + rLoc = 5625; + rType = 0; + vrLen = 1094; + vrLoc = 5114; + }; + A086B40917EA7F2500FBD4FC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9E817C2E0F70002DD96 /* SDL_timer.h */; + name = "SDL_timer.h: 60"; + rLen = 51; + rLoc = 1804; + rType = 0; + vrLen = 938; + vrLoc = 1399; + }; + A0870E3E17F20A410036E374 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE8517CD627E00BBC65E /* BattlefieldBrawl.cpp */; + name = "BattlefieldBrawl.cpp: 33"; + rLen = 0; + rLoc = 785; + rType = 0; + vrLen = 583; + vrLoc = 421; + }; + A08791E21875DBA100467ACB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9E17CD627E00BBC65E /* GameScreen.h */; + name = "GameScreen.h: 12"; + rLen = 0; + rLoc = 201; + rType = 0; + vrLen = 458; + vrLoc = 0; + }; + A08791E41875DBA100467ACB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0C779D8180E1C9100001642 /* SDL_p2p.h */; + name = "SDL_p2p.h: 66"; + rLen = 0; + rLoc = 1854; + rType = 0; + vrLen = 1556; + vrLoc = 813; + }; + A08791EC1875DBA100467ACB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29BF18194ECC0077AFC2 /* Controls.h */; + name = "Controls.h: 68"; + rLen = 0; + rLoc = 1471; + rType = 0; + vrLen = 820; + vrLoc = 828; + }; + A08791F21875DBA100467ACB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29BD18194ECC0077AFC2 /* CollisionManager.h */; + name = "CollisionManager.h: 9"; + rLen = 0; + rLoc = 116; + rType = 0; + vrLen = 337; + vrLoc = 0; + }; + A08792371875ECC200467ACB /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A02A428E183962EB0088CF1E /* Bitset.h */; + name = "Bitset.h: 13"; + rLen = 0; + rLoc = 119; + rType = 0; + vrLen = 612; + vrLoc = 1; + }; + A08A15B7188EC4290028A41E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29FA18194ECC0077AFC2 /* Preferences.cpp */; + name = "Preferences.cpp: 27"; + rLen = 0; + rLoc = 823; + rType = 0; + vrLen = 1480; + vrLoc = 1219; + }; + A08A15B8188EC4290028A41E /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292B18194C220077AFC2 /* Application.h */; + name = "Application.h: 58"; + rLen = 0; + rLoc = 1295; + rType = 0; + vrLen = 385; + vrLoc = 941; + }; + A08E0F7618383D17007A5DE6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEE417CD627E00BBC65E /* WinnerScreen.cpp */; + name = "WinnerScreen.cpp: 28"; + rLen = 0; + rLoc = 516; + rType = 0; + vrLen = 794; + vrLoc = 264; + }; + A08E0F7F18383D17007A5DE6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DED417CD627E00BBC65E /* SmashBall.cpp */; + name = "SmashBall.cpp: 52"; + rLen = 0; + rLoc = 1017; + rType = 0; + vrLen = 943; + vrLoc = 2332; + }; + A08E0F8718383D17007A5DE6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEBB17CD627E00BBC65E /* MenuBarToggle.cpp */; + name = "MenuBarToggle.cpp: 47"; + rLen = 0; + rLoc = 1104; + rType = 0; + vrLen = 655; + vrLoc = 771; + }; + A08E0F8818383D17007A5DE6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEE017CD627E00BBC65E /* ToggleButtons.cpp */; + name = "ToggleButtons.cpp: 77"; + rLen = 0; + rLoc = 1410; + rType = 0; + vrLen = 560; + vrLoc = 1153; + }; + A08E0F9718383D17007A5DE6 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEAA17CD627E00BBC65E /* HUD.h */; + name = "HUD.h: 9"; + rLen = 0; + rLoc = 124; + rType = 0; + vrLen = 554; + vrLoc = 0; + }; + A08EDEB7182ADF6C007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB296418194C220077AFC2 /* View.h */; + name = "View.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 523; + vrLoc = 0; + }; + A08EDF5C182D3BEB007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE7C17CD627E00BBC65E /* ActorGrid.h */; + name = "ActorGrid.h: 4"; + rLen = 0; + rLoc = 52; + rType = 0; + vrLen = 608; + vrLoc = 0; + }; + A08EDF66182E55FF007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE7B17CD627E00BBC65E /* ActorGrid.cpp */; + name = "ActorGrid.cpp: 101"; + rLen = 0; + rLoc = 1565; + rType = 0; + vrLen = 533; + vrLoc = 0; + }; + A08EDF67182E55FF007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE7E17CD627E00BBC65E /* Arrows.h */; + name = "Arrows.h: 51"; + rLen = 0; + rLoc = 995; + rType = 0; + vrLen = 590; + vrLoc = 0; + }; + A08EDF791830102B007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9C517C2E0F70002DD96 /* SDL_messagebox.h */; + name = "SDL_messagebox.h: 61"; + rLen = 0; + rLoc = 2150; + rType = 0; + vrLen = 947; + vrLoc = 1537; + }; + A08EDF8F1830142A007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB295018194C220077AFC2 /* PixelIterator.h */; + name = "PixelIterator.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 431; + vrLoc = 0; + }; + A08EDFD518301DF2007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294618194C220077AFC2 /* MailViewController.mm */; + name = "MailViewController.mm: 31"; + rLen = 0; + rLoc = 907; + rType = 0; + vrLen = 1329; + vrLoc = 397; + }; + A08EE09518307E0B007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293A18194C220077AFC2 /* Console.h */; + name = "Console.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 298; + vrLoc = 0; + }; + A08EE09618307E0B007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293918194C220077AFC2 /* Console.cpp */; + name = "Console.cpp: 14"; + rLen = 0; + rLoc = 268; + rType = 0; + vrLen = 763; + vrLoc = 0; + }; + A08EE0F81832AF78007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A1418194ECC0077AFC2 /* TogglePane.cpp */; + name = "TogglePane.cpp: 53"; + rLen = 0; + rLoc = 935; + rType = 0; + vrLen = 659; + vrLoc = 0; + }; + A08EE0FE1832AF78007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEDE17CD627E00BBC65E /* ToggleButton.cpp */; + name = "ToggleButton.cpp: 43"; + rLen = 0; + rLoc = 833; + rType = 0; + vrLen = 692; + vrLoc = 0; + }; + A08EE0FF1832AF78007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A1118194ECC0077AFC2 /* ToggleButton.h */; + name = "ToggleButton.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 426; + vrLoc = 0; + }; + A08EE1011832AF78007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEE117CD627E00BBC65E /* ToggleButtons.h */; + name = "ToggleButtons.h: 40"; + rLen = 0; + rLoc = 808; + rType = 0; + vrLen = 725; + vrLoc = 91; + }; + A08EE10E1832B2F4007AA38D /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB295D18194C220077AFC2 /* TextActor.cpp */; + name = "TextActor.cpp: 358"; + rLen = 0; + rLoc = 7398; + rType = 0; + vrLen = 615; + vrLoc = 7015; + }; + A091942F183546750038BF65 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB296318194C220077AFC2 /* View.cpp */; + name = "View.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 515; + vrLoc = 0; + }; + A0919432183546750038BF65 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293118194C220077AFC2 /* BatchLoader.cpp */; + name = "BatchLoader.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 669; + vrLoc = 0; + }; + A0919433183546750038BF65 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292F18194C220077AFC2 /* AssetManager.cpp */; + name = "AssetManager.cpp: 112"; + rLen = 0; + rLoc = 2510; + rType = 0; + vrLen = 726; + vrLoc = 1935; + }; + A0962B341878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB2A0518194ECC0077AFC2 /* SmashForwards.h */; + name = "SmashForwards.h: 14"; + rLen = 0; + rLoc = 169; + rType = 0; + vrLen = 169; + vrLoc = 0; + }; + A0962B361878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0E58407181A8B680060C035 /* P2PDataManager.h */; + name = "P2PDataManager.h: 50"; + rLen = 0; + rLoc = 1233; + rType = 0; + vrLen = 787; + vrLoc = 880; + }; + A0962B371878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29BE18194ECC0077AFC2 /* Controls.cpp */; + name = "Controls.cpp: 744"; + rLen = 0; + rLoc = 21468; + rType = 0; + vrLen = 950; + vrLoc = 20846; + }; + A0962B381878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29DE18194ECC0077AFC2 /* ItemManager.cpp */; + name = "ItemManager.cpp: 427"; + rLen = 0; + rLoc = 9822; + rType = 0; + vrLen = 543; + vrLoc = 9614; + }; + A0962B3A1878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0E58406181A8B680060C035 /* P2PDataManager.cpp */; + name = "P2PDataManager.cpp: 282"; + rLen = 0; + rLoc = 6818; + rType = 0; + vrLen = 604; + vrLoc = 6466; + }; + A0962B3B1878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29D718194ECC0077AFC2 /* HitBox.h */; + name = "HitBox.h: 1"; + rLen = 0; + rLoc = 34; + rType = 0; + vrLen = 350; + vrLoc = 0; + }; + A0962B421878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29AD18194ECC0077AFC2 /* AttackManager.h */; + name = "AttackManager.h: 7"; + rLen = 0; + rLoc = 98; + rType = 0; + vrLen = 499; + vrLoc = 0; + }; + A0962B431878F28A0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29B818194ECC0077AFC2 /* CharSelectScreen.cpp */; + name = "CharSelectScreen.cpp: 135"; + rLen = 0; + rLoc = 3201; + rType = 0; + vrLen = 425; + vrLoc = 2873; + }; + A0962B5E1878F68F0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEDB17CD627E00BBC65E /* StageSelectScreen.h */; + name = "StageSelectScreen.h: 29"; + rLen = 0; + rLoc = 520; + rType = 0; + vrLen = 599; + vrLoc = 262; + }; + A0962B601878F68F0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29EE18194ECC0077AFC2 /* Menus.cpp */; + name = "Menus.cpp: 75"; + rLen = 0; + rLoc = 1461; + rType = 0; + vrLen = 748; + vrLoc = 11998; + }; + A0962B611878F68F0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29ED18194ECC0077AFC2 /* MenuClasses.h */; + name = "MenuClasses.h: 164"; + rLen = 6; + rLoc = 3538; + rType = 0; + vrLen = 562; + vrLoc = 3268; + }; + A0962B631878F68F0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEDA17CD627E00BBC65E /* StageSelectScreen.cpp */; + name = "StageSelectScreen.cpp: 140"; + rLen = 0; + rLoc = 3004; + rType = 0; + vrLen = 462; + vrLoc = 2710; + }; + A0962B761878FD220031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292518194C220077AFC2 /* Actor.h */; + name = "Actor.h: 171"; + rLen = 0; + rLoc = 4245; + rType = 0; + vrLen = 535; + vrLoc = 3718; + }; + A0962B771878FD220031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292418194C220077AFC2 /* Actor.cpp */; + name = "Actor.cpp: 573"; + rLen = 0; + rLoc = 13201; + rType = 0; + vrLen = 531; + vrLoc = 0; + }; + A0962B781878FD220031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292718194C220077AFC2 /* Animation.h */; + name = "Animation.h: 48"; + rLen = 0; + rLoc = 820; + rType = 0; + vrLen = 442; + vrLoc = 500; + }; + A0962B791878FD220031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292618194C220077AFC2 /* Animation.cpp */; + name = "Animation.cpp: 765"; + rLen = 0; + rLoc = 15556; + rType = 0; + vrLen = 481; + vrLoc = 15299; + }; + A0962B7B1878FD220031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29F718194ECC0077AFC2 /* Player.h */; + name = "Player.h: 216"; + rLen = 0; + rLoc = 5071; + rType = 0; + vrLen = 385; + vrLoc = 4888; + }; + A0962B7C1878FD220031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29F618194ECC0077AFC2 /* Player.cpp */; + name = "Player.cpp: 3761"; + rLen = 0; + rLoc = 80258; + rType = 0; + vrLen = 540; + vrLoc = 80116; + }; + A0962B9A187903370031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293218194C220077AFC2 /* BatchLoader.h */; + name = "BatchLoader.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 364; + vrLoc = 0; + }; + A0962B9B187903370031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293018194C220077AFC2 /* AssetManager.h */; + name = "AssetManager.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 543; + vrLoc = 0; + }; + A0962B9E187903370031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293518194C220077AFC2 /* CPPBridge.cpp */; + name = "CPPBridge.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 351; + vrLoc = 0; + }; + A0962BA6187905BD0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294B18194C220077AFC2 /* ObjCBridge.h */; + name = "ObjCBridge.h: 6"; + rLen = 0; + rLoc = 63; + rType = 0; + vrLen = 564; + vrLoc = 0; + }; + A0962C25187DD6690031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292D18194C220077AFC2 /* ApplicationEventListener.h */; + name = "ApplicationEventListener.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 322; + vrLoc = 0; + }; + A0962C36187DD83F0031D5B1 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294C18194C220077AFC2 /* ObjCBridge.mm */; + name = "ObjCBridge.mm: 124"; + rLen = 0; + rLoc = 3316; + rType = 0; + vrLen = 477; + vrLoc = 3076; + }; + A0A7DC3A17CD5F7500BBC65E /* GameEngine */ = { + isa = PBXExecutable; + activeArgIndices = ( + ); + argumentStrings = ( + ); + autoAttachOnCrash = 1; + breakpointsEnabled = 0; + configStateDict = { + }; + customDataFormattersEnabled = 1; + dataTipCustomDataFormattersEnabled = 1; + dataTipShowTypeColumn = 1; + dataTipSortType = 0; + debuggerPlugin = GDBDebugging; + disassemblyDisplayState = 0; + dylibVariantSuffix = ""; + enableDebugStr = 1; + environmentEntries = ( + ); + executableSystemSymbolLevel = 0; + executableUserSymbolLevel = 0; + libgmallocEnabled = 0; + name = GameEngine; + savedGlobals = { + }; + showTypeColumn = 0; + sourceDirectories = ( + ); + variableFormatDictionary = { + }; + }; + A0A7DC5717CD5F7A00BBC65E /* Source Control */ = { + isa = PBXSourceControlManager; + fallbackIsa = XCSourceControlManager; + isSCMEnabled = 0; + scmConfiguration = { + repositoryNamesForRoots = { + "" = ""; + }; + }; + }; + A0A7DC5817CD5F7A00BBC65E /* Code sense */ = { + isa = PBXCodeSenseManager; + indexTemplatePath = ""; + }; + A0A7DE6817CD613C00BBC65E /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A0A7DE6917CD613C00BBC65E /* 0.png */; + }; + A0A7DE6917CD613C00BBC65E /* 0.png */ = { + isa = PBXFileReference; + lastKnownFileType = image.png; + name = 0.png; + path = /Users/luis/Documents/Xcode/SmashBros/Images/Game/HUD/PercentText/0.png; + sourceTree = ""; + }; + A0A7DE7B17CD627E00BBC65E /* ActorGrid.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = ActorGrid.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/ActorGrid.cpp; + sourceTree = ""; + }; + A0A7DE7C17CD627E00BBC65E /* ActorGrid.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = ActorGrid.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/ActorGrid.h; + sourceTree = ""; + }; + A0A7DE7D17CD627E00BBC65E /* Arrows.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Arrows.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Arrows.cpp; + sourceTree = ""; + }; + A0A7DE7E17CD627E00BBC65E /* Arrows.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Arrows.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Arrows.h; + sourceTree = ""; + }; + A0A7DE8117CD627E00BBC65E /* AttackRandomizer.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = AttackRandomizer.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/AttackRandomizer.cpp; + sourceTree = ""; + }; + A0A7DE8317CD627E00BBC65E /* AttackTemplates.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = AttackTemplates.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/AttackTemplates.cpp; + sourceTree = ""; + }; + A0A7DE8417CD627E00BBC65E /* AttackTemplates.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = AttackTemplates.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/AttackTemplates.h; + sourceTree = ""; + }; + A0A7DE8517CD627E00BBC65E /* BattlefieldBrawl.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = BattlefieldBrawl.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/BattlefieldBrawl.cpp; + sourceTree = ""; + }; + A0A7DE8617CD627E00BBC65E /* BattlefieldBrawl.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = BattlefieldBrawl.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/BattlefieldBrawl.h; + sourceTree = ""; + }; + A0A7DE8817CD627E00BBC65E /* BeamSword.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = BeamSword.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/BeamSword.h; + sourceTree = ""; + }; + A0A7DE8A17CD627E00BBC65E /* Camera.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Camera.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Camera.h; + sourceTree = ""; + }; + A0A7DE8C17CD627E00BBC65E /* Chargebar.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Chargebar.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Chargebar.h; + sourceTree = ""; + }; + A0A7DE8E17CD627E00BBC65E /* CharSelectScreen.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = CharSelectScreen.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/CharSelectScreen.h; + sourceTree = ""; + }; + A0A7DE9317CD627E00BBC65E /* FinalDestinationBrawl.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = FinalDestinationBrawl.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/FinalDestinationBrawl.cpp; + sourceTree = ""; + }; + A0A7DE9417CD627E00BBC65E /* FinalDestinationBrawl.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = FinalDestinationBrawl.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/FinalDestinationBrawl.h; + sourceTree = ""; + }; + A0A7DE9517CD627E00BBC65E /* Fox.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Fox.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Fox.cpp; + sourceTree = ""; + }; + A0A7DE9617CD627E00BBC65E /* Fox.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Fox.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Fox.h; + sourceTree = ""; + }; + A0A7DE9717CD627E00BBC65E /* FractalStage.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = FractalStage.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/FractalStage.cpp; + sourceTree = ""; + }; + A0A7DE9817CD627E00BBC65E /* FractalStage.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = FractalStage.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/FractalStage.h; + sourceTree = ""; + }; + A0A7DE9917CD627E00BBC65E /* Game.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Game.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Game.cpp; + sourceTree = ""; + }; + A0A7DE9E17CD627E00BBC65E /* GameScreen.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = GameScreen.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/GameScreen.h; + sourceTree = ""; + }; + A0A7DEA417CD627E00BBC65E /* HeartContainer.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = HeartContainer.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/HeartContainer.h; + sourceTree = ""; + }; + A0A7DEA517CD627E00BBC65E /* HillsideBattleground.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = HillsideBattleground.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/HillsideBattleground.cpp; + sourceTree = ""; + }; + A0A7DEA617CD627E00BBC65E /* HillsideBattleground.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = HillsideBattleground.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/HillsideBattleground.h; + sourceTree = ""; + }; + A0A7DEAA17CD627E00BBC65E /* HUD.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = HUD.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/HUD.h; + sourceTree = ""; + }; + A0A7DEAB17CD627E00BBC65E /* HyruleTemple.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = HyruleTemple.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/HyruleTemple.cpp; + sourceTree = ""; + }; + A0A7DEAC17CD627E00BBC65E /* HyruleTemple.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = HyruleTemple.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/HyruleTemple.h; + sourceTree = ""; + }; + A0A7DEAD17CD627E00BBC65E /* Ichigo.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Ichigo.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Ichigo.cpp; + sourceTree = ""; + }; + A0A7DEAE17CD627E00BBC65E /* Ichigo.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Ichigo.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Ichigo.h; + sourceTree = ""; + }; + A0A7DEB317CD627E00BBC65E /* Mario.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Mario.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Mario.cpp; + sourceTree = ""; + }; + A0A7DEB417CD627E00BBC65E /* Mario.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Mario.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Mario.h; + sourceTree = ""; + }; + A0A7DEB517CD627E00BBC65E /* MenuBar.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = MenuBar.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBar.cpp; + sourceTree = ""; + }; + A0A7DEB617CD627E00BBC65E /* MenuBar.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = MenuBar.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBar.h; + sourceTree = ""; + }; + A0A7DEB717CD627E00BBC65E /* MenuBarSmall.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = MenuBarSmall.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBarSmall.cpp; + sourceTree = ""; + }; + A0A7DEB817CD627E00BBC65E /* MenuBarSmall.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = MenuBarSmall.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBarSmall.h; + sourceTree = ""; + }; + A0A7DEB917CD627E00BBC65E /* MenuBarSmallButton.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = MenuBarSmallButton.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBarSmallButton.cpp; + sourceTree = ""; + }; + A0A7DEBA17CD627E00BBC65E /* MenuBarSmallButton.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = MenuBarSmallButton.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBarSmallButton.h; + sourceTree = ""; + }; + A0A7DEBB17CD627E00BBC65E /* MenuBarToggle.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = MenuBarToggle.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBarToggle.cpp; + sourceTree = ""; + }; + A0A7DEBE17CD627E00BBC65E /* MenuBarValue.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = MenuBarValue.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/MenuBarValue.h; + sourceTree = ""; + }; + A0A7DEC217CD627E00BBC65E /* Menus.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Menus.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Menus.h; + sourceTree = ""; + }; + A0A7DEC317CD627E00BBC65E /* OffScreenExplode.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = OffScreenExplode.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/OffScreenExplode.cpp; + sourceTree = ""; + }; + A0A7DEC417CD627E00BBC65E /* OffScreenExplode.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = OffScreenExplode.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/OffScreenExplode.h; + sourceTree = ""; + }; + A0A7DEC617CD627E00BBC65E /* Platform.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Platform.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Platform.h; + sourceTree = ""; + }; + A0A7DECD17CD627E00BBC65E /* Program.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Program.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Program.cpp; + sourceTree = ""; + }; + A0A7DED417CD627E00BBC65E /* SmashBall.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = SmashBall.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/SmashBall.cpp; + sourceTree = ""; + }; + A0A7DED517CD627E00BBC65E /* SmashBall.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = SmashBall.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/SmashBall.h; + sourceTree = ""; + }; + A0A7DED617CD627E00BBC65E /* Sonic.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Sonic.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Sonic.cpp; + sourceTree = ""; + }; + A0A7DED717CD627E00BBC65E /* Sonic.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = Sonic.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Sonic.h; + sourceTree = ""; + }; + A0A7DED817CD627E00BBC65E /* Stage.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = Stage.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/Stage.cpp; + sourceTree = ""; + }; + A0A7DEDA17CD627E00BBC65E /* StageSelectScreen.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = StageSelectScreen.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/StageSelectScreen.cpp; + sourceTree = ""; + }; + A0A7DEDB17CD627E00BBC65E /* StageSelectScreen.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = StageSelectScreen.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/StageSelectScreen.h; + sourceTree = ""; + }; + A0A7DEDC17CD627E00BBC65E /* SuperMushroom.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = SuperMushroom.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/SuperMushroom.cpp; + sourceTree = ""; + }; + A0A7DEDE17CD627E00BBC65E /* ToggleButton.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = ToggleButton.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/ToggleButton.cpp; + sourceTree = ""; + }; + A0A7DEE017CD627E00BBC65E /* ToggleButtons.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = ToggleButtons.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/ToggleButtons.cpp; + sourceTree = ""; + }; + A0A7DEE117CD627E00BBC65E /* ToggleButtons.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = ToggleButtons.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/ToggleButtons.h; + sourceTree = ""; + }; + A0A7DEE317CD627E00BBC65E /* TogglePane.h */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.c.h; + name = TogglePane.h; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/TogglePane.h; + sourceTree = ""; + }; + A0A7DEE417CD627E00BBC65E /* WinnerScreen.cpp */ = { + isa = PBXFileReference; + fileEncoding = 4; + lastKnownFileType = sourcecode.cpp.cpp; + name = WinnerScreen.cpp; + path = /Users/luis/Documents/Xcode/SmashBros/SmashBros/WinnerScreen.cpp; + sourceTree = ""; + }; + A0AB292418194C220077AFC2 /* Actor.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {866, 16770}}"; + sepNavSelRange = "{5046, 0}"; + sepNavVisRange = "{4759, 823}"; + }; + }; + A0AB292518194C220077AFC2 /* Actor.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 2314}}"; + sepNavSelRange = "{4245, 0}"; + sepNavVisRange = "{3718, 535}"; + }; + }; + A0AB292618194C220077AFC2 /* Animation.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 10387}}"; + sepNavSelRange = "{15556, 0}"; + sepNavVisRange = "{15299, 481}"; + }; + }; + A0AB292718194C220077AFC2 /* Animation.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1157}}"; + sepNavSelRange = "{820, 0}"; + sepNavVisRange = "{500, 442}"; + }; + }; + A0AB292918194C220077AFC2 /* AnimationManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 351}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 570}"; + }; + }; + A0AB292A18194C220077AFC2 /* Application.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1097, 12207}}"; + sepNavSelRange = "{6504, 0}"; + sepNavVisRange = "{6351, 770}"; + }; + }; + A0AB292B18194C220077AFC2 /* Application.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 2236}}"; + sepNavSelRange = "{1295, 0}"; + sepNavVisRange = "{941, 385}"; + }; + }; + A0AB292D18194C220077AFC2 /* ApplicationEventListener.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 296}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 322}"; + }; + }; + A0AB292E18194C220077AFC2 /* ArrayList.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1807}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 358}"; + }; + }; + A0AB292F18194C220077AFC2 /* AssetManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1898}}"; + sepNavSelRange = "{2510, 0}"; + sepNavVisRange = "{1935, 726}"; + }; + }; + A0AB293018194C220077AFC2 /* AssetManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 416}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 543}"; + }; + }; + A0AB293118194C220077AFC2 /* BatchLoader.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 650}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 669}"; + }; + }; + A0AB293218194C220077AFC2 /* BatchLoader.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 494}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 364}"; + }; + }; + A0AB293318194C220077AFC2 /* BufferedImage.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1111, 1755}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 677}"; + }; + }; + A0AB293418194C220077AFC2 /* BufferedImage.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 546}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 356}"; + }; + }; + A0AB293518194C220077AFC2 /* CPPBridge.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 305}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 351}"; + }; + }; + A0AB293618194C220077AFC2 /* CPPBridge.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 282}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 112}"; + }; + }; + A0AB293718194C220077AFC2 /* Color.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 2054}}"; + sepNavSelRange = "{2425, 0}"; + sepNavVisRange = "{2144, 488}"; + }; + }; + A0AB293818194C220077AFC2 /* Color.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 689}}"; + sepNavSelRange = "{1146, 0}"; + sepNavVisRange = "{396, 885}"; + }; + }; + A0AB293918194C220077AFC2 /* Console.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 546}}"; + sepNavSelRange = "{268, 0}"; + sepNavVisRange = "{0, 763}"; + sepNavWindowFrame = "{{15, 315}, {747, 558}}"; + }; + }; + A0AB293A18194C220077AFC2 /* Console.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 431}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 298}"; + }; + }; + A0AB293B18194C220077AFC2 /* Font.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 2392}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 595}"; + }; + }; + A0AB293C18194C220077AFC2 /* Font.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 897}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 276}"; + }; + }; + A0AB293D18194C220077AFC2 /* GameEngine.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 572}}"; + sepNavSelRange = "{198, 0}"; + sepNavVisRange = "{0, 708}"; + }; + }; + A0AB293E18194C220077AFC2 /* GlobalDefs.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1053}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 401}"; + }; + }; + A0AB293F18194C220077AFC2 /* Graphics2D.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 8242}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 394}"; + }; + }; + A0AB294018194C220077AFC2 /* Graphics2D.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1300}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 398}"; + }; + }; + A0AB294218194C220077AFC2 /* Image.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 403}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 674}"; + }; + }; + A0AB294418194C220077AFC2 /* Keys.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1638}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 445}"; + }; + }; + A0AB294518194C220077AFC2 /* MailViewController.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 194}}"; + sepNavSelRange = "{70, 0}"; + sepNavVisRange = "{0, 324}"; + }; + }; + A0AB294618194C220077AFC2 /* MailViewController.mm */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 871}}"; + sepNavSelRange = "{907, 0}"; + sepNavVisRange = "{397, 1329}"; + }; + }; + A0AB294818194C220077AFC2 /* MenuScreen.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1885}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 369}"; + }; + }; + A0AB294A18194C220077AFC2 /* Music.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 572}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 343}"; + }; + }; + A0AB294B18194C220077AFC2 /* ObjCBridge.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 305}}"; + sepNavSelRange = "{63, 0}"; + sepNavVisRange = "{0, 564}"; + }; + }; + A0AB294C18194C220077AFC2 /* ObjCBridge.mm */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1716}}"; + sepNavSelRange = "{3316, 0}"; + sepNavVisRange = "{3076, 477}"; + }; + }; + A0AB294D18194C220077AFC2 /* P2PManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 12129}}"; + sepNavSelRange = "{3592, 0}"; + sepNavVisRange = "{3265, 539}"; + }; + }; + A0AB294E18194C220077AFC2 /* P2PManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1755}}"; + sepNavSelRange = "{2828, 0}"; + sepNavVisRange = "{2414, 655}"; + }; + }; + A0AB294F18194C220077AFC2 /* PixelIterator.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1430}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 315}"; + }; + }; + A0AB295018194C220077AFC2 /* PixelIterator.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 408}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 431}"; + }; + }; + A0AB295118194C220077AFC2 /* PrefManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 2834}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 338}"; + }; + }; + A0AB295218194C220077AFC2 /* PrefManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 572}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 256}"; + }; + }; + A0AB295318194C220077AFC2 /* PrimitiveActor.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1097, 5928}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 556}"; + }; + }; + A0AB295418194C220077AFC2 /* PrimitiveActor.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1008, 689}}"; + sepNavSelRange = "{888, 0}"; + sepNavVisRange = "{274, 965}"; + }; + }; + A0AB295618194C220077AFC2 /* Screen.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 299}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 430}"; + }; + }; + A0AB295818194C220077AFC2 /* ScreenManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 312}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 447}"; + }; + }; + A0AB295A18194C220077AFC2 /* Sound.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 806}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 318}"; + }; + }; + A0AB295B18194C220077AFC2 /* String.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 19370}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 417}"; + }; + }; + A0AB295C18194C220077AFC2 /* String.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1008, 1417}}"; + sepNavSelRange = "{2949, 0}"; + sepNavVisRange = "{2417, 1004}"; + }; + }; + A0AB295D18194C220077AFC2 /* TextActor.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 10244}}"; + sepNavSelRange = "{7398, 0}"; + sepNavVisRange = "{7015, 615}"; + }; + }; + A0AB295E18194C220077AFC2 /* TextActor.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1677}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 350}"; + }; + }; + A0AB296018194C220077AFC2 /* Thread.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 401}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 327}"; + }; + }; + A0AB296318194C220077AFC2 /* View.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1807}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 515}"; + }; + }; + A0AB296418194C220077AFC2 /* View.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 533}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 523}"; + }; + }; + A0AB296518194C220077AFC2 /* WireframeActor.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 7774}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 402}"; + }; + }; + A0AB296618194C220077AFC2 /* WireframeActor.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1183}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 411}"; + }; + }; + A0AB296718194C220077AFC2 /* forwards.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 286}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 357}"; + }; + }; + A0AB29A818194ECC0077AFC2 /* ActorGrid.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1950}}"; + sepNavSelRange = "{115, 0}"; + sepNavVisRange = "{1060, 325}"; + }; + }; + A0AB29A918194ECC0077AFC2 /* ActorGrid.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 624}}"; + sepNavSelRange = "{65, 0}"; + sepNavVisRange = "{0, 294}"; + }; + }; + A0AB29AA18194ECC0077AFC2 /* Arrows.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1690}}"; + sepNavSelRange = "{1684, 0}"; + sepNavVisRange = "{1118, 727}"; + }; + }; + A0AB29AB18194ECC0077AFC2 /* Arrows.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 728}}"; + sepNavSelRange = "{984, 0}"; + sepNavVisRange = "{388, 407}"; + }; + }; + A0AB29AC18194ECC0077AFC2 /* AttackManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1195, 1755}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 688}"; + }; + }; + A0AB29AD18194ECC0077AFC2 /* AttackManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1111, 780}}"; + sepNavSelRange = "{98, 0}"; + sepNavVisRange = "{0, 499}"; + }; + }; + A0AB29AF18194ECC0077AFC2 /* AttackRandomizer.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1001}}"; + sepNavSelRange = "{536, 0}"; + sepNavVisRange = "{202, 570}"; + }; + }; + A0AB29B118194ECC0077AFC2 /* AttackTemplates.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 780}}"; + sepNavSelRange = "{63, 0}"; + sepNavVisRange = "{0, 709}"; + }; + }; + A0AB29B218194ECC0077AFC2 /* BattlefieldBrawl.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1469}}"; + sepNavSelRange = "{785, 0}"; + sepNavVisRange = "{421, 473}"; + }; + }; + A0AB29B418194ECC0077AFC2 /* BeamSword.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {866, 3718}}"; + sepNavSelRange = "{99, 0}"; + sepNavVisRange = "{0, 582}"; + }; + }; + A0AB29B518194ECC0077AFC2 /* BeamSword.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 351}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 392}"; + }; + }; + A0AB29B618194ECC0077AFC2 /* Camera.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 6812}}"; + sepNavSelRange = "{2872, 0}"; + sepNavVisRange = "{2669, 370}"; + }; + }; + A0AB29B718194ECC0077AFC2 /* Camera.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 572}}"; + sepNavSelRange = "{311, 0}"; + sepNavVisRange = "{60, 366}"; + }; + }; + A0AB29B818194ECC0077AFC2 /* CharSelectScreen.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 12051}}"; + sepNavSelRange = "{3201, 0}"; + sepNavVisRange = "{2873, 425}"; + sepNavWindowFrame = "{{38, 294}, {747, 558}}"; + }; + }; + A0AB29BA18194ECC0077AFC2 /* Chargebar.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 910}}"; + sepNavSelRange = "{240, 0}"; + sepNavVisRange = "{68, 476}"; + }; + }; + A0AB29BC18194ECC0077AFC2 /* CollisionManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 663}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 427}"; + sepNavWindowFrame = "{{38, 294}, {747, 558}}"; + }; + }; + A0AB29BD18194ECC0077AFC2 /* CollisionManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1008, 386}}"; + sepNavSelRange = "{116, 0}"; + sepNavVisRange = "{0, 337}"; + }; + }; + A0AB29BE18194ECC0077AFC2 /* Controls.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 33202}}"; + sepNavSelRange = "{21468, 0}"; + sepNavVisRange = "{20846, 950}"; + sepNavWindowFrame = "{{15, 315}, {747, 558}}"; + }; + }; + A0AB29BF18194ECC0077AFC2 /* Controls.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1008, 1664}}"; + sepNavSelRange = "{1471, 0}"; + sepNavVisRange = "{828, 820}"; + }; + }; + A0AB29C218194ECC0077AFC2 /* Fox.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 16302}}"; + sepNavSelRange = "{292, 0}"; + sepNavVisRange = "{421, 393}"; + }; + }; + A0AB29C318194ECC0077AFC2 /* Fox.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1196}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{795, 434}"; + }; + }; + A0AB29C618194ECC0077AFC2 /* Game.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1222}}"; + sepNavSelRange = "{113, 0}"; + sepNavVisRange = "{0, 494}"; + }; + }; + A0AB29C718194ECC0077AFC2 /* Game.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 385}}"; + sepNavSelRange = "{122, 0}"; + sepNavVisRange = "{0, 384}"; + }; + }; + A0AB29C818194ECC0077AFC2 /* GameElement.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 6799}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{70, 488}"; + sepNavWindowFrame = "{{61, 273}, {747, 558}}"; + }; + }; + A0AB29C918194ECC0077AFC2 /* GameElement.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 442}}"; + sepNavSelRange = "{334, 0}"; + sepNavVisRange = "{0, 636}"; + }; + }; + A0AB29CA18194ECC0077AFC2 /* GameScreen.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 2054}}"; + sepNavSelRange = "{600, 0}"; + sepNavVisRange = "{334, 451}"; + }; + }; + A0AB29CC18194ECC0077AFC2 /* Global.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 16393}}"; + sepNavSelRange = "{996, 0}"; + sepNavVisRange = "{447, 773}"; + }; + }; + A0AB29CD18194ECC0077AFC2 /* Global.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 2028}}"; + sepNavSelRange = "{672, 0}"; + sepNavVisRange = "{583, 531}"; + }; + }; + A0AB29CE18194ECC0077AFC2 /* HUD.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 16081}}"; + sepNavSelRange = "{6377, 0}"; + sepNavVisRange = "{6270, 390}"; + }; + }; + A0AB29D018194ECC0077AFC2 /* HangPoint.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 364}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 329}"; + }; + }; + A0AB29D118194ECC0077AFC2 /* HangPoint.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 325}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 342}"; + }; + }; + A0AB29D218194ECC0077AFC2 /* HeartContainer.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 611}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 623}"; + }; + }; + A0AB29D518194ECC0077AFC2 /* HillsideBattleground.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 282}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 362}"; + }; + }; + A0AB29D618194ECC0077AFC2 /* HitBox.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 314}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 373}"; + }; + }; + A0AB29D718194ECC0077AFC2 /* HitBox.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 305}}"; + sepNavSelRange = "{34, 0}"; + sepNavVisRange = "{0, 350}"; + }; + }; + A0AB29D918194ECC0077AFC2 /* HyruleTemple.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 312}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 420}"; + }; + }; + A0AB29DC18194ECC0077AFC2 /* Item.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 18629}}"; + sepNavSelRange = "{1837, 0}"; + sepNavVisRange = "{1721, 543}"; + }; + }; + A0AB29DD18194ECC0077AFC2 /* Item.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 2171}}"; + sepNavSelRange = "{401, 0}"; + sepNavVisRange = "{0, 433}"; + }; + }; + A0AB29DE18194ECC0077AFC2 /* ItemManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 7488}}"; + sepNavSelRange = "{9822, 0}"; + sepNavVisRange = "{9614, 543}"; + sepNavWindowFrame = "{{14, 317}, {747, 558}}"; + }; + }; + A0AB29DF18194ECC0077AFC2 /* ItemManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 663}}"; + sepNavSelRange = "{227, 0}"; + sepNavVisRange = "{0, 470}"; + }; + }; + A0AB29E318194ECC0077AFC2 /* MenuBar.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 338}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{43, 422}"; + }; + }; + A0AB29E418194ECC0077AFC2 /* MenuBarSmall.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 754}}"; + sepNavSelRange = "{802, 0}"; + sepNavVisRange = "{541, 488}"; + }; + }; + A0AB29E518194ECC0077AFC2 /* MenuBarSmall.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 351}}"; + sepNavSelRange = "{450, 0}"; + sepNavVisRange = "{43, 468}"; + }; + }; + A0AB29E718194ECC0077AFC2 /* MenuBarSmallButton.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 286}}"; + sepNavSelRange = "{441, 0}"; + sepNavVisRange = "{0, 449}"; + }; + }; + A0AB29E818194ECC0077AFC2 /* MenuBarToggle.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1034, 819}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 593}"; + }; + }; + A0AB29E918194ECC0077AFC2 /* MenuBarToggle.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 494}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 430}"; + }; + }; + A0AB29EA18194ECC0077AFC2 /* MenuBarValue.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 2379}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 386}"; + }; + }; + A0AB29EB18194ECC0077AFC2 /* MenuBarValue.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 871}}"; + sepNavSelRange = "{223, 0}"; + sepNavVisRange = "{0, 394}"; + }; + }; + A0AB29EC18194ECC0077AFC2 /* MenuClasses.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 28821}}"; + sepNavSelRange = "{37009, 0}"; + sepNavVisRange = "{36600, 533}"; + }; + }; + A0AB29ED18194ECC0077AFC2 /* MenuClasses.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 5733}}"; + sepNavSelRange = "{3538, 6}"; + sepNavVisRange = "{3268, 562}"; + }; + }; + A0AB29EE18194ECC0077AFC2 /* Menus.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 4628}}"; + sepNavSelRange = "{1461, 0}"; + sepNavVisRange = "{11998, 748}"; + }; + }; + A0AB29EF18194ECC0077AFC2 /* Menus.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 923}}"; + sepNavSelRange = "{1443, 0}"; + sepNavVisRange = "{547, 961}"; + }; + }; + A0AB29F018194ECC0077AFC2 /* MusicManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1261}}"; + sepNavSelRange = "{883, 0}"; + sepNavVisRange = "{711, 385}"; + }; + }; + A0AB29F118194ECC0077AFC2 /* MusicManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 377}}"; + sepNavSelRange = "{202, 0}"; + sepNavVisRange = "{0, 462}"; + }; + }; + A0AB29F618194ECC0077AFC2 /* Player.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1090, 81250}}"; + sepNavSelRange = "{80258, 0}"; + sepNavVisRange = "{80116, 540}"; + }; + }; + A0AB29F718194ECC0077AFC2 /* Player.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 5772}}"; + sepNavSelRange = "{5071, 0}"; + sepNavVisRange = "{4888, 385}"; + }; + }; + A0AB29F818194ECC0077AFC2 /* PoisonMushroom.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1508}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 546}"; + }; + }; + A0AB29F918194ECC0077AFC2 /* PoisonMushroom.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 364}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 532}"; + }; + }; + A0AB29FA18194ECC0077AFC2 /* Preferences.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 3237}}"; + sepNavSelRange = "{823, 0}"; + sepNavVisRange = "{1219, 1480}"; + }; + }; + A0AB29FB18194ECC0077AFC2 /* Preferences.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1029, 533}}"; + sepNavSelRange = "{391, 0}"; + sepNavVisRange = "{113, 602}"; + }; + }; + A0AB29FC18194ECC0077AFC2 /* Program.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 282}}"; + sepNavSelRange = "{188, 0}"; + sepNavVisRange = "{0, 203}"; + }; + }; + A0AB29FD18194ECC0077AFC2 /* Projectile.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 14248}}"; + sepNavSelRange = "{4371, 0}"; + sepNavVisRange = "{1581, 574}"; + }; + }; + A0AB29FE18194ECC0077AFC2 /* Projectile.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1079}}"; + sepNavSelRange = "{1392, 0}"; + sepNavVisRange = "{999, 868}"; + }; + }; + A0AB29FF18194ECC0077AFC2 /* ProjectileManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 5603}}"; + sepNavSelRange = "{771, 0}"; + sepNavVisRange = "{272, 570}"; + sepNavWindowFrame = "{{84, 252}, {747, 558}}"; + }; + }; + A0AB2A0018194ECC0077AFC2 /* ProjectileManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 455}}"; + sepNavSelRange = "{311, 0}"; + sepNavVisRange = "{0, 406}"; + }; + }; + A0AB2A0118194ECC0077AFC2 /* RayGun.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 3705}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 470}"; + }; + }; + A0AB2A0218194ECC0077AFC2 /* RayGun.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 559}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 380}"; + }; + }; + A0AB2A0518194ECC0077AFC2 /* SmashForwards.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 328}}"; + sepNavSelRange = "{169, 0}"; + sepNavVisRange = "{0, 169}"; + }; + }; + A0AB2A0718194ECC0077AFC2 /* Sonic.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1157}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 415}"; + }; + }; + A0AB2A0918194ECC0077AFC2 /* SoundManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 429}}"; + sepNavSelRange = "{515, 0}"; + sepNavVisRange = "{50, 429}"; + }; + }; + A0AB2A0B18194ECC0077AFC2 /* Stage.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1560}}"; + sepNavSelRange = "{306, 0}"; + sepNavVisRange = "{2217, 673}"; + }; + }; + A0AB2A0F18194ECC0077AFC2 /* SuperMushroom.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 364}}"; + sepNavSelRange = "{33, 0}"; + sepNavVisRange = "{0, 529}"; + }; + }; + A0AB2A1118194ECC0077AFC2 /* ToggleButton.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 431}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 426}"; + }; + }; + A0AB2A1318194ECC0077AFC2 /* ToggleButtons.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 533}}"; + sepNavSelRange = "{808, 0}"; + sepNavVisRange = "{171, 526}"; + }; + }; + A0AB2A1418194ECC0077AFC2 /* TogglePane.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 884}}"; + sepNavSelRange = "{935, 0}"; + sepNavVisRange = "{0, 659}"; + }; + }; + A0AB2A1518194ECC0077AFC2 /* TogglePane.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 299}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 410}"; + }; + }; + A0AB2A1718194ECC0077AFC2 /* WinnerScreen.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 858}}"; + sepNavSelRange = "{76, 0}"; + sepNavVisRange = "{0, 665}"; + }; + }; + A0AED98D17C2E0F70002DD96 /* begin_code.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1963}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{3875, 506}"; + }; + }; + A0AED98E17C2E0F70002DD96 /* close_code.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 494}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{859, 558}"; + }; + }; + A0AED98F17C2E0F70002DD96 /* doxyfile */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 20267}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 886}"; + }; + }; + A0AED99217C2E0F70002DD96 /* dynamic_mod.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 741}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 974}"; + }; + }; + A0AED9A317C2E0F70002DD96 /* SDL.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 2093}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{4839, 451}"; + }; + }; + A0AED9A517C2E0F70002DD96 /* SDL_atomic.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1209, 4680}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{11510, 297}"; + }; + }; + A0AED9AA17C2E0F70002DD96 /* SDL_config.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 676}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{1137, 526}"; + }; + }; + A0AED9C417C2E0F70002DD96 /* SDL_main.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {989, 1768}}"; + sepNavSelRange = "{2434, 0}"; + sepNavVisRange = "{2322, 529}"; + }; + }; + A0AED9C517C2E0F70002DD96 /* SDL_messagebox.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1885}}"; + sepNavSelRange = "{2150, 0}"; + sepNavVisRange = "{1537, 947}"; + }; + }; + A0AED9CD17C2E0F70002DD96 /* SDL_pixels.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 5603}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 1026}"; + }; + }; + A0AED9D217C2E0F70002DD96 /* SDL_render.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {989, 11076}}"; + sepNavSelRange = "{4492, 0}"; + sepNavVisRange = "{4010, 612}"; + }; + }; + A0AED9D417C2E0F70002DD96 /* SDL_rwops.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {997, 2990}}"; + sepNavSelRange = "{5625, 72}"; + sepNavVisRange = "{5114, 1094}"; + }; + }; + A0AED9D917C2E0F70002DD96 /* SDL_system.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 1378}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{1200, 589}"; + }; + }; + A0AED9E817C2E0F70002DD96 /* SDL_timer.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {997, 1326}}"; + sepNavSelRange = "{1804, 51}"; + sepNavVisRange = "{1399, 938}"; + }; + }; + A0AED9EC17C2E0F70002DD96 /* SDL_version.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 2119}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{4686, 475}"; + }; + }; + A0AED9ED17C2E0F70002DD96 /* SDL_video.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 12233}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{0, 939}"; + }; + }; + A0AED9EE17C2E0F70002DD96 /* wavestream.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1006, 793}}"; + sepNavSelRange = "{0, 0}"; + sepNavVisRange = "{126, 933}"; + }; + }; + A0BF9B7617CE4F1300ECBEF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9817CD627E00BBC65E /* FractalStage.h */; + name = "FractalStage.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 250; + vrLoc = 0; + }; + A0BF9B7E17CE4F1300ECBEF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEA617CD627E00BBC65E /* HillsideBattleground.h */; + name = "HillsideBattleground.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 305; + vrLoc = 0; + }; + A0BF9B8A17CE4F1300ECBEF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEC617CD627E00BBC65E /* Platform.h */; + name = "Platform.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 339; + vrLoc = 0; + }; + A0BF9C0117D118D900ECBEF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9D217C2E0F70002DD96 /* SDL_render.h */; + name = "SDL_render.h: 128"; + rLen = 0; + rLoc = 4492; + rType = 0; + vrLen = 612; + vrLoc = 4010; + }; + A0BF9C4417D656AE00ECBEF4 /* stdlib.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = stdlib.h; + path = /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/stdlib.h; + sourceTree = ""; + }; + A0BF9C7F17D658C200ECBEF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0BF9C4417D656AE00ECBEF4 /* stdlib.h */; + name = "stdlib.h: 176"; + rLen = 0; + rLoc = 5841; + rType = 0; + vrLen = 866; + vrLoc = 5523; + }; + A0BF9D7F17D7AC4C00ECBEF4 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AED9C417C2E0F70002DD96 /* SDL_main.h */; + name = "SDL_main.h: 89"; + rLen = 0; + rLoc = 2434; + rType = 0; + vrLen = 529; + vrLoc = 2322; + }; + A0BF9D8217D7AC4C00ECBEF4 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A0BF9D8317D7AC4C00ECBEF4 /* loading.png */; + }; + A0BF9D8317D7AC4C00ECBEF4 /* loading.png */ = { + isa = PBXFileReference; + lastKnownFileType = image.png; + name = loading.png; + path = /Users/luis/Documents/Xcode/SmashBros/Images/loading.png; + sourceTree = ""; + }; + A0BF9D8417D7AC4C00ECBEF4 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A0BF9D8517D7AC4C00ECBEF4 /* icon.png */; + }; + A0BF9D8517D7AC4C00ECBEF4 /* icon.png */ = { + isa = PBXFileReference; + lastKnownFileType = image.png; + name = icon.png; + path = /Users/luis/Documents/Xcode/SmashBros/Images/icon.png; + sourceTree = ""; + }; + A0C570AD1834050900EC50FC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB296018194C220077AFC2 /* Thread.h */; + name = "Thread.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 327; + vrLoc = 0; + }; + A0C570AE1834050900EC50FC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB293B18194C220077AFC2 /* Font.cpp */; + name = "Font.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 595; + vrLoc = 0; + }; + A0C570AF1834050900EC50FC /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294218194C220077AFC2 /* Image.h */; + name = "Image.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 674; + vrLoc = 0; + }; + A0C779D8180E1C9100001642 /* SDL_p2p.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1195, 1014}}"; + sepNavSelRange = "{1854, 0}"; + sepNavVisRange = "{813, 1556}"; + }; + }; + A0D9D1C71884BC33005CD3D8 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294D18194C220077AFC2 /* P2PManager.cpp */; + name = "P2PManager.cpp: 209"; + rLen = 0; + rLoc = 3592; + rType = 0; + vrLen = 539; + vrLoc = 3265; + }; + A0D9D1C81884BC33005CD3D8 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB294E18194C220077AFC2 /* P2PManager.h */; + name = "P2PManager.h: 117"; + rLen = 0; + rLoc = 2828; + rType = 0; + vrLen = 655; + vrLoc = 2414; + }; + A0D9D1C91884BC33005CD3D8 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29CD18194ECC0077AFC2 /* Global.h */; + name = "Global.h: 38"; + rLen = 0; + rLoc = 672; + rType = 0; + vrLen = 531; + vrLoc = 583; + }; + A0D9D1CA1884BC33005CD3D8 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29CC18194ECC0077AFC2 /* Global.cpp */; + name = "Global.cpp: 38"; + rLen = 0; + rLoc = 996; + rType = 0; + vrLen = 773; + vrLoc = 447; + }; + A0DA85F317E27F0E00A0E71B /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0DA85F417E27F0E00A0E71B /* math.h */; + name = "math.h: 370"; + rLen = 0; + rLoc = 15314; + rType = 0; + vrLen = 607; + vrLoc = 14843; + }; + A0DA85F417E27F0E00A0E71B /* math.h */ = { + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = math.h; + path = /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.2.sdk/usr/include/architecture/i386/math.h; + sourceTree = ""; + }; + A0DD32F51954CC980000D832 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE9917CD627E00BBC65E /* Game.cpp */; + name = "Game.cpp: 6"; + rLen = 0; + rLoc = 113; + rType = 0; + vrLen = 447; + vrLoc = 0; + }; + A0DD32F61954CC980000D832 /* PlistBookmark */ = { + isa = PlistBookmark; + fRef = 8D1107310486CEB800E47090 /* Info.plist */; + fallbackIsa = PBXBookmark; + isK = 0; + kPath = ( + ); + name = /Users/luis/Documents/Xcode/SmashBros/Info.plist; + rLen = 0; + rLoc = 9223372036854775808; + }; + A0DD32F71954CC980000D832 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29C718194ECC0077AFC2 /* Game.h */; + name = "Game.h: 7"; + rLen = 0; + rLoc = 122; + rType = 0; + vrLen = 384; + vrLoc = 0; + }; + A0DD32F81954CC980000D832 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DECD17CD627E00BBC65E /* Program.cpp */; + name = "Program.cpp: 8"; + rLen = 0; + rLoc = 177; + rType = 0; + vrLen = 203; + vrLoc = 0; + }; + A0DD33101954CED10000D832 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB292A18194C220077AFC2 /* Application.cpp */; + name = "Application.cpp: 261"; + rLen = 0; + rLoc = 6504; + rType = 0; + vrLen = 770; + vrLoc = 6351; + }; + A0DD33111954CED10000D832 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A00132FB17DF8FB1005B6829 /* Icon.png */; + }; + A0DD33121954CED10000D832 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = A0DD33091954CE8F0000D832 /* Default-568.png */; + }; + A0DD33141954CED10000D832 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = FD77A07E0E26BDA900F39101 /* Default.png */; + }; + A0E583DE18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29D018194ECC0077AFC2 /* HangPoint.cpp */; + name = "HangPoint.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 329; + vrLoc = 0; + }; + A0E583DF18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29D118194ECC0077AFC2 /* HangPoint.h */; + name = "HangPoint.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 342; + vrLoc = 0; + }; + A0E583E418195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29AC18194ECC0077AFC2 /* AttackManager.cpp */; + name = "AttackManager.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 552; + vrLoc = 0; + }; + A0E583E518195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29AF18194ECC0077AFC2 /* AttackRandomizer.h */; + name = "AttackRandomizer.h: 28"; + rLen = 0; + rLoc = 536; + rType = 0; + vrLen = 570; + vrLoc = 202; + }; + A0E583E818195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DE7D17CD627E00BBC65E /* Arrows.cpp */; + name = "Arrows.cpp: 74"; + rLen = 0; + rLoc = 1684; + rType = 0; + vrLen = 335; + vrLoc = 0; + }; + A0E583E918195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB617CD627E00BBC65E /* MenuBar.h */; + name = "MenuBar.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 391; + vrLoc = 0; + }; + A0E583EA18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB517CD627E00BBC65E /* MenuBar.cpp */; + name = "MenuBar.cpp: 42"; + rLen = 0; + rLoc = 975; + rType = 0; + vrLen = 545; + vrLoc = 0; + }; + A0E583EB18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB817CD627E00BBC65E /* MenuBarSmall.h */; + name = "MenuBarSmall.h: 23"; + rLen = 0; + rLoc = 461; + rType = 0; + vrLen = 406; + vrLoc = 0; + }; + A0E583EC18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB717CD627E00BBC65E /* MenuBarSmall.cpp */; + name = "MenuBarSmall.cpp: 31"; + rLen = 0; + rLoc = 802; + rType = 0; + vrLen = 588; + vrLoc = 0; + }; + A0E583ED18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEBA17CD627E00BBC65E /* MenuBarSmallButton.h */; + name = "MenuBarSmallButton.h: 20"; + rLen = 0; + rLoc = 441; + rType = 0; + vrLen = 448; + vrLoc = 0; + }; + A0E583EE18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEB917CD627E00BBC65E /* MenuBarSmallButton.cpp */; + name = "MenuBarSmallButton.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 643; + vrLoc = 0; + }; + A0E583EF18195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29E918194ECC0077AFC2 /* MenuBarToggle.h */; + name = "MenuBarToggle.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 430; + vrLoc = 0; + }; + A0E583F118195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEBE17CD627E00BBC65E /* MenuBarValue.h */; + name = "MenuBarValue.h: 15"; + rLen = 0; + rLoc = 223; + rType = 0; + vrLen = 392; + vrLoc = 0; + }; + A0E583F218195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0AB29EA18194ECC0077AFC2 /* MenuBarValue.cpp */; + name = "MenuBarValue.cpp: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 386; + vrLoc = 0; + }; + A0E583F718195CA10060C035 /* PBXTextBookmark */ = { + isa = PBXTextBookmark; + fRef = A0A7DEE317CD627E00BBC65E /* TogglePane.h */; + name = "TogglePane.h: 1"; + rLen = 0; + rLoc = 0; + rType = 0; + vrLen = 416; + vrLoc = 0; + }; + A0E58406181A8B680060C035 /* P2PDataManager.cpp */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 10088}}"; + sepNavSelRange = "{6818, 0}"; + sepNavVisRange = "{6466, 604}"; + sepNavWindowFrame = "{{15, 315}, {747, 558}}"; + }; + }; + A0E58407181A8B680060C035 /* P2PDataManager.h */ = { + uiCtxt = { + sepNavIntBoundsRect = "{{0, 0}, {1030, 1092}}"; + sepNavSelRange = "{1233, 0}"; + sepNavVisRange = "{880, 787}"; + }; + }; + A0EB08011955F31900B6E8C2 /* PBXBookmark */ = { + isa = PBXBookmark; + fRef = FD77A07E0E26BDA900F39101 /* Default.png */; + }; +} diff --git a/SmashBros.xcodeproj/project.pbxproj b/SmashBros.xcodeproj/project.pbxproj new file mode 100755 index 0000000..c6bec89 --- /dev/null +++ b/SmashBros.xcodeproj/project.pbxproj @@ -0,0 +1,1244 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; + 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; }; + A00132FC17DF8FB1005B6829 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = A00132FB17DF8FB1005B6829 /* Icon.png */; }; + A006580317F8C09D00B54DF7 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A006580217F8C09C00B54DF7 /* MessageUI.framework */; }; + A02A428F183962EB0088CF1E /* Bitset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A02A428D183962EB0088CF1E /* Bitset.cpp */; }; + A05C8D72180780B600A30C28 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A05C8D71180780B600A30C28 /* GameKit.framework */; }; + A06367E91884C099007B789C /* Images in Resources */ = {isa = PBXBuildFile; fileRef = A06365D51884C099007B789C /* Images */; }; + A088D52517F48E9D001E85E5 /* Sounds in Resources */ = {isa = PBXBuildFile; fileRef = A088D51D17F48E9D001E85E5 /* Sounds */; }; + A08A15B6188EC4220028A41E /* MessageBoxDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A08A15B5188EC4220028A41E /* MessageBoxDelegate.mm */; }; + A0955C1717C3BA27000C9F4E /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0955C1617C3BA27000C9F4E /* MobileCoreServices.framework */; }; + A0955C1D17C3BAC7000C9F4E /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0955C1C17C3BAC7000C9F4E /* ImageIO.framework */; }; + A0AB296818194C220077AFC2 /* Actor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB292418194C220077AFC2 /* Actor.cpp */; }; + A0AB296918194C220077AFC2 /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB292618194C220077AFC2 /* Animation.cpp */; }; + A0AB296A18194C220077AFC2 /* AnimationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB292818194C220077AFC2 /* AnimationManager.cpp */; }; + A0AB296B18194C220077AFC2 /* Application.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB292A18194C220077AFC2 /* Application.cpp */; }; + A0AB296C18194C220077AFC2 /* ApplicationEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB292C18194C220077AFC2 /* ApplicationEventListener.cpp */; }; + A0AB296D18194C220077AFC2 /* AssetManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB292F18194C220077AFC2 /* AssetManager.cpp */; }; + A0AB296E18194C220077AFC2 /* BatchLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293118194C220077AFC2 /* BatchLoader.cpp */; }; + A0AB296F18194C220077AFC2 /* BufferedImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293318194C220077AFC2 /* BufferedImage.cpp */; }; + A0AB297018194C220077AFC2 /* CPPBridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293518194C220077AFC2 /* CPPBridge.cpp */; }; + A0AB297118194C220077AFC2 /* Color.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293718194C220077AFC2 /* Color.cpp */; }; + A0AB297218194C220077AFC2 /* Console.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293918194C220077AFC2 /* Console.cpp */; }; + A0AB297318194C220077AFC2 /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293B18194C220077AFC2 /* Font.cpp */; }; + A0AB297418194C220077AFC2 /* Graphics2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB293F18194C220077AFC2 /* Graphics2D.cpp */; }; + A0AB297518194C220077AFC2 /* Image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294118194C220077AFC2 /* Image.cpp */; }; + A0AB297618194C220077AFC2 /* Keys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294318194C220077AFC2 /* Keys.cpp */; }; + A0AB297718194C220077AFC2 /* MailViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294618194C220077AFC2 /* MailViewController.mm */; }; + A0AB297818194C220077AFC2 /* MenuScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294718194C220077AFC2 /* MenuScreen.cpp */; }; + A0AB297918194C220077AFC2 /* Music.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294918194C220077AFC2 /* Music.cpp */; }; + A0AB297A18194C220077AFC2 /* ObjCBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294C18194C220077AFC2 /* ObjCBridge.mm */; }; + A0AB297B18194C220077AFC2 /* P2PManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294D18194C220077AFC2 /* P2PManager.cpp */; }; + A0AB297C18194C220077AFC2 /* PixelIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB294F18194C220077AFC2 /* PixelIterator.cpp */; }; + A0AB297D18194C220077AFC2 /* PrefManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295118194C220077AFC2 /* PrefManager.cpp */; }; + A0AB297E18194C220077AFC2 /* PrimitiveActor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295318194C220077AFC2 /* PrimitiveActor.cpp */; }; + A0AB297F18194C220077AFC2 /* Screen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295518194C220077AFC2 /* Screen.cpp */; }; + A0AB298018194C220077AFC2 /* ScreenManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295718194C220077AFC2 /* ScreenManager.cpp */; }; + A0AB298118194C220077AFC2 /* Sound.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295918194C220077AFC2 /* Sound.cpp */; }; + A0AB298218194C220077AFC2 /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295B18194C220077AFC2 /* String.cpp */; }; + A0AB298318194C220077AFC2 /* TextActor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295D18194C220077AFC2 /* TextActor.cpp */; }; + A0AB298418194C220077AFC2 /* Thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB295F18194C220077AFC2 /* Thread.cpp */; }; + A0AB298518194C220077AFC2 /* View.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB296318194C220077AFC2 /* View.cpp */; }; + A0AB298618194C220077AFC2 /* WireframeActor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB296518194C220077AFC2 /* WireframeActor.cpp */; }; + A0AB2A1818194ECC0077AFC2 /* ActorGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29A818194ECC0077AFC2 /* ActorGrid.cpp */; }; + A0AB2A1918194ECC0077AFC2 /* Arrows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29AA18194ECC0077AFC2 /* Arrows.cpp */; }; + A0AB2A1A18194ECC0077AFC2 /* AttackManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29AC18194ECC0077AFC2 /* AttackManager.cpp */; }; + A0AB2A1B18194ECC0077AFC2 /* AttackRandomizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29AE18194ECC0077AFC2 /* AttackRandomizer.cpp */; }; + A0AB2A1C18194ECC0077AFC2 /* AttackTemplates.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29B018194ECC0077AFC2 /* AttackTemplates.cpp */; }; + A0AB2A1D18194ECC0077AFC2 /* BattlefieldBrawl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29B218194ECC0077AFC2 /* BattlefieldBrawl.cpp */; }; + A0AB2A1E18194ECC0077AFC2 /* BeamSword.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29B418194ECC0077AFC2 /* BeamSword.cpp */; }; + A0AB2A1F18194ECC0077AFC2 /* Camera.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29B618194ECC0077AFC2 /* Camera.cpp */; }; + A0AB2A2018194ECC0077AFC2 /* CharSelectScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29B818194ECC0077AFC2 /* CharSelectScreen.cpp */; }; + A0AB2A2118194ECC0077AFC2 /* Chargebar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29BA18194ECC0077AFC2 /* Chargebar.cpp */; }; + A0AB2A2218194ECC0077AFC2 /* CollisionManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29BC18194ECC0077AFC2 /* CollisionManager.cpp */; }; + A0AB2A2318194ECC0077AFC2 /* Controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29BE18194ECC0077AFC2 /* Controls.cpp */; }; + A0AB2A2418194ECC0077AFC2 /* FinalDestinationBrawl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29C018194ECC0077AFC2 /* FinalDestinationBrawl.cpp */; }; + A0AB2A2518194ECC0077AFC2 /* Fox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29C218194ECC0077AFC2 /* Fox.cpp */; }; + A0AB2A2618194ECC0077AFC2 /* FractalStage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29C418194ECC0077AFC2 /* FractalStage.cpp */; }; + A0AB2A2718194ECC0077AFC2 /* Game.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29C618194ECC0077AFC2 /* Game.cpp */; }; + A0AB2A2818194ECC0077AFC2 /* GameElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29C818194ECC0077AFC2 /* GameElement.cpp */; }; + A0AB2A2918194ECC0077AFC2 /* GameScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29CA18194ECC0077AFC2 /* GameScreen.cpp */; }; + A0AB2A2A18194ECC0077AFC2 /* Global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29CC18194ECC0077AFC2 /* Global.cpp */; }; + A0AB2A2B18194ECC0077AFC2 /* HUD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29CE18194ECC0077AFC2 /* HUD.cpp */; }; + A0AB2A2C18194ECC0077AFC2 /* HangPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29D018194ECC0077AFC2 /* HangPoint.cpp */; }; + A0AB2A2D18194ECC0077AFC2 /* HeartContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29D218194ECC0077AFC2 /* HeartContainer.cpp */; }; + A0AB2A2E18194ECC0077AFC2 /* HillsideBattleground.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29D418194ECC0077AFC2 /* HillsideBattleground.cpp */; }; + A0AB2A2F18194ECC0077AFC2 /* HitBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29D618194ECC0077AFC2 /* HitBox.cpp */; }; + A0AB2A3018194ECC0077AFC2 /* HyruleTemple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29D818194ECC0077AFC2 /* HyruleTemple.cpp */; }; + A0AB2A3118194ECC0077AFC2 /* Ichigo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29DA18194ECC0077AFC2 /* Ichigo.cpp */; }; + A0AB2A3218194ECC0077AFC2 /* Item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29DC18194ECC0077AFC2 /* Item.cpp */; }; + A0AB2A3318194ECC0077AFC2 /* ItemManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29DE18194ECC0077AFC2 /* ItemManager.cpp */; }; + A0AB2A3418194ECC0077AFC2 /* Mario.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29E018194ECC0077AFC2 /* Mario.cpp */; }; + A0AB2A3518194ECC0077AFC2 /* MenuBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29E218194ECC0077AFC2 /* MenuBar.cpp */; }; + A0AB2A3618194ECC0077AFC2 /* MenuBarSmall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29E418194ECC0077AFC2 /* MenuBarSmall.cpp */; }; + A0AB2A3718194ECC0077AFC2 /* MenuBarSmallButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29E618194ECC0077AFC2 /* MenuBarSmallButton.cpp */; }; + A0AB2A3818194ECC0077AFC2 /* MenuBarToggle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29E818194ECC0077AFC2 /* MenuBarToggle.cpp */; }; + A0AB2A3918194ECC0077AFC2 /* MenuBarValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29EA18194ECC0077AFC2 /* MenuBarValue.cpp */; }; + A0AB2A3A18194ECC0077AFC2 /* MenuClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29EC18194ECC0077AFC2 /* MenuClasses.cpp */; }; + A0AB2A3B18194ECC0077AFC2 /* Menus.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29EE18194ECC0077AFC2 /* Menus.cpp */; }; + A0AB2A3C18194ECC0077AFC2 /* MusicManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29F018194ECC0077AFC2 /* MusicManager.cpp */; }; + A0AB2A3D18194ECC0077AFC2 /* OffScreenExplode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29F218194ECC0077AFC2 /* OffScreenExplode.cpp */; }; + A0AB2A3E18194ECC0077AFC2 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29F418194ECC0077AFC2 /* Platform.cpp */; }; + A0AB2A3F18194ECC0077AFC2 /* Player.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29F618194ECC0077AFC2 /* Player.cpp */; }; + A0AB2A4018194ECC0077AFC2 /* PoisonMushroom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29F818194ECC0077AFC2 /* PoisonMushroom.cpp */; }; + A0AB2A4118194ECC0077AFC2 /* Preferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29FA18194ECC0077AFC2 /* Preferences.cpp */; }; + A0AB2A4218194ECC0077AFC2 /* Program.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29FC18194ECC0077AFC2 /* Program.cpp */; }; + A0AB2A4318194ECC0077AFC2 /* Projectile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29FD18194ECC0077AFC2 /* Projectile.cpp */; }; + A0AB2A4418194ECC0077AFC2 /* ProjectileManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB29FF18194ECC0077AFC2 /* ProjectileManager.cpp */; }; + A0AB2A4518194ECC0077AFC2 /* RayGun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0118194ECC0077AFC2 /* RayGun.cpp */; }; + A0AB2A4618194ECC0077AFC2 /* SmashBall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0318194ECC0077AFC2 /* SmashBall.cpp */; }; + A0AB2A4718194ECC0077AFC2 /* Sonic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0618194ECC0077AFC2 /* Sonic.cpp */; }; + A0AB2A4818194ECC0077AFC2 /* SoundManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0818194ECC0077AFC2 /* SoundManager.cpp */; }; + A0AB2A4918194ECC0077AFC2 /* Stage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0A18194ECC0077AFC2 /* Stage.cpp */; }; + A0AB2A4A18194ECC0077AFC2 /* StageSelectScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0C18194ECC0077AFC2 /* StageSelectScreen.cpp */; }; + A0AB2A4B18194ECC0077AFC2 /* SuperMushroom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A0E18194ECC0077AFC2 /* SuperMushroom.cpp */; }; + A0AB2A4C18194ECC0077AFC2 /* ToggleButton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A1018194ECC0077AFC2 /* ToggleButton.cpp */; }; + A0AB2A4D18194ECC0077AFC2 /* ToggleButtons.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A1218194ECC0077AFC2 /* ToggleButtons.cpp */; }; + A0AB2A4E18194ECC0077AFC2 /* TogglePane.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A1418194ECC0077AFC2 /* TogglePane.cpp */; }; + A0AB2A4F18194ECC0077AFC2 /* WinnerScreen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0AB2A1618194ECC0077AFC2 /* WinnerScreen.cpp */; }; + A0AED9F417C2E0F70002DD96 /* doxyfile in Resources */ = {isa = PBXBuildFile; fileRef = A0AED98F17C2E0F70002DD96 /* doxyfile */; }; + A0AED9F517C2E0F70002DD96 /* SDL_config.h.cmake in Resources */ = {isa = PBXBuildFile; fileRef = A0AED9AB17C2E0F70002DD96 /* SDL_config.h.cmake */; }; + A0AED9F617C2E0F70002DD96 /* SDL_config.h.in in Resources */ = {isa = PBXBuildFile; fileRef = A0AED9AC17C2E0F70002DD96 /* SDL_config.h.in */; }; + A0BF9D4417D7A60000ECBEF4 /* libSDL_image.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0BF9D4017D7A60000ECBEF4 /* libSDL_image.a */; }; + A0BF9D4517D7A60000ECBEF4 /* libSDL_mixer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0BF9D4117D7A60000ECBEF4 /* libSDL_mixer.a */; }; + A0BF9D4617D7A60000ECBEF4 /* libSDL_ttf.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0BF9D4217D7A60000ECBEF4 /* libSDL_ttf.a */; }; + A0BF9D4717D7A60000ECBEF4 /* libSDL.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A0BF9D4317D7A60000ECBEF4 /* libSDL.a */; }; + A0BF9FEE17DA4C2900ECBEF4 /* Fonts in Resources */ = {isa = PBXBuildFile; fileRef = A0BF9FEA17DA4C2900ECBEF4 /* Fonts */; }; + A0DD330A1954CE8F0000D832 /* Default-568.png in Resources */ = {isa = PBXBuildFile; fileRef = A0DD33091954CE8F0000D832 /* Default-568.png */; }; + A0E58408181A8B680060C035 /* P2PDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A0E58406181A8B680060C035 /* P2PDataManager.cpp */; }; + A0FB9C9B17EE153200A2EBBE /* Music in Resources */ = {isa = PBXBuildFile; fileRef = A0FB9C8E17EE153200A2EBBE /* Music */; }; + FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD779EDD0E26BA1200F39101 /* CoreAudio.framework */; }; + FD77A07F0E26BDA900F39101 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = FD77A07E0E26BDA900F39101 /* Default.png */; }; + FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FD77A0840E26BDB800F39101 /* AudioToolbox.framework */; }; + FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* GameEngine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GameEngine.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; + 28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A00132FB17DF8FB1005B6829 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = ""; }; + A006580217F8C09C00B54DF7 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; + A02A428D183962EB0088CF1E /* Bitset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Bitset.cpp; path = SmashBros/GameEngine/Bitset.cpp; sourceTree = ""; }; + A02A428E183962EB0088CF1E /* Bitset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Bitset.h; path = SmashBros/GameEngine/Bitset.h; sourceTree = ""; }; + A05C8D71180780B600A30C28 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; + A06365D51884C099007B789C /* Images */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Images; sourceTree = ""; }; + A088D51D17F48E9D001E85E5 /* Sounds */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Sounds; sourceTree = ""; }; + A08A15B4188EC4220028A41E /* MessageBoxDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MessageBoxDelegate.h; path = SmashBros/GameEngine/MessageBoxDelegate.h; sourceTree = ""; }; + A08A15B5188EC4220028A41E /* MessageBoxDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MessageBoxDelegate.mm; path = SmashBros/GameEngine/MessageBoxDelegate.mm; sourceTree = ""; }; + A0955C1617C3BA27000C9F4E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; + A0955C1C17C3BAC7000C9F4E /* ImageIO.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ImageIO.framework; path = System/Library/Frameworks/ImageIO.framework; sourceTree = SDKROOT; }; + A0AB292418194C220077AFC2 /* Actor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Actor.cpp; path = SmashBros/GameEngine/Actor.cpp; sourceTree = ""; }; + A0AB292518194C220077AFC2 /* Actor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Actor.h; path = SmashBros/GameEngine/Actor.h; sourceTree = ""; }; + A0AB292618194C220077AFC2 /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animation.cpp; path = SmashBros/GameEngine/Animation.cpp; sourceTree = ""; }; + A0AB292718194C220077AFC2 /* Animation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Animation.h; path = SmashBros/GameEngine/Animation.h; sourceTree = ""; }; + A0AB292818194C220077AFC2 /* AnimationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationManager.cpp; path = SmashBros/GameEngine/AnimationManager.cpp; sourceTree = ""; }; + A0AB292918194C220077AFC2 /* AnimationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnimationManager.h; path = SmashBros/GameEngine/AnimationManager.h; sourceTree = ""; }; + A0AB292A18194C220077AFC2 /* Application.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Application.cpp; path = SmashBros/GameEngine/Application.cpp; sourceTree = ""; }; + A0AB292B18194C220077AFC2 /* Application.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Application.h; path = SmashBros/GameEngine/Application.h; sourceTree = ""; }; + A0AB292C18194C220077AFC2 /* ApplicationEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ApplicationEventListener.cpp; path = SmashBros/GameEngine/ApplicationEventListener.cpp; sourceTree = ""; }; + A0AB292D18194C220077AFC2 /* ApplicationEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ApplicationEventListener.h; path = SmashBros/GameEngine/ApplicationEventListener.h; sourceTree = ""; }; + A0AB292E18194C220077AFC2 /* ArrayList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArrayList.h; path = SmashBros/GameEngine/ArrayList.h; sourceTree = ""; }; + A0AB292F18194C220077AFC2 /* AssetManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AssetManager.cpp; path = SmashBros/GameEngine/AssetManager.cpp; sourceTree = ""; }; + A0AB293018194C220077AFC2 /* AssetManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AssetManager.h; path = SmashBros/GameEngine/AssetManager.h; sourceTree = ""; }; + A0AB293118194C220077AFC2 /* BatchLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BatchLoader.cpp; path = SmashBros/GameEngine/BatchLoader.cpp; sourceTree = ""; }; + A0AB293218194C220077AFC2 /* BatchLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BatchLoader.h; path = SmashBros/GameEngine/BatchLoader.h; sourceTree = ""; }; + A0AB293318194C220077AFC2 /* BufferedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BufferedImage.cpp; path = SmashBros/GameEngine/BufferedImage.cpp; sourceTree = ""; }; + A0AB293418194C220077AFC2 /* BufferedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BufferedImage.h; path = SmashBros/GameEngine/BufferedImage.h; sourceTree = ""; }; + A0AB293518194C220077AFC2 /* CPPBridge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPPBridge.cpp; path = SmashBros/GameEngine/CPPBridge.cpp; sourceTree = ""; }; + A0AB293618194C220077AFC2 /* CPPBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPPBridge.h; path = SmashBros/GameEngine/CPPBridge.h; sourceTree = ""; }; + A0AB293718194C220077AFC2 /* Color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Color.cpp; path = SmashBros/GameEngine/Color.cpp; sourceTree = ""; }; + A0AB293818194C220077AFC2 /* Color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Color.h; path = SmashBros/GameEngine/Color.h; sourceTree = ""; }; + A0AB293918194C220077AFC2 /* Console.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Console.cpp; path = SmashBros/GameEngine/Console.cpp; sourceTree = ""; }; + A0AB293A18194C220077AFC2 /* Console.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Console.h; path = SmashBros/GameEngine/Console.h; sourceTree = ""; }; + A0AB293B18194C220077AFC2 /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Font.cpp; path = SmashBros/GameEngine/Font.cpp; sourceTree = ""; }; + A0AB293C18194C220077AFC2 /* Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Font.h; path = SmashBros/GameEngine/Font.h; sourceTree = ""; }; + A0AB293D18194C220077AFC2 /* GameEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameEngine.h; path = SmashBros/GameEngine/GameEngine.h; sourceTree = ""; }; + A0AB293E18194C220077AFC2 /* GlobalDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GlobalDefs.h; path = SmashBros/GameEngine/GlobalDefs.h; sourceTree = ""; }; + A0AB293F18194C220077AFC2 /* Graphics2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Graphics2D.cpp; path = SmashBros/GameEngine/Graphics2D.cpp; sourceTree = ""; }; + A0AB294018194C220077AFC2 /* Graphics2D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Graphics2D.h; path = SmashBros/GameEngine/Graphics2D.h; sourceTree = ""; }; + A0AB294118194C220077AFC2 /* Image.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Image.cpp; path = SmashBros/GameEngine/Image.cpp; sourceTree = ""; }; + A0AB294218194C220077AFC2 /* Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Image.h; path = SmashBros/GameEngine/Image.h; sourceTree = ""; }; + A0AB294318194C220077AFC2 /* Keys.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Keys.cpp; path = SmashBros/GameEngine/Keys.cpp; sourceTree = ""; }; + A0AB294418194C220077AFC2 /* Keys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Keys.h; path = SmashBros/GameEngine/Keys.h; sourceTree = ""; }; + A0AB294518194C220077AFC2 /* MailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MailViewController.h; path = SmashBros/GameEngine/MailViewController.h; sourceTree = ""; }; + A0AB294618194C220077AFC2 /* MailViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MailViewController.mm; path = SmashBros/GameEngine/MailViewController.mm; sourceTree = ""; }; + A0AB294718194C220077AFC2 /* MenuScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuScreen.cpp; path = SmashBros/GameEngine/MenuScreen.cpp; sourceTree = ""; }; + A0AB294818194C220077AFC2 /* MenuScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuScreen.h; path = SmashBros/GameEngine/MenuScreen.h; sourceTree = ""; }; + A0AB294918194C220077AFC2 /* Music.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Music.cpp; path = SmashBros/GameEngine/Music.cpp; sourceTree = ""; }; + A0AB294A18194C220077AFC2 /* Music.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Music.h; path = SmashBros/GameEngine/Music.h; sourceTree = ""; }; + A0AB294B18194C220077AFC2 /* ObjCBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjCBridge.h; path = SmashBros/GameEngine/ObjCBridge.h; sourceTree = ""; }; + A0AB294C18194C220077AFC2 /* ObjCBridge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ObjCBridge.mm; path = SmashBros/GameEngine/ObjCBridge.mm; sourceTree = ""; }; + A0AB294D18194C220077AFC2 /* P2PManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = P2PManager.cpp; path = SmashBros/GameEngine/P2PManager.cpp; sourceTree = ""; }; + A0AB294E18194C220077AFC2 /* P2PManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = P2PManager.h; path = SmashBros/GameEngine/P2PManager.h; sourceTree = ""; }; + A0AB294F18194C220077AFC2 /* PixelIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PixelIterator.cpp; path = SmashBros/GameEngine/PixelIterator.cpp; sourceTree = ""; }; + A0AB295018194C220077AFC2 /* PixelIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PixelIterator.h; path = SmashBros/GameEngine/PixelIterator.h; sourceTree = ""; }; + A0AB295118194C220077AFC2 /* PrefManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrefManager.cpp; path = SmashBros/GameEngine/PrefManager.cpp; sourceTree = ""; }; + A0AB295218194C220077AFC2 /* PrefManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrefManager.h; path = SmashBros/GameEngine/PrefManager.h; sourceTree = ""; }; + A0AB295318194C220077AFC2 /* PrimitiveActor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PrimitiveActor.cpp; path = SmashBros/GameEngine/PrimitiveActor.cpp; sourceTree = ""; }; + A0AB295418194C220077AFC2 /* PrimitiveActor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PrimitiveActor.h; path = SmashBros/GameEngine/PrimitiveActor.h; sourceTree = ""; }; + A0AB295518194C220077AFC2 /* Screen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Screen.cpp; path = SmashBros/GameEngine/Screen.cpp; sourceTree = ""; }; + A0AB295618194C220077AFC2 /* Screen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Screen.h; path = SmashBros/GameEngine/Screen.h; sourceTree = ""; }; + A0AB295718194C220077AFC2 /* ScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScreenManager.cpp; path = SmashBros/GameEngine/ScreenManager.cpp; sourceTree = ""; }; + A0AB295818194C220077AFC2 /* ScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScreenManager.h; path = SmashBros/GameEngine/ScreenManager.h; sourceTree = ""; }; + A0AB295918194C220077AFC2 /* Sound.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sound.cpp; path = SmashBros/GameEngine/Sound.cpp; sourceTree = ""; }; + A0AB295A18194C220077AFC2 /* Sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sound.h; path = SmashBros/GameEngine/Sound.h; sourceTree = ""; }; + A0AB295B18194C220077AFC2 /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = String.cpp; path = SmashBros/GameEngine/String.cpp; sourceTree = ""; }; + A0AB295C18194C220077AFC2 /* String.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = String.h; path = SmashBros/GameEngine/String.h; sourceTree = ""; }; + A0AB295D18194C220077AFC2 /* TextActor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextActor.cpp; path = SmashBros/GameEngine/TextActor.cpp; sourceTree = ""; }; + A0AB295E18194C220077AFC2 /* TextActor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextActor.h; path = SmashBros/GameEngine/TextActor.h; sourceTree = ""; }; + A0AB295F18194C220077AFC2 /* Thread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Thread.cpp; path = SmashBros/GameEngine/Thread.cpp; sourceTree = ""; }; + A0AB296018194C220077AFC2 /* Thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Thread.h; path = SmashBros/GameEngine/Thread.h; sourceTree = ""; }; + A0AB296118194C220077AFC2 /* TouchPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TouchPoint.h; path = SmashBros/GameEngine/TouchPoint.h; sourceTree = ""; }; + A0AB296218194C220077AFC2 /* Vector2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Vector2.h; path = SmashBros/GameEngine/Vector2.h; sourceTree = ""; }; + A0AB296318194C220077AFC2 /* View.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = View.cpp; path = SmashBros/GameEngine/View.cpp; sourceTree = ""; }; + A0AB296418194C220077AFC2 /* View.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = View.h; path = SmashBros/GameEngine/View.h; sourceTree = ""; }; + A0AB296518194C220077AFC2 /* WireframeActor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WireframeActor.cpp; path = SmashBros/GameEngine/WireframeActor.cpp; sourceTree = ""; }; + A0AB296618194C220077AFC2 /* WireframeActor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WireframeActor.h; path = SmashBros/GameEngine/WireframeActor.h; sourceTree = ""; }; + A0AB296718194C220077AFC2 /* forwards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = forwards.h; path = SmashBros/GameEngine/forwards.h; sourceTree = ""; }; + A0AB29A818194ECC0077AFC2 /* ActorGrid.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ActorGrid.cpp; path = SmashBros/ActorGrid.cpp; sourceTree = ""; }; + A0AB29A918194ECC0077AFC2 /* ActorGrid.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ActorGrid.h; path = SmashBros/ActorGrid.h; sourceTree = ""; }; + A0AB29AA18194ECC0077AFC2 /* Arrows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Arrows.cpp; path = SmashBros/Arrows.cpp; sourceTree = ""; }; + A0AB29AB18194ECC0077AFC2 /* Arrows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Arrows.h; path = SmashBros/Arrows.h; sourceTree = ""; }; + A0AB29AC18194ECC0077AFC2 /* AttackManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttackManager.cpp; path = SmashBros/AttackManager.cpp; sourceTree = ""; }; + A0AB29AD18194ECC0077AFC2 /* AttackManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttackManager.h; path = SmashBros/AttackManager.h; sourceTree = ""; }; + A0AB29AE18194ECC0077AFC2 /* AttackRandomizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttackRandomizer.cpp; path = SmashBros/AttackRandomizer.cpp; sourceTree = ""; }; + A0AB29AF18194ECC0077AFC2 /* AttackRandomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttackRandomizer.h; path = SmashBros/AttackRandomizer.h; sourceTree = ""; }; + A0AB29B018194ECC0077AFC2 /* AttackTemplates.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttackTemplates.cpp; path = SmashBros/AttackTemplates.cpp; sourceTree = ""; }; + A0AB29B118194ECC0077AFC2 /* AttackTemplates.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttackTemplates.h; path = SmashBros/AttackTemplates.h; sourceTree = ""; }; + A0AB29B218194ECC0077AFC2 /* BattlefieldBrawl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BattlefieldBrawl.cpp; path = SmashBros/BattlefieldBrawl.cpp; sourceTree = ""; }; + A0AB29B318194ECC0077AFC2 /* BattlefieldBrawl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BattlefieldBrawl.h; path = SmashBros/BattlefieldBrawl.h; sourceTree = ""; }; + A0AB29B418194ECC0077AFC2 /* BeamSword.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BeamSword.cpp; path = SmashBros/BeamSword.cpp; sourceTree = ""; }; + A0AB29B518194ECC0077AFC2 /* BeamSword.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BeamSword.h; path = SmashBros/BeamSword.h; sourceTree = ""; }; + A0AB29B618194ECC0077AFC2 /* Camera.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Camera.cpp; path = SmashBros/Camera.cpp; sourceTree = ""; }; + A0AB29B718194ECC0077AFC2 /* Camera.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Camera.h; path = SmashBros/Camera.h; sourceTree = ""; }; + A0AB29B818194ECC0077AFC2 /* CharSelectScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CharSelectScreen.cpp; path = SmashBros/CharSelectScreen.cpp; sourceTree = ""; }; + A0AB29B918194ECC0077AFC2 /* CharSelectScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CharSelectScreen.h; path = SmashBros/CharSelectScreen.h; sourceTree = ""; }; + A0AB29BA18194ECC0077AFC2 /* Chargebar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Chargebar.cpp; path = SmashBros/Chargebar.cpp; sourceTree = ""; }; + A0AB29BB18194ECC0077AFC2 /* Chargebar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Chargebar.h; path = SmashBros/Chargebar.h; sourceTree = ""; }; + A0AB29BC18194ECC0077AFC2 /* CollisionManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CollisionManager.cpp; path = SmashBros/CollisionManager.cpp; sourceTree = ""; }; + A0AB29BD18194ECC0077AFC2 /* CollisionManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CollisionManager.h; path = SmashBros/CollisionManager.h; sourceTree = ""; }; + A0AB29BE18194ECC0077AFC2 /* Controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Controls.cpp; path = SmashBros/Controls.cpp; sourceTree = ""; }; + A0AB29BF18194ECC0077AFC2 /* Controls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Controls.h; path = SmashBros/Controls.h; sourceTree = ""; }; + A0AB29C018194ECC0077AFC2 /* FinalDestinationBrawl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FinalDestinationBrawl.cpp; path = SmashBros/FinalDestinationBrawl.cpp; sourceTree = ""; }; + A0AB29C118194ECC0077AFC2 /* FinalDestinationBrawl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FinalDestinationBrawl.h; path = SmashBros/FinalDestinationBrawl.h; sourceTree = ""; }; + A0AB29C218194ECC0077AFC2 /* Fox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fox.cpp; path = SmashBros/Fox.cpp; sourceTree = ""; }; + A0AB29C318194ECC0077AFC2 /* Fox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Fox.h; path = SmashBros/Fox.h; sourceTree = ""; }; + A0AB29C418194ECC0077AFC2 /* FractalStage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FractalStage.cpp; path = SmashBros/FractalStage.cpp; sourceTree = ""; }; + A0AB29C518194ECC0077AFC2 /* FractalStage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FractalStage.h; path = SmashBros/FractalStage.h; sourceTree = ""; }; + A0AB29C618194ECC0077AFC2 /* Game.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Game.cpp; path = SmashBros/Game.cpp; sourceTree = ""; }; + A0AB29C718194ECC0077AFC2 /* Game.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Game.h; path = SmashBros/Game.h; sourceTree = ""; }; + A0AB29C818194ECC0077AFC2 /* GameElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GameElement.cpp; path = SmashBros/GameElement.cpp; sourceTree = ""; }; + A0AB29C918194ECC0077AFC2 /* GameElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameElement.h; path = SmashBros/GameElement.h; sourceTree = ""; }; + A0AB29CA18194ECC0077AFC2 /* GameScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GameScreen.cpp; path = SmashBros/GameScreen.cpp; sourceTree = ""; }; + A0AB29CB18194ECC0077AFC2 /* GameScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GameScreen.h; path = SmashBros/GameScreen.h; sourceTree = ""; }; + A0AB29CC18194ECC0077AFC2 /* Global.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Global.cpp; path = SmashBros/Global.cpp; sourceTree = ""; }; + A0AB29CD18194ECC0077AFC2 /* Global.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Global.h; path = SmashBros/Global.h; sourceTree = ""; }; + A0AB29CE18194ECC0077AFC2 /* HUD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HUD.cpp; path = SmashBros/HUD.cpp; sourceTree = ""; }; + A0AB29CF18194ECC0077AFC2 /* HUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HUD.h; path = SmashBros/HUD.h; sourceTree = ""; }; + A0AB29D018194ECC0077AFC2 /* HangPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HangPoint.cpp; path = SmashBros/HangPoint.cpp; sourceTree = ""; }; + A0AB29D118194ECC0077AFC2 /* HangPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HangPoint.h; path = SmashBros/HangPoint.h; sourceTree = ""; }; + A0AB29D218194ECC0077AFC2 /* HeartContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HeartContainer.cpp; path = SmashBros/HeartContainer.cpp; sourceTree = ""; }; + A0AB29D318194ECC0077AFC2 /* HeartContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HeartContainer.h; path = SmashBros/HeartContainer.h; sourceTree = ""; }; + A0AB29D418194ECC0077AFC2 /* HillsideBattleground.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HillsideBattleground.cpp; path = SmashBros/HillsideBattleground.cpp; sourceTree = ""; }; + A0AB29D518194ECC0077AFC2 /* HillsideBattleground.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HillsideBattleground.h; path = SmashBros/HillsideBattleground.h; sourceTree = ""; }; + A0AB29D618194ECC0077AFC2 /* HitBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HitBox.cpp; path = SmashBros/HitBox.cpp; sourceTree = ""; }; + A0AB29D718194ECC0077AFC2 /* HitBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HitBox.h; path = SmashBros/HitBox.h; sourceTree = ""; }; + A0AB29D818194ECC0077AFC2 /* HyruleTemple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HyruleTemple.cpp; path = SmashBros/HyruleTemple.cpp; sourceTree = ""; }; + A0AB29D918194ECC0077AFC2 /* HyruleTemple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HyruleTemple.h; path = SmashBros/HyruleTemple.h; sourceTree = ""; }; + A0AB29DA18194ECC0077AFC2 /* Ichigo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Ichigo.cpp; path = SmashBros/Ichigo.cpp; sourceTree = ""; }; + A0AB29DB18194ECC0077AFC2 /* Ichigo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Ichigo.h; path = SmashBros/Ichigo.h; sourceTree = ""; }; + A0AB29DC18194ECC0077AFC2 /* Item.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Item.cpp; path = SmashBros/Item.cpp; sourceTree = ""; }; + A0AB29DD18194ECC0077AFC2 /* Item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Item.h; path = SmashBros/Item.h; sourceTree = ""; }; + A0AB29DE18194ECC0077AFC2 /* ItemManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ItemManager.cpp; path = SmashBros/ItemManager.cpp; sourceTree = ""; }; + A0AB29DF18194ECC0077AFC2 /* ItemManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ItemManager.h; path = SmashBros/ItemManager.h; sourceTree = ""; }; + A0AB29E018194ECC0077AFC2 /* Mario.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mario.cpp; path = SmashBros/Mario.cpp; sourceTree = ""; }; + A0AB29E118194ECC0077AFC2 /* Mario.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mario.h; path = SmashBros/Mario.h; sourceTree = ""; }; + A0AB29E218194ECC0077AFC2 /* MenuBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuBar.cpp; path = SmashBros/MenuBar.cpp; sourceTree = ""; }; + A0AB29E318194ECC0077AFC2 /* MenuBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBar.h; path = SmashBros/MenuBar.h; sourceTree = ""; }; + A0AB29E418194ECC0077AFC2 /* MenuBarSmall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuBarSmall.cpp; path = SmashBros/MenuBarSmall.cpp; sourceTree = ""; }; + A0AB29E518194ECC0077AFC2 /* MenuBarSmall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBarSmall.h; path = SmashBros/MenuBarSmall.h; sourceTree = ""; }; + A0AB29E618194ECC0077AFC2 /* MenuBarSmallButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuBarSmallButton.cpp; path = SmashBros/MenuBarSmallButton.cpp; sourceTree = ""; }; + A0AB29E718194ECC0077AFC2 /* MenuBarSmallButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBarSmallButton.h; path = SmashBros/MenuBarSmallButton.h; sourceTree = ""; }; + A0AB29E818194ECC0077AFC2 /* MenuBarToggle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuBarToggle.cpp; path = SmashBros/MenuBarToggle.cpp; sourceTree = ""; }; + A0AB29E918194ECC0077AFC2 /* MenuBarToggle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBarToggle.h; path = SmashBros/MenuBarToggle.h; sourceTree = ""; }; + A0AB29EA18194ECC0077AFC2 /* MenuBarValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuBarValue.cpp; path = SmashBros/MenuBarValue.cpp; sourceTree = ""; }; + A0AB29EB18194ECC0077AFC2 /* MenuBarValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuBarValue.h; path = SmashBros/MenuBarValue.h; sourceTree = ""; }; + A0AB29EC18194ECC0077AFC2 /* MenuClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuClasses.cpp; path = SmashBros/MenuClasses.cpp; sourceTree = ""; }; + A0AB29ED18194ECC0077AFC2 /* MenuClasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MenuClasses.h; path = SmashBros/MenuClasses.h; sourceTree = ""; }; + A0AB29EE18194ECC0077AFC2 /* Menus.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Menus.cpp; path = SmashBros/Menus.cpp; sourceTree = ""; }; + A0AB29EF18194ECC0077AFC2 /* Menus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Menus.h; path = SmashBros/Menus.h; sourceTree = ""; }; + A0AB29F018194ECC0077AFC2 /* MusicManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MusicManager.cpp; path = SmashBros/MusicManager.cpp; sourceTree = ""; }; + A0AB29F118194ECC0077AFC2 /* MusicManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MusicManager.h; path = SmashBros/MusicManager.h; sourceTree = ""; }; + A0AB29F218194ECC0077AFC2 /* OffScreenExplode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OffScreenExplode.cpp; path = SmashBros/OffScreenExplode.cpp; sourceTree = ""; }; + A0AB29F318194ECC0077AFC2 /* OffScreenExplode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OffScreenExplode.h; path = SmashBros/OffScreenExplode.h; sourceTree = ""; }; + A0AB29F418194ECC0077AFC2 /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Platform.cpp; path = SmashBros/Platform.cpp; sourceTree = ""; }; + A0AB29F518194ECC0077AFC2 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = SmashBros/Platform.h; sourceTree = ""; }; + A0AB29F618194ECC0077AFC2 /* Player.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Player.cpp; path = SmashBros/Player.cpp; sourceTree = ""; }; + A0AB29F718194ECC0077AFC2 /* Player.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Player.h; path = SmashBros/Player.h; sourceTree = ""; }; + A0AB29F818194ECC0077AFC2 /* PoisonMushroom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PoisonMushroom.cpp; path = SmashBros/PoisonMushroom.cpp; sourceTree = ""; }; + A0AB29F918194ECC0077AFC2 /* PoisonMushroom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PoisonMushroom.h; path = SmashBros/PoisonMushroom.h; sourceTree = ""; }; + A0AB29FA18194ECC0077AFC2 /* Preferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Preferences.cpp; path = SmashBros/Preferences.cpp; sourceTree = ""; }; + A0AB29FB18194ECC0077AFC2 /* Preferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Preferences.h; path = SmashBros/Preferences.h; sourceTree = ""; }; + A0AB29FC18194ECC0077AFC2 /* Program.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Program.cpp; path = SmashBros/Program.cpp; sourceTree = ""; }; + A0AB29FD18194ECC0077AFC2 /* Projectile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Projectile.cpp; path = SmashBros/Projectile.cpp; sourceTree = ""; }; + A0AB29FE18194ECC0077AFC2 /* Projectile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Projectile.h; path = SmashBros/Projectile.h; sourceTree = ""; }; + A0AB29FF18194ECC0077AFC2 /* ProjectileManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProjectileManager.cpp; path = SmashBros/ProjectileManager.cpp; sourceTree = ""; }; + A0AB2A0018194ECC0077AFC2 /* ProjectileManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProjectileManager.h; path = SmashBros/ProjectileManager.h; sourceTree = ""; }; + A0AB2A0118194ECC0077AFC2 /* RayGun.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RayGun.cpp; path = SmashBros/RayGun.cpp; sourceTree = ""; }; + A0AB2A0218194ECC0077AFC2 /* RayGun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RayGun.h; path = SmashBros/RayGun.h; sourceTree = ""; }; + A0AB2A0318194ECC0077AFC2 /* SmashBall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SmashBall.cpp; path = SmashBros/SmashBall.cpp; sourceTree = ""; }; + A0AB2A0418194ECC0077AFC2 /* SmashBall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmashBall.h; path = SmashBros/SmashBall.h; sourceTree = ""; }; + A0AB2A0518194ECC0077AFC2 /* SmashForwards.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SmashForwards.h; path = SmashBros/SmashForwards.h; sourceTree = ""; }; + A0AB2A0618194ECC0077AFC2 /* Sonic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Sonic.cpp; path = SmashBros/Sonic.cpp; sourceTree = ""; }; + A0AB2A0718194ECC0077AFC2 /* Sonic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sonic.h; path = SmashBros/Sonic.h; sourceTree = ""; }; + A0AB2A0818194ECC0077AFC2 /* SoundManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SoundManager.cpp; path = SmashBros/SoundManager.cpp; sourceTree = ""; }; + A0AB2A0918194ECC0077AFC2 /* SoundManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SoundManager.h; path = SmashBros/SoundManager.h; sourceTree = ""; }; + A0AB2A0A18194ECC0077AFC2 /* Stage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Stage.cpp; path = SmashBros/Stage.cpp; sourceTree = ""; }; + A0AB2A0B18194ECC0077AFC2 /* Stage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stage.h; path = SmashBros/Stage.h; sourceTree = ""; }; + A0AB2A0C18194ECC0077AFC2 /* StageSelectScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StageSelectScreen.cpp; path = SmashBros/StageSelectScreen.cpp; sourceTree = ""; }; + A0AB2A0D18194ECC0077AFC2 /* StageSelectScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StageSelectScreen.h; path = SmashBros/StageSelectScreen.h; sourceTree = ""; }; + A0AB2A0E18194ECC0077AFC2 /* SuperMushroom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SuperMushroom.cpp; path = SmashBros/SuperMushroom.cpp; sourceTree = ""; }; + A0AB2A0F18194ECC0077AFC2 /* SuperMushroom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SuperMushroom.h; path = SmashBros/SuperMushroom.h; sourceTree = ""; }; + A0AB2A1018194ECC0077AFC2 /* ToggleButton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToggleButton.cpp; path = SmashBros/ToggleButton.cpp; sourceTree = ""; }; + A0AB2A1118194ECC0077AFC2 /* ToggleButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToggleButton.h; path = SmashBros/ToggleButton.h; sourceTree = ""; }; + A0AB2A1218194ECC0077AFC2 /* ToggleButtons.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToggleButtons.cpp; path = SmashBros/ToggleButtons.cpp; sourceTree = ""; }; + A0AB2A1318194ECC0077AFC2 /* ToggleButtons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ToggleButtons.h; path = SmashBros/ToggleButtons.h; sourceTree = ""; }; + A0AB2A1418194ECC0077AFC2 /* TogglePane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TogglePane.cpp; path = SmashBros/TogglePane.cpp; sourceTree = ""; }; + A0AB2A1518194ECC0077AFC2 /* TogglePane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TogglePane.h; path = SmashBros/TogglePane.h; sourceTree = ""; }; + A0AB2A1618194ECC0077AFC2 /* WinnerScreen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WinnerScreen.cpp; path = SmashBros/WinnerScreen.cpp; sourceTree = ""; }; + A0AB2A1718194ECC0077AFC2 /* WinnerScreen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WinnerScreen.h; path = SmashBros/WinnerScreen.h; sourceTree = ""; }; + A0AED98D17C2E0F70002DD96 /* begin_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = begin_code.h; path = SDL/include/begin_code.h; sourceTree = PROJECT_DIR; }; + A0AED98E17C2E0F70002DD96 /* close_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = close_code.h; path = SDL/include/close_code.h; sourceTree = PROJECT_DIR; }; + A0AED98F17C2E0F70002DD96 /* doxyfile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = doxyfile; path = SDL/include/doxyfile; sourceTree = PROJECT_DIR; }; + A0AED99017C2E0F70002DD96 /* dynamic_flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_flac.h; path = SDL/include/dynamic_flac.h; sourceTree = PROJECT_DIR; }; + A0AED99117C2E0F70002DD96 /* dynamic_fluidsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_fluidsynth.h; path = SDL/include/dynamic_fluidsynth.h; sourceTree = PROJECT_DIR; }; + A0AED99217C2E0F70002DD96 /* dynamic_mod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_mod.h; path = SDL/include/dynamic_mod.h; sourceTree = PROJECT_DIR; }; + A0AED99317C2E0F70002DD96 /* dynamic_modplug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_modplug.h; path = SDL/include/dynamic_modplug.h; sourceTree = PROJECT_DIR; }; + A0AED99417C2E0F70002DD96 /* dynamic_mp3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_mp3.h; path = SDL/include/dynamic_mp3.h; sourceTree = PROJECT_DIR; }; + A0AED99517C2E0F70002DD96 /* dynamic_ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_ogg.h; path = SDL/include/dynamic_ogg.h; sourceTree = PROJECT_DIR; }; + A0AED99617C2E0F70002DD96 /* effects_internal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = effects_internal.h; path = SDL/include/effects_internal.h; sourceTree = PROJECT_DIR; }; + A0AED99717C2E0F70002DD96 /* fluidsynth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fluidsynth.h; path = SDL/include/fluidsynth.h; sourceTree = PROJECT_DIR; }; + A0AED99817C2E0F70002DD96 /* load_aiff.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = load_aiff.h; path = SDL/include/load_aiff.h; sourceTree = PROJECT_DIR; }; + A0AED99917C2E0F70002DD96 /* load_flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = load_flac.h; path = SDL/include/load_flac.h; sourceTree = PROJECT_DIR; }; + A0AED99A17C2E0F70002DD96 /* load_ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = load_ogg.h; path = SDL/include/load_ogg.h; sourceTree = PROJECT_DIR; }; + A0AED99B17C2E0F70002DD96 /* load_voc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = load_voc.h; path = SDL/include/load_voc.h; sourceTree = PROJECT_DIR; }; + A0AED99C17C2E0F70002DD96 /* miniz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = miniz.h; path = SDL/include/miniz.h; sourceTree = PROJECT_DIR; }; + A0AED99D17C2E0F70002DD96 /* music_cmd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = music_cmd.h; path = SDL/include/music_cmd.h; sourceTree = PROJECT_DIR; }; + A0AED99E17C2E0F70002DD96 /* music_flac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = music_flac.h; path = SDL/include/music_flac.h; sourceTree = PROJECT_DIR; }; + A0AED99F17C2E0F70002DD96 /* music_mad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = music_mad.h; path = SDL/include/music_mad.h; sourceTree = PROJECT_DIR; }; + A0AED9A017C2E0F70002DD96 /* music_mod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = music_mod.h; path = SDL/include/music_mod.h; sourceTree = PROJECT_DIR; }; + A0AED9A117C2E0F70002DD96 /* music_modplug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = music_modplug.h; path = SDL/include/music_modplug.h; sourceTree = PROJECT_DIR; }; + A0AED9A217C2E0F70002DD96 /* music_ogg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = music_ogg.h; path = SDL/include/music_ogg.h; sourceTree = PROJECT_DIR; }; + A0AED9A317C2E0F70002DD96 /* SDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL.h; path = SDL/include/SDL.h; sourceTree = PROJECT_DIR; }; + A0AED9A417C2E0F70002DD96 /* SDL_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_assert.h; path = SDL/include/SDL_assert.h; sourceTree = PROJECT_DIR; }; + A0AED9A517C2E0F70002DD96 /* SDL_atomic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_atomic.h; path = SDL/include/SDL_atomic.h; sourceTree = PROJECT_DIR; }; + A0AED9A617C2E0F70002DD96 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = SDL/include/SDL_audio.h; sourceTree = PROJECT_DIR; }; + A0AED9A717C2E0F70002DD96 /* SDL_bits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_bits.h; path = SDL/include/SDL_bits.h; sourceTree = PROJECT_DIR; }; + A0AED9A817C2E0F70002DD96 /* SDL_blendmode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_blendmode.h; path = SDL/include/SDL_blendmode.h; sourceTree = PROJECT_DIR; }; + A0AED9A917C2E0F70002DD96 /* SDL_clipboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_clipboard.h; path = SDL/include/SDL_clipboard.h; sourceTree = PROJECT_DIR; }; + A0AED9AA17C2E0F70002DD96 /* SDL_config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config.h; path = SDL/include/SDL_config.h; sourceTree = PROJECT_DIR; }; + A0AED9AB17C2E0F70002DD96 /* SDL_config.h.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SDL_config.h.cmake; path = SDL/include/SDL_config.h.cmake; sourceTree = PROJECT_DIR; }; + A0AED9AC17C2E0F70002DD96 /* SDL_config.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = SDL_config.h.in; path = SDL/include/SDL_config.h.in; sourceTree = PROJECT_DIR; }; + A0AED9AD17C2E0F70002DD96 /* SDL_config_android.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_android.h; path = SDL/include/SDL_config_android.h; sourceTree = PROJECT_DIR; }; + A0AED9AE17C2E0F70002DD96 /* SDL_config_iphoneos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_iphoneos.h; path = SDL/include/SDL_config_iphoneos.h; sourceTree = PROJECT_DIR; }; + A0AED9AF17C2E0F70002DD96 /* SDL_config_macosx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_macosx.h; path = SDL/include/SDL_config_macosx.h; sourceTree = PROJECT_DIR; }; + A0AED9B017C2E0F70002DD96 /* SDL_config_minimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_minimal.h; path = SDL/include/SDL_config_minimal.h; sourceTree = PROJECT_DIR; }; + A0AED9B117C2E0F70002DD96 /* SDL_config_pandora.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_pandora.h; path = SDL/include/SDL_config_pandora.h; sourceTree = PROJECT_DIR; }; + A0AED9B217C2E0F70002DD96 /* SDL_config_psp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_psp.h; path = SDL/include/SDL_config_psp.h; sourceTree = PROJECT_DIR; }; + A0AED9B317C2E0F70002DD96 /* SDL_config_windows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_windows.h; path = SDL/include/SDL_config_windows.h; sourceTree = PROJECT_DIR; }; + A0AED9B417C2E0F70002DD96 /* SDL_config_wiz.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_config_wiz.h; path = SDL/include/SDL_config_wiz.h; sourceTree = PROJECT_DIR; }; + A0AED9B517C2E0F70002DD96 /* SDL_copying.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_copying.h; path = SDL/include/SDL_copying.h; sourceTree = PROJECT_DIR; }; + A0AED9B617C2E0F70002DD96 /* SDL_cpuinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_cpuinfo.h; path = SDL/include/SDL_cpuinfo.h; sourceTree = PROJECT_DIR; }; + A0AED9B717C2E0F70002DD96 /* SDL_endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_endian.h; path = SDL/include/SDL_endian.h; sourceTree = PROJECT_DIR; }; + A0AED9B817C2E0F70002DD96 /* SDL_error.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_error.h; path = SDL/include/SDL_error.h; sourceTree = PROJECT_DIR; }; + A0AED9B917C2E0F70002DD96 /* SDL_events.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_events.h; path = SDL/include/SDL_events.h; sourceTree = PROJECT_DIR; }; + A0AED9BA17C2E0F70002DD96 /* SDL_gamecontroller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gamecontroller.h; path = SDL/include/SDL_gamecontroller.h; sourceTree = PROJECT_DIR; }; + A0AED9BB17C2E0F70002DD96 /* SDL_gesture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_gesture.h; path = SDL/include/SDL_gesture.h; sourceTree = PROJECT_DIR; }; + A0AED9BC17C2E0F70002DD96 /* SDL_haptic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_haptic.h; path = SDL/include/SDL_haptic.h; sourceTree = PROJECT_DIR; }; + A0AED9BD17C2E0F70002DD96 /* SDL_hints.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_hints.h; path = SDL/include/SDL_hints.h; sourceTree = PROJECT_DIR; }; + A0AED9BE17C2E0F70002DD96 /* SDL_image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_image.h; path = SDL/include/SDL_image.h; sourceTree = PROJECT_DIR; }; + A0AED9BF17C2E0F70002DD96 /* SDL_joystick.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_joystick.h; path = SDL/include/SDL_joystick.h; sourceTree = PROJECT_DIR; }; + A0AED9C017C2E0F70002DD96 /* SDL_keyboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_keyboard.h; path = SDL/include/SDL_keyboard.h; sourceTree = PROJECT_DIR; }; + A0AED9C117C2E0F70002DD96 /* SDL_keycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_keycode.h; path = SDL/include/SDL_keycode.h; sourceTree = PROJECT_DIR; }; + A0AED9C217C2E0F70002DD96 /* SDL_loadso.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_loadso.h; path = SDL/include/SDL_loadso.h; sourceTree = PROJECT_DIR; }; + A0AED9C317C2E0F70002DD96 /* SDL_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_log.h; path = SDL/include/SDL_log.h; sourceTree = PROJECT_DIR; }; + A0AED9C417C2E0F70002DD96 /* SDL_main.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_main.h; path = SDL/include/SDL_main.h; sourceTree = PROJECT_DIR; }; + A0AED9C517C2E0F70002DD96 /* SDL_messagebox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_messagebox.h; path = SDL/include/SDL_messagebox.h; sourceTree = PROJECT_DIR; }; + A0AED9C617C2E0F70002DD96 /* SDL_mixer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_mixer.h; path = SDL/include/SDL_mixer.h; sourceTree = PROJECT_DIR; }; + A0AED9C717C2E0F70002DD96 /* SDL_mouse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_mouse.h; path = SDL/include/SDL_mouse.h; sourceTree = PROJECT_DIR; }; + A0AED9C817C2E0F70002DD96 /* SDL_mutex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_mutex.h; path = SDL/include/SDL_mutex.h; sourceTree = PROJECT_DIR; }; + A0AED9C917C2E0F70002DD96 /* SDL_name.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_name.h; path = SDL/include/SDL_name.h; sourceTree = PROJECT_DIR; }; + A0AED9CA17C2E0F70002DD96 /* SDL_opengl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_opengl.h; path = SDL/include/SDL_opengl.h; sourceTree = PROJECT_DIR; }; + A0AED9CB17C2E0F70002DD96 /* SDL_opengles.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_opengles.h; path = SDL/include/SDL_opengles.h; sourceTree = PROJECT_DIR; }; + A0AED9CC17C2E0F70002DD96 /* SDL_opengles2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_opengles2.h; path = SDL/include/SDL_opengles2.h; sourceTree = PROJECT_DIR; }; + A0AED9CD17C2E0F70002DD96 /* SDL_pixels.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_pixels.h; path = SDL/include/SDL_pixels.h; sourceTree = PROJECT_DIR; }; + A0AED9CE17C2E0F70002DD96 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = SDL/include/SDL_platform.h; sourceTree = PROJECT_DIR; }; + A0AED9CF17C2E0F70002DD96 /* SDL_power.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_power.h; path = SDL/include/SDL_power.h; sourceTree = PROJECT_DIR; }; + A0AED9D017C2E0F70002DD96 /* SDL_quit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_quit.h; path = SDL/include/SDL_quit.h; sourceTree = PROJECT_DIR; }; + A0AED9D117C2E0F70002DD96 /* SDL_rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_rect.h; path = SDL/include/SDL_rect.h; sourceTree = PROJECT_DIR; }; + A0AED9D217C2E0F70002DD96 /* SDL_render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_render.h; path = SDL/include/SDL_render.h; sourceTree = PROJECT_DIR; }; + A0AED9D317C2E0F70002DD96 /* SDL_revision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_revision.h; path = SDL/include/SDL_revision.h; sourceTree = PROJECT_DIR; }; + A0AED9D417C2E0F70002DD96 /* SDL_rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_rwops.h; path = SDL/include/SDL_rwops.h; sourceTree = PROJECT_DIR; }; + A0AED9D517C2E0F70002DD96 /* SDL_scancode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_scancode.h; path = SDL/include/SDL_scancode.h; sourceTree = PROJECT_DIR; }; + A0AED9D617C2E0F70002DD96 /* SDL_shape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_shape.h; path = SDL/include/SDL_shape.h; sourceTree = PROJECT_DIR; }; + A0AED9D717C2E0F70002DD96 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_stdinc.h; path = SDL/include/SDL_stdinc.h; sourceTree = PROJECT_DIR; }; + A0AED9D817C2E0F70002DD96 /* SDL_surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_surface.h; path = SDL/include/SDL_surface.h; sourceTree = PROJECT_DIR; }; + A0AED9D917C2E0F70002DD96 /* SDL_system.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_system.h; path = SDL/include/SDL_system.h; sourceTree = PROJECT_DIR; }; + A0AED9DA17C2E0F70002DD96 /* SDL_syswm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_syswm.h; path = SDL/include/SDL_syswm.h; sourceTree = PROJECT_DIR; }; + A0AED9DB17C2E0F70002DD96 /* SDL_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test.h; path = SDL/include/SDL_test.h; sourceTree = PROJECT_DIR; }; + A0AED9DC17C2E0F70002DD96 /* SDL_test_assert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_assert.h; path = SDL/include/SDL_test_assert.h; sourceTree = PROJECT_DIR; }; + A0AED9DD17C2E0F70002DD96 /* SDL_test_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_common.h; path = SDL/include/SDL_test_common.h; sourceTree = PROJECT_DIR; }; + A0AED9DE17C2E0F70002DD96 /* SDL_test_compare.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_compare.h; path = SDL/include/SDL_test_compare.h; sourceTree = PROJECT_DIR; }; + A0AED9DF17C2E0F70002DD96 /* SDL_test_crc32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_crc32.h; path = SDL/include/SDL_test_crc32.h; sourceTree = PROJECT_DIR; }; + A0AED9E017C2E0F70002DD96 /* SDL_test_font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_font.h; path = SDL/include/SDL_test_font.h; sourceTree = PROJECT_DIR; }; + A0AED9E117C2E0F70002DD96 /* SDL_test_fuzzer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_fuzzer.h; path = SDL/include/SDL_test_fuzzer.h; sourceTree = PROJECT_DIR; }; + A0AED9E217C2E0F70002DD96 /* SDL_test_harness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_harness.h; path = SDL/include/SDL_test_harness.h; sourceTree = PROJECT_DIR; }; + A0AED9E317C2E0F70002DD96 /* SDL_test_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_images.h; path = SDL/include/SDL_test_images.h; sourceTree = PROJECT_DIR; }; + A0AED9E417C2E0F70002DD96 /* SDL_test_log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_log.h; path = SDL/include/SDL_test_log.h; sourceTree = PROJECT_DIR; }; + A0AED9E517C2E0F70002DD96 /* SDL_test_md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_md5.h; path = SDL/include/SDL_test_md5.h; sourceTree = PROJECT_DIR; }; + A0AED9E617C2E0F70002DD96 /* SDL_test_random.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_test_random.h; path = SDL/include/SDL_test_random.h; sourceTree = PROJECT_DIR; }; + A0AED9E717C2E0F70002DD96 /* SDL_thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_thread.h; path = SDL/include/SDL_thread.h; sourceTree = PROJECT_DIR; }; + A0AED9E817C2E0F70002DD96 /* SDL_timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_timer.h; path = SDL/include/SDL_timer.h; sourceTree = PROJECT_DIR; }; + A0AED9E917C2E0F70002DD96 /* SDL_touch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_touch.h; path = SDL/include/SDL_touch.h; sourceTree = PROJECT_DIR; }; + A0AED9EA17C2E0F70002DD96 /* SDL_ttf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_ttf.h; path = SDL/include/SDL_ttf.h; sourceTree = PROJECT_DIR; }; + A0AED9EB17C2E0F70002DD96 /* SDL_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_types.h; path = SDL/include/SDL_types.h; sourceTree = PROJECT_DIR; }; + A0AED9EC17C2E0F70002DD96 /* SDL_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_version.h; path = SDL/include/SDL_version.h; sourceTree = PROJECT_DIR; }; + A0AED9ED17C2E0F70002DD96 /* SDL_video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_video.h; path = SDL/include/SDL_video.h; sourceTree = PROJECT_DIR; }; + A0AED9EE17C2E0F70002DD96 /* wavestream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = wavestream.h; path = SDL/include/wavestream.h; sourceTree = PROJECT_DIR; }; + A0BF9D4017D7A60000ECBEF4 /* libSDL_image.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL_image.a; sourceTree = ""; }; + A0BF9D4117D7A60000ECBEF4 /* libSDL_mixer.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL_mixer.a; sourceTree = ""; }; + A0BF9D4217D7A60000ECBEF4 /* libSDL_ttf.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL_ttf.a; sourceTree = ""; }; + A0BF9D4317D7A60000ECBEF4 /* libSDL.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libSDL.a; sourceTree = ""; }; + A0BF9FEA17DA4C2900ECBEF4 /* Fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Fonts; sourceTree = ""; }; + A0C779D8180E1C9100001642 /* SDL_p2p.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_p2p.h; sourceTree = ""; }; + A0DD33091954CE8F0000D832 /* Default-568.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568.png"; sourceTree = ""; }; + A0E58406181A8B680060C035 /* P2PDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = P2PDataManager.cpp; path = SmashBros/P2PDataManager.cpp; sourceTree = ""; }; + A0E58407181A8B680060C035 /* P2PDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = P2PDataManager.h; path = SmashBros/P2PDataManager.h; sourceTree = ""; }; + A0FB9C8E17EE153200A2EBBE /* Music */ = {isa = PBXFileReference; lastKnownFileType = folder; path = Music; sourceTree = ""; }; + FD779EDD0E26BA1200F39101 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; + FD77A07E0E26BDA900F39101 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; + FD77A0840E26BDB800F39101 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; + FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */, + 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */, + FD779EDE0E26BA1200F39101 /* CoreAudio.framework in Frameworks */, + FD77A0850E26BDB800F39101 /* AudioToolbox.framework in Frameworks */, + FDB8BFC60E5A0F6A00980157 /* CoreGraphics.framework in Frameworks */, + A0955C1717C3BA27000C9F4E /* MobileCoreServices.framework in Frameworks */, + A0955C1D17C3BAC7000C9F4E /* ImageIO.framework in Frameworks */, + A0BF9D4417D7A60000ECBEF4 /* libSDL_image.a in Frameworks */, + A0BF9D4517D7A60000ECBEF4 /* libSDL_mixer.a in Frameworks */, + A0BF9D4617D7A60000ECBEF4 /* libSDL_ttf.a in Frameworks */, + A0BF9D4717D7A60000ECBEF4 /* libSDL.a in Frameworks */, + A006580317F8C09D00B54DF7 /* MessageUI.framework in Frameworks */, + A05C8D72180780B600A30C28 /* GameKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* GameEngine.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 29B97315FDCFA39411CA2CEA /* Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + A0AED98B17C2E0F70002DD96 /* SDL */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Sources */ = { + isa = PBXGroup; + children = ( + A0AB29C718194ECC0077AFC2 /* Game.h */, + A0AB29C618194ECC0077AFC2 /* Game.cpp */, + A0AB29FC18194ECC0077AFC2 /* Program.cpp */, + A0AB292318194C060077AFC2 /* GameEngine */, + A0AB29A718194EB50077AFC2 /* SmashBros */, + ); + name = Sources; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + A0BF9FEA17DA4C2900ECBEF4 /* Fonts */, + A06365D51884C099007B789C /* Images */, + A0FB9C8E17EE153200A2EBBE /* Music */, + A088D51D17F48E9D001E85E5 /* Sounds */, + FD77A07E0E26BDA900F39101 /* Default.png */, + A0DD33091954CE8F0000D832 /* Default-568.png */, + A00132FB17DF8FB1005B6829 /* Icon.png */, + 8D1107310486CEB800E47090 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + FDB8BFC50E5A0F6A00980157 /* CoreGraphics.framework */, + FD77A0840E26BDB800F39101 /* AudioToolbox.framework */, + FD779EDD0E26BA1200F39101 /* CoreAudio.framework */, + 28FD15070DC6FC5B0079059D /* QuartzCore.framework */, + 28FD14FF0DC6FC520079059D /* OpenGLES.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + A0955C1617C3BA27000C9F4E /* MobileCoreServices.framework */, + A0955C1C17C3BAC7000C9F4E /* ImageIO.framework */, + A006580217F8C09C00B54DF7 /* MessageUI.framework */, + A05C8D71180780B600A30C28 /* GameKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + A0AB292318194C060077AFC2 /* GameEngine */ = { + isa = PBXGroup; + children = ( + A0AB296718194C220077AFC2 /* forwards.h */, + A0AB298718194C500077AFC2 /* Actor */, + A0AB298818194C560077AFC2 /* Graphics */, + A0AB299318194C6F0077AFC2 /* Input */, + A0AB299418194C750077AFC2 /* Output */, + A0AB299918194C8F0077AFC2 /* P2P */, + A0AB299A18194C970077AFC2 /* ScreenManager */, + A0AB299B18194CA30077AFC2 /* Sound */, + A0AB299C18194CAA0077AFC2 /* Util */, + A0AB299D18194CAE0077AFC2 /* ObjC */, + A0AB292B18194C220077AFC2 /* Application.h */, + A0AB292A18194C220077AFC2 /* Application.cpp */, + A0AB292D18194C220077AFC2 /* ApplicationEventListener.h */, + A0AB292C18194C220077AFC2 /* ApplicationEventListener.cpp */, + A0AB293018194C220077AFC2 /* AssetManager.h */, + A0AB292F18194C220077AFC2 /* AssetManager.cpp */, + A0AB293218194C220077AFC2 /* BatchLoader.h */, + A0AB293118194C220077AFC2 /* BatchLoader.cpp */, + A0AB293D18194C220077AFC2 /* GameEngine.h */, + A0AB293E18194C220077AFC2 /* GlobalDefs.h */, + A0AB296418194C220077AFC2 /* View.h */, + A0AB296318194C220077AFC2 /* View.cpp */, + A0AB293618194C220077AFC2 /* CPPBridge.h */, + A0AB293518194C220077AFC2 /* CPPBridge.cpp */, + A0AB294B18194C220077AFC2 /* ObjCBridge.h */, + A0AB294C18194C220077AFC2 /* ObjCBridge.mm */, + ); + name = GameEngine; + sourceTree = ""; + }; + A0AB298718194C500077AFC2 /* Actor */ = { + isa = PBXGroup; + children = ( + A0AB292518194C220077AFC2 /* Actor.h */, + A0AB292418194C220077AFC2 /* Actor.cpp */, + A0AB292718194C220077AFC2 /* Animation.h */, + A0AB292618194C220077AFC2 /* Animation.cpp */, + A0AB292918194C220077AFC2 /* AnimationManager.h */, + A0AB292818194C220077AFC2 /* AnimationManager.cpp */, + A0AB295418194C220077AFC2 /* PrimitiveActor.h */, + A0AB295318194C220077AFC2 /* PrimitiveActor.cpp */, + A0AB295E18194C220077AFC2 /* TextActor.h */, + A0AB295D18194C220077AFC2 /* TextActor.cpp */, + A0AB296618194C220077AFC2 /* WireframeActor.h */, + A0AB296518194C220077AFC2 /* WireframeActor.cpp */, + ); + name = Actor; + sourceTree = ""; + }; + A0AB298818194C560077AFC2 /* Graphics */ = { + isa = PBXGroup; + children = ( + A0AB294018194C220077AFC2 /* Graphics2D.h */, + A0AB293F18194C220077AFC2 /* Graphics2D.cpp */, + ); + name = Graphics; + sourceTree = ""; + }; + A0AB299318194C6F0077AFC2 /* Input */ = { + isa = PBXGroup; + children = ( + A0AB294418194C220077AFC2 /* Keys.h */, + A0AB294318194C220077AFC2 /* Keys.cpp */, + A0AB296118194C220077AFC2 /* TouchPoint.h */, + ); + name = Input; + sourceTree = ""; + }; + A0AB299418194C750077AFC2 /* Output */ = { + isa = PBXGroup; + children = ( + A0AB293A18194C220077AFC2 /* Console.h */, + A0AB293918194C220077AFC2 /* Console.cpp */, + ); + name = Output; + sourceTree = ""; + }; + A0AB299918194C8F0077AFC2 /* P2P */ = { + isa = PBXGroup; + children = ( + A0AB294E18194C220077AFC2 /* P2PManager.h */, + A0AB294D18194C220077AFC2 /* P2PManager.cpp */, + ); + name = P2P; + sourceTree = ""; + }; + A0AB299A18194C970077AFC2 /* ScreenManager */ = { + isa = PBXGroup; + children = ( + A0AB294818194C220077AFC2 /* MenuScreen.h */, + A0AB294718194C220077AFC2 /* MenuScreen.cpp */, + A0AB295618194C220077AFC2 /* Screen.h */, + A0AB295518194C220077AFC2 /* Screen.cpp */, + A0AB295818194C220077AFC2 /* ScreenManager.h */, + A0AB295718194C220077AFC2 /* ScreenManager.cpp */, + ); + name = ScreenManager; + sourceTree = ""; + }; + A0AB299B18194CA30077AFC2 /* Sound */ = { + isa = PBXGroup; + children = ( + A0AB294A18194C220077AFC2 /* Music.h */, + A0AB294918194C220077AFC2 /* Music.cpp */, + A0AB295A18194C220077AFC2 /* Sound.h */, + A0AB295918194C220077AFC2 /* Sound.cpp */, + ); + name = Sound; + sourceTree = ""; + }; + A0AB299C18194CAA0077AFC2 /* Util */ = { + isa = PBXGroup; + children = ( + A0AB292E18194C220077AFC2 /* ArrayList.h */, + A02A428E183962EB0088CF1E /* Bitset.h */, + A02A428D183962EB0088CF1E /* Bitset.cpp */, + A0AB293418194C220077AFC2 /* BufferedImage.h */, + A0AB293318194C220077AFC2 /* BufferedImage.cpp */, + A0AB293818194C220077AFC2 /* Color.h */, + A0AB293718194C220077AFC2 /* Color.cpp */, + A0AB293C18194C220077AFC2 /* Font.h */, + A0AB293B18194C220077AFC2 /* Font.cpp */, + A0AB294218194C220077AFC2 /* Image.h */, + A0AB294118194C220077AFC2 /* Image.cpp */, + A0AB295018194C220077AFC2 /* PixelIterator.h */, + A0AB294F18194C220077AFC2 /* PixelIterator.cpp */, + A0AB295218194C220077AFC2 /* PrefManager.h */, + A0AB295118194C220077AFC2 /* PrefManager.cpp */, + A0AB295C18194C220077AFC2 /* String.h */, + A0AB295B18194C220077AFC2 /* String.cpp */, + A0AB296018194C220077AFC2 /* Thread.h */, + A0AB295F18194C220077AFC2 /* Thread.cpp */, + A0AB296218194C220077AFC2 /* Vector2.h */, + ); + name = Util; + sourceTree = ""; + }; + A0AB299D18194CAE0077AFC2 /* ObjC */ = { + isa = PBXGroup; + children = ( + A0AB294518194C220077AFC2 /* MailViewController.h */, + A0AB294618194C220077AFC2 /* MailViewController.mm */, + A08A15B4188EC4220028A41E /* MessageBoxDelegate.h */, + A08A15B5188EC4220028A41E /* MessageBoxDelegate.mm */, + ); + name = ObjC; + sourceTree = ""; + }; + A0AB29A718194EB50077AFC2 /* SmashBros */ = { + isa = PBXGroup; + children = ( + A0AB2A0518194ECC0077AFC2 /* SmashForwards.h */, + A0AB2A5118194F3E0077AFC2 /* Game */, + A0AB2A5018194F370077AFC2 /* Menus */, + A0AB29AD18194ECC0077AFC2 /* AttackManager.h */, + A0AB29AC18194ECC0077AFC2 /* AttackManager.cpp */, + A0AB29AF18194ECC0077AFC2 /* AttackRandomizer.h */, + A0AB29AE18194ECC0077AFC2 /* AttackRandomizer.cpp */, + A0AB29B118194ECC0077AFC2 /* AttackTemplates.h */, + A0AB29B018194ECC0077AFC2 /* AttackTemplates.cpp */, + A0AB29B718194ECC0077AFC2 /* Camera.h */, + A0AB29B618194ECC0077AFC2 /* Camera.cpp */, + A0AB29BB18194ECC0077AFC2 /* Chargebar.h */, + A0AB29BA18194ECC0077AFC2 /* Chargebar.cpp */, + A0AB29BD18194ECC0077AFC2 /* CollisionManager.h */, + A0AB29BC18194ECC0077AFC2 /* CollisionManager.cpp */, + A0AB29BF18194ECC0077AFC2 /* Controls.h */, + A0AB29BE18194ECC0077AFC2 /* Controls.cpp */, + A0AB29C918194ECC0077AFC2 /* GameElement.h */, + A0AB29C818194ECC0077AFC2 /* GameElement.cpp */, + A0AB29CD18194ECC0077AFC2 /* Global.h */, + A0AB29CC18194ECC0077AFC2 /* Global.cpp */, + A0AB29CF18194ECC0077AFC2 /* HUD.h */, + A0AB29CE18194ECC0077AFC2 /* HUD.cpp */, + A0AB29D718194ECC0077AFC2 /* HitBox.h */, + A0AB29D618194ECC0077AFC2 /* HitBox.cpp */, + A0AB29DD18194ECC0077AFC2 /* Item.h */, + A0AB29DC18194ECC0077AFC2 /* Item.cpp */, + A0AB29DF18194ECC0077AFC2 /* ItemManager.h */, + A0AB29DE18194ECC0077AFC2 /* ItemManager.cpp */, + A0AB29F118194ECC0077AFC2 /* MusicManager.h */, + A0AB29F018194ECC0077AFC2 /* MusicManager.cpp */, + A0E58407181A8B680060C035 /* P2PDataManager.h */, + A0E58406181A8B680060C035 /* P2PDataManager.cpp */, + A0AB29F718194ECC0077AFC2 /* Player.h */, + A0AB29F618194ECC0077AFC2 /* Player.cpp */, + A0AB29FB18194ECC0077AFC2 /* Preferences.h */, + A0AB29FA18194ECC0077AFC2 /* Preferences.cpp */, + A0AB29FE18194ECC0077AFC2 /* Projectile.h */, + A0AB29FD18194ECC0077AFC2 /* Projectile.cpp */, + A0AB2A0018194ECC0077AFC2 /* ProjectileManager.h */, + A0AB29FF18194ECC0077AFC2 /* ProjectileManager.cpp */, + A0AB2A0918194ECC0077AFC2 /* SoundManager.h */, + A0AB2A0818194ECC0077AFC2 /* SoundManager.cpp */, + A0AB2A0B18194ECC0077AFC2 /* Stage.h */, + A0AB2A0A18194ECC0077AFC2 /* Stage.cpp */, + ); + name = SmashBros; + sourceTree = ""; + }; + A0AB2A5018194F370077AFC2 /* Menus */ = { + isa = PBXGroup; + children = ( + A0AB2A5218194F4B0077AFC2 /* MenuPieces */, + A0AB29B918194ECC0077AFC2 /* CharSelectScreen.h */, + A0AB29B818194ECC0077AFC2 /* CharSelectScreen.cpp */, + A0AB29EF18194ECC0077AFC2 /* Menus.h */, + A0AB29EE18194ECC0077AFC2 /* Menus.cpp */, + A0AB29ED18194ECC0077AFC2 /* MenuClasses.h */, + A0AB29EC18194ECC0077AFC2 /* MenuClasses.cpp */, + A0AB2A0D18194ECC0077AFC2 /* StageSelectScreen.h */, + A0AB2A0C18194ECC0077AFC2 /* StageSelectScreen.cpp */, + ); + name = Menus; + sourceTree = ""; + }; + A0AB2A5118194F3E0077AFC2 /* Game */ = { + isa = PBXGroup; + children = ( + A0AB2A5518194FB20077AFC2 /* Characters */, + A0AB2A5418194FAC0077AFC2 /* Items */, + A0AB2A5318194FA70077AFC2 /* Stages */, + A0AB29CB18194ECC0077AFC2 /* GameScreen.h */, + A0AB29CA18194ECC0077AFC2 /* GameScreen.cpp */, + A0AB2A1718194ECC0077AFC2 /* WinnerScreen.h */, + A0AB2A1618194ECC0077AFC2 /* WinnerScreen.cpp */, + ); + name = Game; + sourceTree = ""; + }; + A0AB2A5218194F4B0077AFC2 /* MenuPieces */ = { + isa = PBXGroup; + children = ( + A0AB29A918194ECC0077AFC2 /* ActorGrid.h */, + A0AB29A818194ECC0077AFC2 /* ActorGrid.cpp */, + A0AB29AB18194ECC0077AFC2 /* Arrows.h */, + A0AB29AA18194ECC0077AFC2 /* Arrows.cpp */, + A0AB29E318194ECC0077AFC2 /* MenuBar.h */, + A0AB29E218194ECC0077AFC2 /* MenuBar.cpp */, + A0AB29E518194ECC0077AFC2 /* MenuBarSmall.h */, + A0AB29E418194ECC0077AFC2 /* MenuBarSmall.cpp */, + A0AB29E718194ECC0077AFC2 /* MenuBarSmallButton.h */, + A0AB29E618194ECC0077AFC2 /* MenuBarSmallButton.cpp */, + A0AB29E918194ECC0077AFC2 /* MenuBarToggle.h */, + A0AB29E818194ECC0077AFC2 /* MenuBarToggle.cpp */, + A0AB29EB18194ECC0077AFC2 /* MenuBarValue.h */, + A0AB29EA18194ECC0077AFC2 /* MenuBarValue.cpp */, + A0AB2A1118194ECC0077AFC2 /* ToggleButton.h */, + A0AB2A1018194ECC0077AFC2 /* ToggleButton.cpp */, + A0AB2A1318194ECC0077AFC2 /* ToggleButtons.h */, + A0AB2A1218194ECC0077AFC2 /* ToggleButtons.cpp */, + A0AB2A1518194ECC0077AFC2 /* TogglePane.h */, + A0AB2A1418194ECC0077AFC2 /* TogglePane.cpp */, + ); + name = MenuPieces; + sourceTree = ""; + }; + A0AB2A5318194FA70077AFC2 /* Stages */ = { + isa = PBXGroup; + children = ( + A0AB2A5618194FDC0077AFC2 /* StagePieces */, + A0AB29B318194ECC0077AFC2 /* BattlefieldBrawl.h */, + A0AB29B218194ECC0077AFC2 /* BattlefieldBrawl.cpp */, + A0AB29C118194ECC0077AFC2 /* FinalDestinationBrawl.h */, + A0AB29C018194ECC0077AFC2 /* FinalDestinationBrawl.cpp */, + A0AB29C518194ECC0077AFC2 /* FractalStage.h */, + A0AB29C418194ECC0077AFC2 /* FractalStage.cpp */, + A0AB29D518194ECC0077AFC2 /* HillsideBattleground.h */, + A0AB29D418194ECC0077AFC2 /* HillsideBattleground.cpp */, + A0AB29D918194ECC0077AFC2 /* HyruleTemple.h */, + A0AB29D818194ECC0077AFC2 /* HyruleTemple.cpp */, + ); + name = Stages; + sourceTree = ""; + }; + A0AB2A5418194FAC0077AFC2 /* Items */ = { + isa = PBXGroup; + children = ( + A0AB29B518194ECC0077AFC2 /* BeamSword.h */, + A0AB29B418194ECC0077AFC2 /* BeamSword.cpp */, + A0AB29D318194ECC0077AFC2 /* HeartContainer.h */, + A0AB29D218194ECC0077AFC2 /* HeartContainer.cpp */, + A0AB29F918194ECC0077AFC2 /* PoisonMushroom.h */, + A0AB29F818194ECC0077AFC2 /* PoisonMushroom.cpp */, + A0AB2A0218194ECC0077AFC2 /* RayGun.h */, + A0AB2A0118194ECC0077AFC2 /* RayGun.cpp */, + A0AB2A0418194ECC0077AFC2 /* SmashBall.h */, + A0AB2A0318194ECC0077AFC2 /* SmashBall.cpp */, + A0AB2A0F18194ECC0077AFC2 /* SuperMushroom.h */, + A0AB2A0E18194ECC0077AFC2 /* SuperMushroom.cpp */, + ); + name = Items; + sourceTree = ""; + }; + A0AB2A5518194FB20077AFC2 /* Characters */ = { + isa = PBXGroup; + children = ( + A0AB29C318194ECC0077AFC2 /* Fox.h */, + A0AB29C218194ECC0077AFC2 /* Fox.cpp */, + A0AB29DB18194ECC0077AFC2 /* Ichigo.h */, + A0AB29DA18194ECC0077AFC2 /* Ichigo.cpp */, + A0AB29E118194ECC0077AFC2 /* Mario.h */, + A0AB29E018194ECC0077AFC2 /* Mario.cpp */, + A0AB2A0718194ECC0077AFC2 /* Sonic.h */, + A0AB2A0618194ECC0077AFC2 /* Sonic.cpp */, + ); + name = Characters; + sourceTree = ""; + }; + A0AB2A5618194FDC0077AFC2 /* StagePieces */ = { + isa = PBXGroup; + children = ( + A0AB29D118194ECC0077AFC2 /* HangPoint.h */, + A0AB29D018194ECC0077AFC2 /* HangPoint.cpp */, + A0AB29F318194ECC0077AFC2 /* OffScreenExplode.h */, + A0AB29F218194ECC0077AFC2 /* OffScreenExplode.cpp */, + A0AB29F518194ECC0077AFC2 /* Platform.h */, + A0AB29F418194ECC0077AFC2 /* Platform.cpp */, + ); + name = StagePieces; + sourceTree = ""; + }; + A0AED98B17C2E0F70002DD96 /* SDL */ = { + isa = PBXGroup; + children = ( + A0AED98C17C2E0F70002DD96 /* include */, + A0AED9EF17C2E0F70002DD96 /* lib */, + ); + path = SDL; + sourceTree = PROJECT_DIR; + }; + A0AED98C17C2E0F70002DD96 /* include */ = { + isa = PBXGroup; + children = ( + A0AED98D17C2E0F70002DD96 /* begin_code.h */, + A0AED98E17C2E0F70002DD96 /* close_code.h */, + A0AED98F17C2E0F70002DD96 /* doxyfile */, + A0AED99017C2E0F70002DD96 /* dynamic_flac.h */, + A0AED99117C2E0F70002DD96 /* dynamic_fluidsynth.h */, + A0AED99217C2E0F70002DD96 /* dynamic_mod.h */, + A0AED99317C2E0F70002DD96 /* dynamic_modplug.h */, + A0AED99417C2E0F70002DD96 /* dynamic_mp3.h */, + A0AED99517C2E0F70002DD96 /* dynamic_ogg.h */, + A0AED99617C2E0F70002DD96 /* effects_internal.h */, + A0AED99717C2E0F70002DD96 /* fluidsynth.h */, + A0AED99817C2E0F70002DD96 /* load_aiff.h */, + A0AED99917C2E0F70002DD96 /* load_flac.h */, + A0AED99A17C2E0F70002DD96 /* load_ogg.h */, + A0AED99B17C2E0F70002DD96 /* load_voc.h */, + A0AED99C17C2E0F70002DD96 /* miniz.h */, + A0AED99D17C2E0F70002DD96 /* music_cmd.h */, + A0AED99E17C2E0F70002DD96 /* music_flac.h */, + A0AED99F17C2E0F70002DD96 /* music_mad.h */, + A0AED9A017C2E0F70002DD96 /* music_mod.h */, + A0AED9A117C2E0F70002DD96 /* music_modplug.h */, + A0AED9A217C2E0F70002DD96 /* music_ogg.h */, + A0AED9A317C2E0F70002DD96 /* SDL.h */, + A0AED9A417C2E0F70002DD96 /* SDL_assert.h */, + A0AED9A517C2E0F70002DD96 /* SDL_atomic.h */, + A0AED9A617C2E0F70002DD96 /* SDL_audio.h */, + A0AED9A717C2E0F70002DD96 /* SDL_bits.h */, + A0AED9A817C2E0F70002DD96 /* SDL_blendmode.h */, + A0AED9A917C2E0F70002DD96 /* SDL_clipboard.h */, + A0AED9AA17C2E0F70002DD96 /* SDL_config.h */, + A0AED9AB17C2E0F70002DD96 /* SDL_config.h.cmake */, + A0AED9AC17C2E0F70002DD96 /* SDL_config.h.in */, + A0AED9AD17C2E0F70002DD96 /* SDL_config_android.h */, + A0AED9AE17C2E0F70002DD96 /* SDL_config_iphoneos.h */, + A0AED9AF17C2E0F70002DD96 /* SDL_config_macosx.h */, + A0AED9B017C2E0F70002DD96 /* SDL_config_minimal.h */, + A0AED9B117C2E0F70002DD96 /* SDL_config_pandora.h */, + A0AED9B217C2E0F70002DD96 /* SDL_config_psp.h */, + A0AED9B317C2E0F70002DD96 /* SDL_config_windows.h */, + A0AED9B417C2E0F70002DD96 /* SDL_config_wiz.h */, + A0AED9B517C2E0F70002DD96 /* SDL_copying.h */, + A0AED9B617C2E0F70002DD96 /* SDL_cpuinfo.h */, + A0AED9B717C2E0F70002DD96 /* SDL_endian.h */, + A0AED9B817C2E0F70002DD96 /* SDL_error.h */, + A0AED9B917C2E0F70002DD96 /* SDL_events.h */, + A0AED9BA17C2E0F70002DD96 /* SDL_gamecontroller.h */, + A0AED9BB17C2E0F70002DD96 /* SDL_gesture.h */, + A0AED9BC17C2E0F70002DD96 /* SDL_haptic.h */, + A0AED9BD17C2E0F70002DD96 /* SDL_hints.h */, + A0AED9BE17C2E0F70002DD96 /* SDL_image.h */, + A0AED9BF17C2E0F70002DD96 /* SDL_joystick.h */, + A0AED9C017C2E0F70002DD96 /* SDL_keyboard.h */, + A0AED9C117C2E0F70002DD96 /* SDL_keycode.h */, + A0AED9C217C2E0F70002DD96 /* SDL_loadso.h */, + A0AED9C317C2E0F70002DD96 /* SDL_log.h */, + A0AED9C417C2E0F70002DD96 /* SDL_main.h */, + A0AED9C517C2E0F70002DD96 /* SDL_messagebox.h */, + A0AED9C617C2E0F70002DD96 /* SDL_mixer.h */, + A0AED9C717C2E0F70002DD96 /* SDL_mouse.h */, + A0AED9C817C2E0F70002DD96 /* SDL_mutex.h */, + A0AED9C917C2E0F70002DD96 /* SDL_name.h */, + A0AED9CA17C2E0F70002DD96 /* SDL_opengl.h */, + A0AED9CB17C2E0F70002DD96 /* SDL_opengles.h */, + A0AED9CC17C2E0F70002DD96 /* SDL_opengles2.h */, + A0C779D8180E1C9100001642 /* SDL_p2p.h */, + A0AED9CD17C2E0F70002DD96 /* SDL_pixels.h */, + A0AED9CE17C2E0F70002DD96 /* SDL_platform.h */, + A0AED9CF17C2E0F70002DD96 /* SDL_power.h */, + A0AED9D017C2E0F70002DD96 /* SDL_quit.h */, + A0AED9D117C2E0F70002DD96 /* SDL_rect.h */, + A0AED9D217C2E0F70002DD96 /* SDL_render.h */, + A0AED9D317C2E0F70002DD96 /* SDL_revision.h */, + A0AED9D417C2E0F70002DD96 /* SDL_rwops.h */, + A0AED9D517C2E0F70002DD96 /* SDL_scancode.h */, + A0AED9D617C2E0F70002DD96 /* SDL_shape.h */, + A0AED9D717C2E0F70002DD96 /* SDL_stdinc.h */, + A0AED9D817C2E0F70002DD96 /* SDL_surface.h */, + A0AED9D917C2E0F70002DD96 /* SDL_system.h */, + A0AED9DA17C2E0F70002DD96 /* SDL_syswm.h */, + A0AED9DB17C2E0F70002DD96 /* SDL_test.h */, + A0AED9DC17C2E0F70002DD96 /* SDL_test_assert.h */, + A0AED9DD17C2E0F70002DD96 /* SDL_test_common.h */, + A0AED9DE17C2E0F70002DD96 /* SDL_test_compare.h */, + A0AED9DF17C2E0F70002DD96 /* SDL_test_crc32.h */, + A0AED9E017C2E0F70002DD96 /* SDL_test_font.h */, + A0AED9E117C2E0F70002DD96 /* SDL_test_fuzzer.h */, + A0AED9E217C2E0F70002DD96 /* SDL_test_harness.h */, + A0AED9E317C2E0F70002DD96 /* SDL_test_images.h */, + A0AED9E417C2E0F70002DD96 /* SDL_test_log.h */, + A0AED9E517C2E0F70002DD96 /* SDL_test_md5.h */, + A0AED9E617C2E0F70002DD96 /* SDL_test_random.h */, + A0AED9E717C2E0F70002DD96 /* SDL_thread.h */, + A0AED9E817C2E0F70002DD96 /* SDL_timer.h */, + A0AED9E917C2E0F70002DD96 /* SDL_touch.h */, + A0AED9EA17C2E0F70002DD96 /* SDL_ttf.h */, + A0AED9EB17C2E0F70002DD96 /* SDL_types.h */, + A0AED9EC17C2E0F70002DD96 /* SDL_version.h */, + A0AED9ED17C2E0F70002DD96 /* SDL_video.h */, + A0AED9EE17C2E0F70002DD96 /* wavestream.h */, + ); + name = include; + path = SDL/include; + sourceTree = PROJECT_DIR; + }; + A0AED9EF17C2E0F70002DD96 /* lib */ = { + isa = PBXGroup; + children = ( + A0BF9D4017D7A60000ECBEF4 /* libSDL_image.a */, + A0BF9D4117D7A60000ECBEF4 /* libSDL_mixer.a */, + A0BF9D4217D7A60000ECBEF4 /* libSDL_ttf.a */, + A0BF9D4317D7A60000ECBEF4 /* libSDL.a */, + ); + name = lib; + path = SDL/lib; + sourceTree = PROJECT_DIR; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* GameEngine */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "GameEngine" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = GameEngine; + productName = GameEngine; + productReference = 1D6058910D05DD3D006BFB54 /* GameEngine.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + attributes = { + ORGANIZATIONNAME = BrokenPhysics; + }; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SmashBros" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* GameEngine */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FD77A07F0E26BDA900F39101 /* Default.png in Resources */, + A0AED9F417C2E0F70002DD96 /* doxyfile in Resources */, + A0AED9F517C2E0F70002DD96 /* SDL_config.h.cmake in Resources */, + A0AED9F617C2E0F70002DD96 /* SDL_config.h.in in Resources */, + A0BF9FEE17DA4C2900ECBEF4 /* Fonts in Resources */, + A00132FC17DF8FB1005B6829 /* Icon.png in Resources */, + A0FB9C9B17EE153200A2EBBE /* Music in Resources */, + A088D52517F48E9D001E85E5 /* Sounds in Resources */, + A06367E91884C099007B789C /* Images in Resources */, + A0DD330A1954CE8F0000D832 /* Default-568.png in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A0AB296818194C220077AFC2 /* Actor.cpp in Sources */, + A0AB296918194C220077AFC2 /* Animation.cpp in Sources */, + A0AB296A18194C220077AFC2 /* AnimationManager.cpp in Sources */, + A0AB296B18194C220077AFC2 /* Application.cpp in Sources */, + A0AB296C18194C220077AFC2 /* ApplicationEventListener.cpp in Sources */, + A0AB296D18194C220077AFC2 /* AssetManager.cpp in Sources */, + A0AB296E18194C220077AFC2 /* BatchLoader.cpp in Sources */, + A0AB296F18194C220077AFC2 /* BufferedImage.cpp in Sources */, + A0AB297018194C220077AFC2 /* CPPBridge.cpp in Sources */, + A0AB297118194C220077AFC2 /* Color.cpp in Sources */, + A0AB297218194C220077AFC2 /* Console.cpp in Sources */, + A0AB297318194C220077AFC2 /* Font.cpp in Sources */, + A0AB297418194C220077AFC2 /* Graphics2D.cpp in Sources */, + A0AB297518194C220077AFC2 /* Image.cpp in Sources */, + A0AB297618194C220077AFC2 /* Keys.cpp in Sources */, + A0AB297718194C220077AFC2 /* MailViewController.mm in Sources */, + A0AB297818194C220077AFC2 /* MenuScreen.cpp in Sources */, + A0AB297918194C220077AFC2 /* Music.cpp in Sources */, + A0AB297A18194C220077AFC2 /* ObjCBridge.mm in Sources */, + A0AB297B18194C220077AFC2 /* P2PManager.cpp in Sources */, + A0AB297C18194C220077AFC2 /* PixelIterator.cpp in Sources */, + A0AB297D18194C220077AFC2 /* PrefManager.cpp in Sources */, + A0AB297E18194C220077AFC2 /* PrimitiveActor.cpp in Sources */, + A0AB297F18194C220077AFC2 /* Screen.cpp in Sources */, + A0AB298018194C220077AFC2 /* ScreenManager.cpp in Sources */, + A0AB298118194C220077AFC2 /* Sound.cpp in Sources */, + A0AB298218194C220077AFC2 /* String.cpp in Sources */, + A0AB298318194C220077AFC2 /* TextActor.cpp in Sources */, + A0AB298418194C220077AFC2 /* Thread.cpp in Sources */, + A0AB298518194C220077AFC2 /* View.cpp in Sources */, + A0AB298618194C220077AFC2 /* WireframeActor.cpp in Sources */, + A0AB2A1818194ECC0077AFC2 /* ActorGrid.cpp in Sources */, + A0AB2A1918194ECC0077AFC2 /* Arrows.cpp in Sources */, + A0AB2A1A18194ECC0077AFC2 /* AttackManager.cpp in Sources */, + A0AB2A1B18194ECC0077AFC2 /* AttackRandomizer.cpp in Sources */, + A0AB2A1C18194ECC0077AFC2 /* AttackTemplates.cpp in Sources */, + A0AB2A1D18194ECC0077AFC2 /* BattlefieldBrawl.cpp in Sources */, + A0AB2A1E18194ECC0077AFC2 /* BeamSword.cpp in Sources */, + A0AB2A1F18194ECC0077AFC2 /* Camera.cpp in Sources */, + A0AB2A2018194ECC0077AFC2 /* CharSelectScreen.cpp in Sources */, + A0AB2A2118194ECC0077AFC2 /* Chargebar.cpp in Sources */, + A0AB2A2218194ECC0077AFC2 /* CollisionManager.cpp in Sources */, + A0AB2A2318194ECC0077AFC2 /* Controls.cpp in Sources */, + A0AB2A2418194ECC0077AFC2 /* FinalDestinationBrawl.cpp in Sources */, + A0AB2A2518194ECC0077AFC2 /* Fox.cpp in Sources */, + A0AB2A2618194ECC0077AFC2 /* FractalStage.cpp in Sources */, + A0AB2A2718194ECC0077AFC2 /* Game.cpp in Sources */, + A0AB2A2818194ECC0077AFC2 /* GameElement.cpp in Sources */, + A0AB2A2918194ECC0077AFC2 /* GameScreen.cpp in Sources */, + A0AB2A2A18194ECC0077AFC2 /* Global.cpp in Sources */, + A0AB2A2B18194ECC0077AFC2 /* HUD.cpp in Sources */, + A0AB2A2C18194ECC0077AFC2 /* HangPoint.cpp in Sources */, + A0AB2A2D18194ECC0077AFC2 /* HeartContainer.cpp in Sources */, + A0AB2A2E18194ECC0077AFC2 /* HillsideBattleground.cpp in Sources */, + A0AB2A2F18194ECC0077AFC2 /* HitBox.cpp in Sources */, + A0AB2A3018194ECC0077AFC2 /* HyruleTemple.cpp in Sources */, + A0AB2A3118194ECC0077AFC2 /* Ichigo.cpp in Sources */, + A0AB2A3218194ECC0077AFC2 /* Item.cpp in Sources */, + A0AB2A3318194ECC0077AFC2 /* ItemManager.cpp in Sources */, + A0AB2A3418194ECC0077AFC2 /* Mario.cpp in Sources */, + A0AB2A3518194ECC0077AFC2 /* MenuBar.cpp in Sources */, + A0AB2A3618194ECC0077AFC2 /* MenuBarSmall.cpp in Sources */, + A0AB2A3718194ECC0077AFC2 /* MenuBarSmallButton.cpp in Sources */, + A0AB2A3818194ECC0077AFC2 /* MenuBarToggle.cpp in Sources */, + A0AB2A3918194ECC0077AFC2 /* MenuBarValue.cpp in Sources */, + A0AB2A3A18194ECC0077AFC2 /* MenuClasses.cpp in Sources */, + A0AB2A3B18194ECC0077AFC2 /* Menus.cpp in Sources */, + A0AB2A3C18194ECC0077AFC2 /* MusicManager.cpp in Sources */, + A0AB2A3D18194ECC0077AFC2 /* OffScreenExplode.cpp in Sources */, + A0AB2A3E18194ECC0077AFC2 /* Platform.cpp in Sources */, + A0AB2A3F18194ECC0077AFC2 /* Player.cpp in Sources */, + A0AB2A4018194ECC0077AFC2 /* PoisonMushroom.cpp in Sources */, + A0AB2A4118194ECC0077AFC2 /* Preferences.cpp in Sources */, + A0AB2A4218194ECC0077AFC2 /* Program.cpp in Sources */, + A0AB2A4318194ECC0077AFC2 /* Projectile.cpp in Sources */, + A0AB2A4418194ECC0077AFC2 /* ProjectileManager.cpp in Sources */, + A0AB2A4518194ECC0077AFC2 /* RayGun.cpp in Sources */, + A0AB2A4618194ECC0077AFC2 /* SmashBall.cpp in Sources */, + A0AB2A4718194ECC0077AFC2 /* Sonic.cpp in Sources */, + A0AB2A4818194ECC0077AFC2 /* SoundManager.cpp in Sources */, + A0AB2A4918194ECC0077AFC2 /* Stage.cpp in Sources */, + A0AB2A4A18194ECC0077AFC2 /* StageSelectScreen.cpp in Sources */, + A0AB2A4B18194ECC0077AFC2 /* SuperMushroom.cpp in Sources */, + A0AB2A4C18194ECC0077AFC2 /* ToggleButton.cpp in Sources */, + A0AB2A4D18194ECC0077AFC2 /* ToggleButtons.cpp in Sources */, + A0AB2A4E18194ECC0077AFC2 /* TogglePane.cpp in Sources */, + A0AB2A4F18194ECC0077AFC2 /* WinnerScreen.cpp in Sources */, + A0E58408181A8B680060C035 /* P2PDataManager.cpp in Sources */, + A02A428F183962EB0088CF1E /* Bitset.cpp in Sources */, + A08A15B6188EC4220028A41E /* MessageBoxDelegate.mm in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + HEADER_SEARCH_PATHS = "\"\"$(SRCROOT)/SDL/include\""; + INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/SDL/lib\"", + ); + PRODUCT_NAME = GameEngine; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ""; + HEADER_SEARCH_PATHS = "\"\"$(SRCROOT)/SDL/include\""; + INFOPLIST_FILE = Info.plist; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$(SRCROOT)/SDL/lib\"", + ); + PRODUCT_NAME = GameEngine; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_OBJC_GC = supported; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ""; + PREBINDING = NO; + SDKROOT = iphoneos4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_ENABLE_OBJC_GC = supported; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + OTHER_CFLAGS = ""; + PREBINDING = NO; + SDKROOT = iphoneos4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "GameEngine" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "SmashBros" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/SmashBros/ActorGrid.cpp b/SmashBros/ActorGrid.cpp new file mode 100755 index 0000000..c0e57f3 --- /dev/null +++ b/SmashBros/ActorGrid.cpp @@ -0,0 +1,147 @@ +#include "ActorGrid.h" + +namespace SmashBros +{ + ActorGrid::ActorGrid(float x1, float y1, int rows, int cols) + { + currentIndex = 0; + hoveredIndex = -1; + selectedIndex = -1; + Scale = 1; + changeScales = false; + xSpace = 5; + ySpace = 5; + + this->rows = rows; + this->cols = cols; + this->x = x1; + this->y = y1; + } + + ActorGrid::~ActorGrid() + { + for(int i=0; iUpdate(gameTime); + if(a->mouseOver()) + { + hoveredIndex = i; + if(a->isClicked()) + { + selectedIndex = i; + } + } + } + } + } + + void ActorGrid::Draw(Graphics2D&g, long gameTime) + { + for(int i=0; iDraw(g, gameTime); + } + } + } + + void ActorGrid::setScale(float scale) + { + Scale = scale; + changeScales = true; + for(int i=0; iScale = scale; + } + } + + float ActorGrid::getScale() + { + return Scale; + } + + int ActorGrid::getSelectedIndex() + { + return selectedIndex; + } + + int ActorGrid::getHoveredIndex() + { + return hoveredIndex; + } + + int ActorGrid::size() + { + return currentIndex; + } + + void ActorGrid::setSpacing(float x, float y) + { + xSpace = x; + ySpace = y; + } + + void ActorGrid::add(Actor*a) + { + currentIndex++; + if(a!=null) + { + if(changeScales && a->Scale==1) + { + a->Scale = this->Scale; + } + addToGrid(a,x,y,cols,rows,xSpace,ySpace,currentIndex); + } + actors.add(a); + } + + Actor*ActorGrid::get(int index) + { + return actors.get(index); + } + + Actor*ActorGrid::get(int row, int col) + { + int index = (cols*row)+col; + Actor*a = get(index); + return a; + } + + void ActorGrid::addToGrid(Actor*a,float x1,float y1,int xAmount,int yAmount,float xspace,float yspace,int num) + { + int xLoc; + int yLoc; + float xCreate; + float yCreate; + if(num>xAmount) + { + xLoc = ((num-1)%xAmount)+1; + yLoc = ((num-1)/xAmount)+1; + } + else + { + xLoc=num; + yLoc=1; + } + xCreate=x1+(xspace*(xLoc-1)); + yCreate=y1+(yspace*(yLoc-1)); + a->x=xCreate; + a->y=yCreate; + } +} \ No newline at end of file diff --git a/SmashBros/ActorGrid.h b/SmashBros/ActorGrid.h new file mode 100755 index 0000000..b6781fe --- /dev/null +++ b/SmashBros/ActorGrid.h @@ -0,0 +1,44 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class ActorGrid + { + private: + ArrayList actors; + + int currentIndex; + int hoveredIndex; + int selectedIndex; + + float Scale; + boolean changeScales; + + float xSpace; + float ySpace; + int rows,cols; + + void addToGrid(Actor*a,float x1,float y1,int xAmount,int yAmount,float xspace,float yspace,int num); + + public: + float x,y; + + ActorGrid(float x1, float y1, int rows, int cols); + virtual ~ActorGrid(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + void setScale(float scale); + float getScale(); + int getSelectedIndex(); + int getHoveredIndex(); + int size(); + void setSpacing(float x, float y); + void add(Actor*a); + Actor*get(int index); + Actor*get(int row, int col); + }; +} \ No newline at end of file diff --git a/SmashBros/Arrows.cpp b/SmashBros/Arrows.cpp new file mode 100755 index 0000000..57b63bb --- /dev/null +++ b/SmashBros/Arrows.cpp @@ -0,0 +1,140 @@ +#include "Arrows.h" + +namespace SmashBros +{ + Arrows::UpArrow::UpArrow(Arrows*arrows, float x1, float y1) : Actor(x1,y1) + { + this->arrows = arrows; + } + + Arrows::UpArrow::~UpArrow() + { + // + } + + void Arrows::UpArrow::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void Arrows::UpArrow::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void Arrows::UpArrow::onRelease() + { + arrows->value+=arrows->incr; + if(arrows->value > arrows->maxValue) + { + arrows->value = arrows->minValue; + } + } + + Arrows::DownArrow::DownArrow(Arrows*arrows, float x1, float y1) : Actor(x1,y1) + { + this->arrows = arrows; + } + + Arrows::DownArrow::~DownArrow() + { + // + } + + void Arrows::DownArrow::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void Arrows::DownArrow::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void Arrows::DownArrow::onRelease() + { + arrows->value-=arrows->incr; + if(arrows->value < arrows->minValue) + { + arrows->value = arrows->maxValue; + } + } + + Arrows::Arrows(float x1, float y1, float x2, float y2) + { + up = new UpArrow(this,x1,y1); + down = new DownArrow(this,x2,y2); + up->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/arrow_up.png")); + up->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/arrow_up_selected.png")); + up->changeAnimation("normal", FORWARD); + down->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/arrow_down.png")); + down->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/arrow_down_selected.png")); + down->changeAnimation("normal", FORWARD); + Scale = 1; + } + + Arrows::~Arrows() + { + delete up; + delete down; + } + + void Arrows::Update(long gameTime) + { + up->Update(gameTime); + down->Update(gameTime); + } + + void Arrows::Draw(Graphics2D&g, long gameTime) + { + up->Draw(g, gameTime); + down->Draw(g, gameTime); + } + + boolean Arrows::isClicked() + { + if(up->isClicked() || down->isClicked()) + { + return true; + } + return false; + } + + boolean Arrows::wasClicked() + { + if(up->wasClicked() || down->wasClicked()) + { + return true; + } + return false; + } + + void Arrows::setScale(float scale) + { + up->Scale = scale; + down->Scale = scale; + Scale = scale; + } + + float Arrows::getScale() + { + return Scale; + } + + void Arrows::setValue(int value) + { + this->value = value; + } + + int Arrows::getValue() + { + return value; + } + + void Arrows::setProperties(int min, int max, int increment) + { + minValue = min; + maxValue = max; + incr = increment; + } +} \ No newline at end of file diff --git a/SmashBros/Arrows.h b/SmashBros/Arrows.h new file mode 100755 index 0000000..1dac1d0 --- /dev/null +++ b/SmashBros/Arrows.h @@ -0,0 +1,56 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class Arrows + { + private: + class UpArrow : public Actor + { + private: + Arrows*arrows; + public: + UpArrow(Arrows*arrows, float x1, float y1); + virtual ~UpArrow(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + class DownArrow : public Actor + { + private: + Arrows*arrows; + public: + DownArrow(Arrows*arrows, float x1, float y1); + virtual ~DownArrow(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + UpArrow*up; + DownArrow*down; + + int value,maxValue,minValue,incr; + float Scale; + + public: + Arrows(float x1, float y1, float x2, float y2); + virtual ~Arrows(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + boolean isClicked(); + boolean wasClicked(); + void setScale(float scale); + float getScale(); + void setValue(int value); + int getValue(); + void setProperties(int min, int max, int increment); + }; +} \ No newline at end of file diff --git a/SmashBros/AttackManager.cpp b/SmashBros/AttackManager.cpp new file mode 100755 index 0000000..e0b1249 --- /dev/null +++ b/SmashBros/AttackManager.cpp @@ -0,0 +1,126 @@ +#include "AttackManager.h" + +namespace SmashBros +{ + AttackManager::AttackInfo::AttackInfo() + { + // + } + + AttackManager::AttackInfo::AttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult) + { + this->attackNo = attackNo; + this->playerdir = playerdir; + this->damage = damage; + this->delayTime = delayTime; + this->xDir = xDir; + this->xAmount = xAmount; + this->xMult = xMult; + this->yDir = yDir; + this->yAmount = yAmount; + this->yMult = yMult; + } + + AttackManager::AttackInfo::~AttackInfo() + { + // + } + + AttackManager::AttackInfo::operator String() + { + String str = ""; + str += "attackNo: "; + str += attackNo; + str += ", playerdir: "; + str += playerdir; + return str; + } + + AttackManager::AttackManager() + { + // + } + + AttackManager::~AttackManager() + { + // + } + + void AttackManager::addUpAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult) + { + if(!attackExists(up,attackNo,playerdir)) + { + up.add(AttackInfo(attackNo,playerdir,damage,delayTime,xDir,xAmount,xMult,yDir,yAmount,yMult)); + } + } + + void AttackManager::addDownAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult) + { + if(!attackExists(down,attackNo,playerdir)) + { + down.add(AttackInfo(attackNo,playerdir,damage,delayTime,xDir,xAmount,xMult,yDir,yAmount,yMult)); + } + } + + void AttackManager::addLeftAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult) + { + if(!attackExists(left,attackNo,playerdir)) + { + left.add(AttackInfo(attackNo,playerdir,damage,delayTime,xDir,xAmount,xMult,yDir,yAmount,yMult)); + } + } + + void AttackManager::addRightAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult) + { + if(!attackExists(right,attackNo,playerdir)) + { + right.add(AttackInfo(attackNo,playerdir,damage,delayTime,xDir,xAmount,xMult,yDir,yAmount,yMult)); + } + } + + AttackManager::AttackInfo*AttackManager::getAttackInfo(byte hitDir, int attackNo, byte playerdir) + { + switch(hitDir) + { + case PrimitiveActor::DIR_UP: + return searchAttackList(up,attackNo,playerdir); + + case PrimitiveActor::DIR_DOWN: + return searchAttackList(down,attackNo,playerdir); + + case PrimitiveActor::DIR_LEFT: + return searchAttackList(left,attackNo,playerdir); + + case PrimitiveActor::DIR_RIGHT: + return searchAttackList(right,attackNo,playerdir); + } + return null; + } + + boolean AttackManager::attackExists(ArrayList&list, int attackNo, byte playerdir) + { + for(int i=0; i&list, int attackNo, byte playerdir) + //use pointer or reference + { + for(int i=0; i up; + ArrayList down; + ArrayList left; + ArrayList right; + + public: + AttackManager(); + virtual ~AttackManager(); + + void addUpAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult); + void addDownAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult); + void addLeftAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult); + void addRightAttackInfo(int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult); + + AttackInfo*getAttackInfo(byte hitDir, int attackNo, byte playerdir); + + private: + boolean attackExists(ArrayList&list, int attackNo, byte playerdir); + AttackInfo*searchAttackList(ArrayList&list, int attackNo, byte playerdir); + }; +} \ No newline at end of file diff --git a/SmashBros/AttackRandomizer.cpp b/SmashBros/AttackRandomizer.cpp new file mode 100755 index 0000000..05c4f39 --- /dev/null +++ b/SmashBros/AttackRandomizer.cpp @@ -0,0 +1,430 @@ +#include "AttackRandomizer.h" +#include "Global.h" +#include "Controls.h" + +namespace SmashBros +{ + AttackRandomizer::AttackProbability::AttackProbability() + { + // + } + + AttackRandomizer::AttackProbability::AttackProbability(AttackRandomizer*randomizer, byte attack, float probability, boolean charge) + { + this->attack = attack; + this->probability = probability; + this->charge = charge; + this->randomizer = randomizer; + } + + AttackRandomizer::AttackProbability::~AttackProbability() + { + randomizer = null; + } + + void AttackRandomizer::setPlayerNo(int playerNo) + { + this->playerNo = playerNo; + } + + void AttackRandomizer::AttackProbability::doAttack() + { + Player*playr = Global::getPlayerActor(randomizer->playerNo); + if(playr->CanDo()) + { + switch(attack) + { + case Player::ATTACK_A: + playr->attackA(); + break; + + case Player::ATTACK_SIDEA: + playr->attackSideA(); + break; + + case Player::ATTACK_UPA: + playr->attackUpA(); + break; + + case Player::ATTACK_DOWNA: + playr->attackDownA(); + break; + + case Player::ATTACK_B: + playr->attackB(); + break; + + case Player::ATTACK_SIDEB: + playr->attackSideB(); + break; + + case Player::ATTACK_UPB: + playr->attackUpB(); + break; + + case Player::ATTACK_DOWNB: + playr->attackDownB(); + break; + + case Player::ATTACK_SIDESMASH: + playr->attackSideSmash(Player::STEP_CHARGE); + break; + + case Player::ATTACK_UPSMASH: + playr->attackUpSmash(Player::STEP_CHARGE); + break; + + case Player::ATTACK_DOWNSMASH: + playr->attackDownSmash(Player::STEP_CHARGE); + break; + } + } + if(charge) + { + randomizer->currentlyChargingAttack = attack; + } + } + + byte AttackRandomizer::AttackProbability::getAttackNo() + { + return attack; + } + + float AttackRandomizer::AttackProbability::getProbability() + { + return probability; + } + + boolean AttackRandomizer::AttackProbability::mustCharge() + { + return charge; + } + + AttackRandomizer::AttackRandomizer(int playerNo) + { + melee = new ArrayList(); + upmelee = new ArrayList(); + downmelee = new ArrayList(); + strongmelee = new ArrayList(); + sidemove = new ArrayList(); + upmove = new ArrayList(); + downmove = new ArrayList(); + projectile = new ArrayList(); + defensive = new ArrayList(); + + meleeProb = 0; + upmeleeProb = 0; + downmeleeProb = 0; + strongmeleeProb = 0; + sidemoveProb = 0; + upmoveProb = 0; + downmoveProb = 0; + projectileProb = 0; + defensiveProb = 0; + + finalsmashCharge = false; + + currentlyChargingAttack = -1; + + this->playerNo = playerNo; + } + + AttackRandomizer::~AttackRandomizer() + { + delete melee; + delete upmelee; + delete downmelee; + delete strongmelee; + delete sidemove; + delete upmove; + delete downmove; + delete projectile; + delete defensive; + } + + void AttackRandomizer::setAttack(byte attack, byte attacktype, float probability, boolean charge) + { + if(attack==Player::ATTACK_FINALSMASH) + { + finalsmashCharge = charge; + } + else + { + AttackProbability newAttack = AttackProbability(this, attack, probability, charge); + switch(attacktype) + { + case Player::ATTACKTYPE_MELEE: + melee->add(newAttack); + meleeProb+=probability; + break; + + case Player::ATTACKTYPE_UPMELEE: + upmelee->add(newAttack); + upmeleeProb+=probability; + break; + + case Player::ATTACKTYPE_DOWNMELEE: + downmelee->add(newAttack); + downmeleeProb+=probability; + break; + + case Player::ATTACKTYPE_STRONGMELEE: + strongmelee->add(newAttack); + strongmeleeProb+=probability; + break; + + case Player::ATTACKTYPE_SIDEMOVE: + sidemove->add(newAttack); + sidemoveProb+=probability; + break; + + case Player::ATTACKTYPE_UPMOVE: + upmove->add(newAttack); + upmoveProb+=probability; + break; + + case Player::ATTACKTYPE_DOWNMOVE: + downmove->add(newAttack); + downmoveProb+=probability; + break; + + case Player::ATTACKTYPE_PROJECTILE: + projectile->add(newAttack); + projectileProb+=probability; + break; + + case Player::ATTACKTYPE_DEFENSIVE: + defensive->add(newAttack); + defensiveProb+=probability; + break; + } + } + } + + void AttackRandomizer::doFinalSmash() + { + Player*playr = Global::getPlayerActor(playerNo); + if(playr->canFinalSmash()) + { + playr->attackFinalSmash(); + } + } + + byte AttackRandomizer::doAttack(byte attacktype) + { + if(totalAttacks(attacktype)>0) + { + return doRandomAttack(attacktype); + } + return -1; + } + + byte AttackRandomizer::doRandomAttack(byte attacktype) + { + ArrayList*list = getAttackList(attacktype); + float totalProb = getTotalAttackProbability(attacktype); + float rand = (float)(GameEngine::random()*totalProb); + float current = 0; + for(int i=0; isize(); i++) + { + current += list->get(i).getProbability(); + if(rand<=current) + { + AttackProbability&attackProb = list->get(i); + attackProb.doAttack(); + return attackProb.getAttackNo(); + } + } + return -1; + } + + boolean AttackRandomizer::doChargingAttack() + { + Player*playr = Global::getPlayerActor(playerNo); + if(playr->chargeSmash>0) + { + switch(playr->chargeSmash) + { + case 1: + playr->attackSideSmash(Player::STEP_GO); + break; + + case 2: + playr->attackUpSmash(Player::STEP_GO); + break; + + case 3: + playr->attackDownSmash(Player::STEP_GO); + break; + } + currentlyChargingAttack = -1; + return true; + } + else if(playr->chargingAttack) + { + switch(currentlyChargingAttack) + { + case Player::ATTACK_A: + playr->doChargingAttack(Controls::BUTTON_STANDARD); + return true; + + case Player::ATTACK_SIDEA: + playr->doChargingAttack(Controls::BUTTON_STANDARD); + return true; + + case Player::ATTACK_UPA: + playr->doChargingAttack(Controls::BUTTON_STANDARD); + return true; + + case Player::ATTACK_DOWNA: + playr->doChargingAttack(Controls::BUTTON_STANDARD); + return true; + + case Player::ATTACK_B: + playr->doChargingAttack(Controls::BUTTON_SPECIAL); + return true; + + case Player::ATTACK_SIDEB: + playr->doChargingAttack(Controls::BUTTON_SPECIAL); + return true; + + case Player::ATTACK_UPB: + playr->doChargingAttack(Controls::BUTTON_SPECIAL); + return true; + + case Player::ATTACK_DOWNB: + playr->doChargingAttack(Controls::BUTTON_SPECIAL); + return true; + + case Player::ATTACK_FINALSMASH: + playr->doChargingAttack(Controls::BUTTON_SPECIAL); + return true; + } + currentlyChargingAttack = -1; + } + return false; + } + + int AttackRandomizer::totalAttacks(byte attacktype) + { + return getAttackList(attacktype)->size(); + } + + boolean AttackRandomizer::attackMustCharge(byte attack) + { + if(attack==Player::ATTACK_FINALSMASH) + { + return finalsmashCharge; + } + else + { + int indexNo = -1; + byte type = Player::ATTACKTYPE_MELEE; + while(type<=7) + { + ArrayList*list = getAttackList(type); + indexNo = getAttackIndex(list, attack); + if(indexNo>-1) + { + AttackProbability&attackProb = list->get(indexNo); + return attackProb.mustCharge(); + } + type++; + } + } + return false; + } + + boolean AttackRandomizer::checkAttackType(byte attack, byte attacktype) + { + ArrayList*list = getAttackList(attacktype); + for(int i=0; isize(); i++) + { + if(list->get(i).getAttackNo() == attack) + { + return true; + } + } + return false; + } + + ArrayList*AttackRandomizer::getAttackList(byte attacktype) + { + switch(attacktype) + { + case Player::ATTACKTYPE_MELEE: + return melee; + + case Player::ATTACKTYPE_UPMELEE: + return upmelee; + + case Player::ATTACKTYPE_DOWNMELEE: + return downmelee; + + case Player::ATTACKTYPE_STRONGMELEE: + return strongmelee; + + case Player::ATTACKTYPE_SIDEMOVE: + return sidemove; + + case Player::ATTACKTYPE_UPMOVE: + return upmove; + + case Player::ATTACKTYPE_DOWNMOVE: + return downmove; + + case Player::ATTACKTYPE_PROJECTILE: + return projectile; + + case Player::ATTACKTYPE_DEFENSIVE: + return defensive; + } + return null; + } + + float AttackRandomizer::getTotalAttackProbability(byte attacktype) + { + switch(attacktype) + { + case Player::ATTACKTYPE_MELEE: + return meleeProb; + + case Player::ATTACKTYPE_UPMELEE: + return upmeleeProb; + + case Player::ATTACKTYPE_DOWNMELEE: + return downmeleeProb; + + case Player::ATTACKTYPE_STRONGMELEE: + return strongmeleeProb; + + case Player::ATTACKTYPE_SIDEMOVE: + return sidemoveProb; + + case Player::ATTACKTYPE_UPMOVE: + return upmoveProb; + + case Player::ATTACKTYPE_DOWNMOVE: + return downmoveProb; + + case Player::ATTACKTYPE_PROJECTILE: + return projectileProb; + + case Player::ATTACKTYPE_DEFENSIVE: + return defensiveProb; + } + return 0; + } + + int AttackRandomizer::getAttackIndex(ArrayList*list, byte attack) + { + for(int i=0; isize(); i++) + { + if(list->get(i).getAttackNo() == attack) + { + return i; + } + } + return -1; + } +} \ No newline at end of file diff --git a/SmashBros/AttackRandomizer.h b/SmashBros/AttackRandomizer.h new file mode 100755 index 0000000..4f0477a --- /dev/null +++ b/SmashBros/AttackRandomizer.h @@ -0,0 +1,72 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class AttackRandomizer + { + private: + class AttackProbability + { + private: + byte attack; + float probability; + boolean charge; + AttackRandomizer*randomizer; + + public: + AttackProbability(); + AttackProbability(AttackRandomizer*randomizer, byte attack, float probability, boolean charge); + virtual ~AttackProbability(); + + void doAttack(); + byte getAttackNo(); + float getProbability(); + boolean mustCharge(); + }; + + ArrayList*melee; + float meleeProb; + ArrayList*upmelee; + float upmeleeProb; + ArrayList*downmelee; + float downmeleeProb; + ArrayList*strongmelee; + float strongmeleeProb; + ArrayList*sidemove; + float sidemoveProb; + ArrayList*upmove; + float upmoveProb; + ArrayList*downmove; + float downmoveProb; + ArrayList*projectile; + float projectileProb; + ArrayList*defensive; + float defensiveProb; + + byte currentlyChargingAttack; + + boolean finalsmashCharge; + + int playerNo; + + byte doRandomAttack(byte attacktype); + ArrayList*getAttackList(byte attacktype); + float getTotalAttackProbability(byte attacktype); + int getAttackIndex(ArrayList*list, byte attack); + + public: + AttackRandomizer(int playerNo = 0); + virtual ~AttackRandomizer(); + + void setPlayerNo(int playerNo); + void setAttack(byte attack, byte attacktype, float probability, boolean charge); + void doFinalSmash(); + byte doAttack(byte attacktype); + boolean doChargingAttack(); + int totalAttacks(byte attacktype); + boolean attackMustCharge(byte attack); + boolean checkAttackType(byte attack, byte attacktype); + }; +} \ No newline at end of file diff --git a/SmashBros/AttackTemplates.cpp b/SmashBros/AttackTemplates.cpp new file mode 100755 index 0000000..9bf3d35 --- /dev/null +++ b/SmashBros/AttackTemplates.cpp @@ -0,0 +1,1189 @@ +#include "AttackTemplates.h" +#include "Global.h" +#include "Item.h" + +namespace SmashBros +{ + void AttackTemplates::causeDamage(Player*playr, Player*collide, int amount) + { + boolean canInflict = true; + if(collide->attacksPriority==5) + { + collide->updateHitbox(); + playr->updateHitbox(); + switch(collide->playerdir) + { + case Player::LEFT: + if(playr->xx && PrimitiveActor::getDir(collide->getHitbox(),playr->getHitbox())!=PrimitiveActor::DIR_LEFT) + { + boolean inflicted = collide->onPlayerDeflectDamage(playr, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + break; + + case Player::RIGHT: + if(playr->x>collide->x && PrimitiveActor::getDir(collide,playr)!=PrimitiveActor::DIR_RIGHT) + { + boolean inflicted = collide->onPlayerDeflectDamage(playr, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + break; + } + } + else if(collide->attacksPriority==6) + { + boolean inflicted = collide->onPlayerDeflectDamage(playr, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + if(canInflict) + { + collide->percent+=amount; + if(collide->percent>999) + { + collide->percent=999; + } + } + } + + void AttackTemplates::causeHurtLaunch(Player*playr, Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + if(collide->deflectState) + { + collide->onPlayerDeflectLaunch(playr, xDir, xAmount, xMult, yDir, yAmount, yMult); + } + else + { + //float oldXvel; + //float oldYvel; + float newyVel=(float)(yDir*(yAmount+(yMult*(collide->percent))/100)); + float newxVel=(float)(xDir*(xAmount+(xMult*(collide->percent))/100)); + //Console::WriteLine(this.attacksHolder + ": " + newyVel + ""); + if(newyVel>0) + { + if(newyVel>collide->yvelocity) + { + collide->yvelocity=newyVel; + } + } + else if(newyVel<0) + { + if(newyVelyvelocity) + { + collide->yvelocity=newyVel; + } + } + if(newxVel>0) + { + if(newxVel>collide->xvelocity) + { + collide->xvelocity=newxVel; + } + } + else if(newxVel<0) + { + if(newxVelxvelocity) + { + collide->xvelocity=newxVel; + } + } + collide->y-=1; + if(collide->yvelocity>0 && collide->isOnGround()) + { + collide->yvelocity = -(collide->yvelocity/2); + } + } + } + + void AttackTemplates::causeHurt(Player*playr, Player*collide, byte dir, int time) + { + if(!collide->deflectState) + { + if(abs(collide->xvelocity)<=3) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", NO_CHANGE); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", NO_CHANGE); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_left", NO_CHANGE); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + collide->changeAnimation("hurt_spin_up", NO_CHANGE); + } + } + + else if((abs(collide->xvelocity)>3)&&(abs(collide->xvelocity)<7)) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_fly_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_fly_right", NO_CHANGE); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", NO_CHANGE); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_fly_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_fly_right", NO_CHANGE); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_right", NO_CHANGE); + break; + } + } + } + + else if(abs(collide->xvelocity)>=7) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", NO_CHANGE); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", NO_CHANGE); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", NO_CHANGE); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", NO_CHANGE); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_right", NO_CHANGE); + break; + } + } + } + collide->xVel=0; + collide->yVel=0; + collide->attackTime=0; + collide->setToDefaultValues(); + collide->chargingAttack=false; + collide->bUp=false; + collide->up=false; + collide->hurt=2; + collide->landing=false; + collide->jumping=false; + //collide->moveLeft=0; + //collide->moveRight=0; + collide->hanging=false; + collide->attacksHolder=-1; + collide->attacksPriority=0; + collide->canDo=false; + collide->hurtTime=Global::worldTime+time; + collide->hurtFrame=4; + collide->runTime=0; + collide->chargeSmash=0; + collide->lastHit = playr->playerNo; + + collide->destroyCharge(); + + if(collide->itemHolding!=null) + { + collide->itemHolding->onHolderHurt(); + } + /*if(itemActor->itemOwner>0) + { + collide->lastHit=itemOwner; + }*/ + } + } + + void AttackTemplates::normalA(Player*playr, int aNo, double aP) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("standard_attack_left", FORWARD); + break; + + case 2: + playr->changeAnimation("standard_attack_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::combo2A(Player*playr, int comTime, int aNo,double aP,int aNo2,double aP2) + { + playr->jumping = false; + playr->hurt = 0; + if(!(Global::worldTime<=(playr->comboTime+comTime))) + { + playr->standardCombo=0; + playr->comboTime=0; + } + switch(playr->playerdir) + { + case 1: + switch(playr->standardCombo) + { + case 0: + playr->standardCombo=1; + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + playr->changeAnimation("standard_attack_left", FORWARD); + playr->comboTime=Global::worldTime; + break; + + case 1: + playr->standardCombo=0; + playr->attacksHolder=aNo2; + playr->attacksPriority=aP2; + playr->changeAnimation("standard_attack2_left", FORWARD); + playr->comboTime=0; + break; + } + break; + + case 2: + switch(playr->standardCombo) + { + case 0: + playr->standardCombo=1; + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + playr->changeAnimation("standard_attack_right", FORWARD); + playr->comboTime=Global::worldTime; + break; + + case 1: + playr->standardCombo=0; + playr->attacksHolder=aNo2; + playr->attacksPriority=aP2; + playr->changeAnimation("standard_attack2_right", FORWARD); + playr->comboTime=0; + break; + } + break; + } + } + + void AttackTemplates::combo3A(Player*playr, int comTime, int aNo,double aP,int aNo2,double aP2,int aNo3, double aP3) + { + playr->jumping = false; + playr->hurt = 0; + if(!(Global::worldTime<=(playr->comboTime+comTime))) + { + playr->standardCombo=0; + playr->comboTime=0; + } + switch(playr->playerdir) + { + case 1: + switch(playr->standardCombo) + { + case 0: + playr->standardCombo=1; + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + playr->changeAnimation("standard_attack_left", FORWARD); + playr->comboTime=Global::worldTime; + break; + + case 1: + playr->standardCombo=2; + playr->attacksHolder=aNo2; + playr->attacksPriority=aP2; + playr->changeAnimation("standard_attack2_left", FORWARD); + playr->comboTime=Global::worldTime; + break; + + case 2: + playr->standardCombo=0; + playr->attacksHolder=aNo3; + playr->attacksPriority=aP3; + playr->changeAnimation("standard_attack3_left", FORWARD); + playr->comboTime=0; + break; + } + break; + + case 2: + switch(playr->standardCombo) + { + case 0: + playr->standardCombo=1; + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + playr->changeAnimation("standard_attack_right", FORWARD); + playr->comboTime=Global::worldTime; + break; + + case 1: + playr->standardCombo=2; + playr->attacksHolder=aNo2; + playr->attacksPriority=aP2; + playr->changeAnimation("standard_attack2_right", FORWARD); + playr->comboTime=Global::worldTime; + break; + + case 2: + playr->standardCombo=0; + playr->attacksHolder=aNo3; + playr->attacksPriority=aP3; + playr->changeAnimation("standard_attack3_right", FORWARD); + playr->comboTime=0; + break; + } + break; + } + } + + void AttackTemplates::normalAirA(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_attack_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_attack_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalSideA(Player*playr, int aNo, double aP) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("standard_attack_side_left", FORWARD); + break; + + case 2: + playr->changeAnimation("standard_attack_side_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalDashA(Player*playr, int aNo, double aP, float speed) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("dash_attack_left", FORWARD); + playr->xVel=-speed; + break; + + case 2: + playr->changeAnimation("dash_attack_right", FORWARD); + playr->xVel=speed; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalAirSideA(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_attack_side_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_attack_side_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::rehitAirSideA(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + playr->hitAmount=0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_attack_side_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_attack_side_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalUpA(Player*playr, int aNo, double aP) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("standard_attack_up_left", FORWARD); + break; + + case 2: + playr->changeAnimation("standard_attack_up_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalAirUpA(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_attack_up_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_attack_up_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalDownA(Player*playr, int aNo, double aP) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("standard_attack_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("standard_attack_down_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::normalAirDownA(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_attack_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_attack_down_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::singleAirDownA(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + playr->changeAnimation("air_attack_down", FORWARD); + } + + void AttackTemplates::dropAirDownA(Player*playr, int type, int aNo, double aP, float speed, float speed2) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(type) + { + case Player::STEP_CHARGE: + if((playr->yvelocity)>=-8) + { + playr->yvelocity=-1; + } + else + { + playr->yvelocity+=6; + } + playr->landing=true; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_prep_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_prep_down_right", FORWARD); + break; + } + break; + + case Player::STEP_GO: + playr->landing=false; + if((playr->yvelocity)<=(-speed)) + { + playr->yvelocity+=speed; + } + else if(((playr->yvelocity)>0) && ((playr->yvelocity)yvelocity=speed; + } + switch(playr->playerdir) + { + case 1: + playr->xvelocity=-speed2; + playr->changeAnimation("air_attack_down_left", FORWARD); + break; + + case 2: + playr->xvelocity=speed; + playr->changeAnimation("air_attack_down_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + break; + + case Player::STEP_FINISH: + if(playr->isOnGround()) + { + playr->landing=true; + playr->attacksHolder=-1; + playr->attacksPriority=0; + playr->xvelocity=0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("air_land_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("air_land_down_right", FORWARD); + break; + } + } + else + { + playr->animFinish(); + playr->xvelocity=0; + } + break; + } + } + + void AttackTemplates::chargeB(Player*playr, float spMin, float spMax, long totalTime) + { + playr->jumping = false; + playr->hurt = 0; + playr->chargebar = new Chargebar(playr->getPlayerNo(),spMin, spMax, totalTime, Chargebar::TYPE_SPECIALATTACK); + playr->chargingAttack = true; + } + + /*void AttackTemplates::chargeB2(Player*playr, int spMin, int spMax, int chargeTotal, int cx1, int cy1, int cbd) + { + char chargename[30]; + char chargeAnim[30]; + char chargeTimer[50]; + Actor*chargeActor; + sprintf(chargeAnim, "chargebar%i", chargeTotal); + sprintf(chargeTimer, "%stimer", chargeAnim); + playr->hurt=0; + sprintf(chargename, "chargebar%i", playr->playerNo); + playr->attacksPriority=-1; + switch(playr->playerdir) + { + case 1: + playr->charging_bdown=cbd; + CreateActor(chargename, chargeAnim, playr->clonename, "(none)", cx1, cy1, true); + playr->changeAnimation("smash_charge_left", FORWARD); + chargeActor=getclone(chargename); + chargeActor->smashPowerMax=spMax; + chargeActor->smashPowerCharge=spMin*1000; + //CreateTimer(chargename, chargeTimer, getChargeIncr(chargeTotal)); + break; + + case 2: + playr->charging_bdown=cbd; + CreateActor(chargename, chargeAnim, playr->clonename, "(none)", cx1, cy1, true); + playr->changeAnimation("smash_charge_right", FORWARD); + chargeActor=getclone(chargename); + chargeActor->smashPowerMax=spMax; + chargeActor->smashPowerCharge=spMin*1000; + //CreateTimer(chargename, chargeTimer, getChargeIncr(chargeTotal)); + break; + } + }*/ + + void AttackTemplates::homingB(Player*playr, int aNo, double aP, float speed) + { + ArrayList targets = ArrayList(); + int i; + float speedX = 0; + float speedY = 0; + for(i=1; i<=Global::possPlayers; i++) + { + Player*checker = Global::getPlayerActor(i); + if(checker!=null) + { + if((checker->isAlive()) && (i!=playr->playerNo) && !(Global::teamBattle && checker->team!=playr->team)) + { + double d=PrimitiveActor::distanceUnSqr(playr->x,playr->y,checker->x,checker->y); + if(d<=22500) + { + targets.add(checker); + } + } + } + } + if(targets.size()>1) + { + int closest=0; + Player*closePlayer; + for(i=2; ix,playr->y,target->x,target->y); + double d2=PrimitiveActor::distanceUnSqr(playr->x,playr->y,newTarget->x,newTarget->y); + if(d2x)<(closePlayer->x)) + { + playr->playerdir=2; + } + else if((playr->x)>(closePlayer->x)) + { + playr->playerdir=1; + } + double dist = PrimitiveActor::distance(playr->x, playr->y, closePlayer->x, closePlayer->y); + speedX=(float)(((closePlayer->x-playr->x)/dist)*speed); + speedY=(float)(((closePlayer->y-playr->y)/dist)*speed); + } + else if(targets.size()==1) + { + Player*closePlayer = targets.get(0); + if((playr->x)<(closePlayer->x)) + { + playr->playerdir=2; + } + else if((playr->x)>(closePlayer->x)) + { + playr->playerdir=1; + } + double dist = PrimitiveActor::distance(playr->x, playr->y, closePlayer->x, closePlayer->y); + speedX=(float)(((closePlayer->x-playr->x)/dist)*speed); + speedY=(float)(((closePlayer->y-playr->y)/dist)*speed); + } + else + { + switch(playr->playerdir) + { + case 1: + speedX=-0.7f*speed; + speedY=0.7f*speed; + break; + + case 2: + speedX=0.7f*speed; + speedY=0.7f*speed; + break; + } + } + playr->xvelocity=speedX; + playr->yvelocity=speedY; + //playr->recoverTime=Global::worldTime+wait; + + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_left", FORWARD); + break; + + case 2: + playr->changeAnimation("special_attack_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::singleProjectile(Player*playr, int aNo, double aP, Projectile*projectile) + { + playr->jumping = false; + playr->hurt = 0; + playr->attacksHolder=aNo; + playr->createProjectile(projectile); + playr->attacksPriority=aP; + } + + void AttackTemplates::normalSideB(Player*playr, int aNo, double aP, float xDist) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_side_left", FORWARD); + playr->x-=xDist; + break; + + case 2: + playr->changeAnimation("special_attack_side_right", FORWARD); + playr->x+=xDist; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::dashSideB(Player*playr, int aNo, double aP, float speed) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_side_left", FORWARD); + playr->xVel=-speed; + break; + + case 2: + playr->changeAnimation("special_attack_side_right", FORWARD); + playr->xVel=speed; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::rollAttack(Player*playr, int aNo, double aP, float speed, int time) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("roll_left", FORWARD); + playr->xVel=-speed; + break; + + case 2: + playr->changeAnimation("roll_right", FORWARD); + playr->xVel=speed; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + playr->attackTime=(Global::worldTime+time); + } + + void AttackTemplates::launchUpB(Player*playr, int aNo, double aP, float yVeloc, float yVeloc2) + { + playr->jumping = false; + playr->hurt = 0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_up_left", FORWARD); + //playr->bUpWaitTime=Global::worldTime+wTime; + break; + + case 2: + playr->changeAnimation("special_attack_up_right", FORWARD); + //playr->bUpWaitTime=Global::worldTime+wTime; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + if(playr->isOnGround()) + { + playr->yvelocity=-yVeloc2; + } + else + { + playr->yvelocity=-yVeloc; + } + playr->bUp=true; + } + + void AttackTemplates::rehitUpB(Player*playr, int aNo, double aP, float yVeloc, float yVeloc2) + { + playr->jumping = false; + playr->hurt = 0; + playr->hitAmount=0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_up_left", FORWARD); + //playr->bUpWaitTime=Global::worldTime+wTime; + break; + + case 2: + playr->changeAnimation("special_attack_up_right", FORWARD); + //playr->bUpWaitTime=Global::worldTime+wTime; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + + if(playr->isOnGround()) + { + playr->yvelocity=-yVeloc2; + } + else + { + playr->yvelocity=-yVeloc; + } + playr->bUp=true; + } + + void AttackTemplates::rehitUpB2(Player*playr, int aNo, double aP, float yVeloc, float yVeloc2) + { + playr->jumping = false; + playr->hurt = 0; + playr->hitAmount=0; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_up_left", FORWARD); + //playr->bUpWaitTime=Global::worldTime+wTime; + break; + + case 2: + playr->changeAnimation("special_attack_up_right", FORWARD); + //playr->bUpWaitTime=Global::worldTime+wTime; + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + + if(playr->isOnGround()) + { + playr->yVel=-yVeloc2; + } + else + { + playr->yVel=-yVeloc; + } + playr->bUp=true; + } + + void AttackTemplates::normalDownB(Player*playr,int aNo,double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("special_attack_down_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::prepareDownB(Player*playr, int aNo, double aP) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_prep_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("special_prep_down_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + } + + void AttackTemplates::bounceDownB(Player*playr,int aNo,double aP,float speed) + { + playr->hurt = 0; + playr->up=false; + playr->jumping=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("special_attack_down_left", FORWARD); + break; + + case 2: + playr->changeAnimation("special_attack_down_right", FORWARD); + break; + } + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + + if(playr->yvelocity<=0) + { + playr->yvelocity+=speed; + } + else if(playr->yvelocityyvelocity=speed; + } + } + + void AttackTemplates::normalSmash(Player*playr, int aNo, double aP, byte type, int smashType, long totalTime, int cMin, int cMax) + { + playr->hurt = 0; + playr->jumping = false; + switch(type) + { + case Player::STEP_CHARGE: + playr->chargebar = new Chargebar(playr->getPlayerNo(),(float)cMin, (float)cMax, totalTime, Chargebar::TYPE_SMASHATTACK); + playr->chargeSmash = smashType; + playr->yvelocity = 0; + switch(playr->getPlayerDir()) + { + case 1: + playr->changeAnimation("smash_charge_left", FORWARD); + break; + + case 2: + playr->changeAnimation("smash_charge_right", FORWARD); + break; + } + break; + + case Player::STEP_GO: + playr->chargeSmash = 0; + playr->attacksHolder=aNo; + playr->attacksPriority=aP; + switch(smashType) + { + case 1: + switch(playr->getPlayerDir()) + { + case 1: + playr->changeAnimation("smash_attack_left",FORWARD); + break; + + case 2: + playr->changeAnimation("smash_attack_right", FORWARD); + break; + } + break; + + case 2: + switch(playr->getPlayerDir()) + { + case 1: + playr->changeAnimation("smash_attack_up_left",FORWARD); + break; + + case 2: + playr->changeAnimation("smash_attack_up_right", FORWARD); + break; + } + break; + + case 3: + switch(playr->getPlayerDir()) + { + case 1: + playr->changeAnimation("smash_attack_down_left",FORWARD); + break; + + case 2: + playr->changeAnimation("smash_attack_down_right", FORWARD); + break; + } + break; + } + break; + } + } + + void AttackTemplates::stopSmashAttack(Player*playr) + { + playr->chargeSmash = 0; + playr->chargingAttack = false; + if(playr->chargebar!=null) + { + playr->smashPower = (int)playr->chargebar->currentPower; + delete playr->chargebar; + playr->chargebar = null; + } + } + + void AttackTemplates::finalSmash(Player*playr, int aNo) + { + playr->hurt = 0; + playr->jumping = false; + if(playr->canFinalSmash()) + { + playr->canFinalsmash = false; + playr->attacksPriority = 7; + if(playr->itemWielding!=null) + { + if(playr->itemWielding->getItemNo()==Global::ITEM_SMASHBALL) + { + playr->itemWielding->onDestroy(); + playr->itemWielding = null; + Global::playerHasSmashBall = true; + } + } + playr->attacksHolder=aNo; + } + } + + void AttackTemplates::finishFinalSmash(Player*playr) + { + playr->attacksPriority = 0; + Global::playerHasSmashBall = false; + Global::smashBallOnField = false; + } +} \ No newline at end of file diff --git a/SmashBros/AttackTemplates.h b/SmashBros/AttackTemplates.h new file mode 100755 index 0000000..ad0e855 --- /dev/null +++ b/SmashBros/AttackTemplates.h @@ -0,0 +1,52 @@ +#include "SmashForwards.h" +#include "Player.h" + +#pragma once + +namespace SmashBros +{ + class AttackTemplates + { + friend class Player; + private: + static void causeDamage(Player*playr, Player*collide, int amount); + static void causeHurtLaunch(Player*playr, Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + static void causeHurt(Player*playr, Player*collide, byte dir, int time); + + public: + static const byte SMASH_SIDE = 1; + static const byte SMASH_UP = 2; + static const byte SMASH_DOWN = 3; + + static void normalA(Player*playr, int aNo, double aP); + static void combo2A(Player*playr, int comTime, int aNo,double aP,int aNo2,double aP2); + static void combo3A(Player*playr, int comTime, int aNo,double aP,int aNo2,double aP2,int aNo3, double aP3); + static void normalAirA(Player*playr, int aNo, double aP); + static void normalSideA(Player*playr, int aNo, double aP); + static void normalDashA(Player*playr, int aNo, double aP, float speed); + static void normalAirSideA(Player*playr, int aNo, double aP); + static void rehitAirSideA(Player*playr, int aNo, double aP); + static void normalUpA(Player*playr, int aNo, double aP); + static void normalAirUpA(Player*playr, int aNo, double aP); + static void normalDownA(Player*playr, int aNo, double aP); + static void normalAirDownA(Player*playr, int aNo, double aP); + static void singleAirDownA(Player*playr, int aNo, double aP); + static void dropAirDownA(Player*playr, int type, int aNo, double aP, float speed, float speed2); + static void chargeB(Player*playr, float spMin, float spMax, long totalTime); + static void homingB(Player*playr, int aNo, double aP, float speed); + static void singleProjectile(Player*playr, int aNo, double aP, Projectile*projectile); + static void normalSideB(Player*playr, int aNo, double aP, float xDist); + static void dashSideB(Player*playr, int aNo, double aP, float speed); + static void rollAttack(Player*playr, int aNo, double aP, float speed, int time); + static void launchUpB(Player*playr, int aNo, double aP, float yVeloc, float yVeloc2); + static void rehitUpB(Player*playr, int aNo, double aP, float yVeloc, float yVeloc2); + static void rehitUpB2(Player*playr, int aNo, double aP, float yVeloc, float yVeloc2); + static void normalDownB(Player*playr,int aNo,double aP); + static void prepareDownB(Player*playr, int aNo, double aP); + static void bounceDownB(Player*playr,int aNo,double aP,float speed); + static void normalSmash(Player*playr, int aNo, double aP, byte type, int smashType, long totalTime, int cMin, int cMax); + static void stopSmashAttack(Player*playr); + static void finalSmash(Player*playr, int aNo); + static void finishFinalSmash(Player*playr); + }; +} \ No newline at end of file diff --git a/SmashBros/BattlefieldBrawl.cpp b/SmashBros/BattlefieldBrawl.cpp new file mode 100755 index 0000000..ad7951e --- /dev/null +++ b/SmashBros/BattlefieldBrawl.cpp @@ -0,0 +1,105 @@ +#include "BattlefieldBrawl.h" + +namespace SmashBros +{ + BattlefieldBrawl::BattlefieldBrawl(int x1, int y1) : Stage(x1, y1) + { + setSpawnPoint(0, 0,0); + setSpawnPoint(1, 115, -70); + setSpawnPoint(2, -115, -70); + setSpawnPoint(3, 0,-135); + setSpawnPoint(4, 0, -35); + + bottomViewBorder = 276; + topViewBorder = -276; + leftViewBorder = -400; + rightViewBorder = 400; + + topBorder = -420; + + setItemBoundaries(-200, -225, 200, 60); + + loadGameElements(); + loadPlatforms(); + loadHangPoints(); + + setBackground("Images/Game/Stages/BattlefieldBrawl/bg.jpg"); + setBackgroundScale(1.45); + setBackgroundType(BG_FIXED); + + //this.setWireframeColor(Color.blue); + //this.showWireframes(true); + + MusicManager::loadSong("Battlefield v2"); + } + + BattlefieldBrawl::~BattlefieldBrawl() + { + // + } + + void BattlefieldBrawl::loadGameElements() + { + GameElement*bg; + + bg = new GameElement(0,30); + Animation*anim = new Animation("normal", 1,1,1); + anim->addFrame("Images/Game/Stages/BattlefieldBrawl/mainstage.png"); + bg->addAnimation(anim); + bg->changeAnimation("normal", FORWARD); + addElement(bg); + + bg = new GameElement(0,-70); + bg->addAnimation(new Animation("normal",1,"Images/Game/Stages/BattlefieldBrawl/plat_middle.png")); + bg->changeAnimation("normal", FORWARD); + addElement(bg); + + bg = new GameElement(-110, -2); + bg->addAnimation(new Animation("normal",1,"Images/Game/Stages/BattlefieldBrawl/plat_side.png")); + bg->changeAnimation("normal", FORWARD); + addElement(bg); + + bg = new GameElement(110, -2); + anim = new Animation("normal",1,"Images/Game/Stages/BattlefieldBrawl/plat_side.png"); + anim->mirror(true); + bg->addAnimation(anim); + bg->changeAnimation("normal", FORWARD); + addElement(bg); + } + + void BattlefieldBrawl::loadPlatforms() + { + Platform*plat; + + plat = new Platform(Platform::TYPE_NORMAL, 0,112); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/BattlefieldBrawl/main_plat.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -46, -74, 92, 10); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -154, -7, 90, 10); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, 66, -7, 90, 10); + addPlatform(plat); + } + + void BattlefieldBrawl::loadHangPoints() + { + HangPoint*hp; + + hp = new HangPoint(HangPoint::LEFT,-212,68); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,204,68); + addHangPoint(hp); + } + + void BattlefieldBrawl::Draw(Graphics2D&g, long gameTime) + { + Stage::Draw(g, gameTime); + } +} \ No newline at end of file diff --git a/SmashBros/BattlefieldBrawl.h b/SmashBros/BattlefieldBrawl.h new file mode 100755 index 0000000..4154638 --- /dev/null +++ b/SmashBros/BattlefieldBrawl.h @@ -0,0 +1,20 @@ +#include "Stage.h" + +#pragma once + +namespace SmashBros +{ + class BattlefieldBrawl : public Stage + { + private: + void loadGameElements(); + void loadPlatforms(); + void loadHangPoints(); + + public: + BattlefieldBrawl(int x1, int y1); + virtual ~BattlefieldBrawl(); + + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/BeamSword.cpp b/SmashBros/BeamSword.cpp new file mode 100755 index 0000000..2ca14f9 --- /dev/null +++ b/SmashBros/BeamSword.cpp @@ -0,0 +1,287 @@ +#include "BeamSword.h" +#include "Global.h" +#include "AttackTemplates.h" + +namespace SmashBros +{ + BeamSword::BeamSword(float x1, float y1) : Item(x1, y1, 300, TYPE_HOLD) + { + itemNo = Global::ITEM_BEAMSWORD; + + weight = 0.2f; + + active = false; + attackDir = 0; + smashPower = 0; + + setCollideType(COLLIDE_SOLID); + updateHitState(true); + + Animation*anim; + anim = new Animation("normal",1,"Images/Game/Items/BeamSword/beamsword.png"); + addAnimation(anim); + + anim = new Animation("carry_left",1,"Images/Game/Items/BeamSword/beamsword_carry.png"); + addAnimation(anim); + + anim = new Animation("carry_right",1,"Images/Game/Items/BeamSword/beamsword_carry.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("swing_left",18,6,1); + anim->addFrame("Images/Game/Items/BeamSword/beamsword_swing.png"); + addAnimation(anim); + + anim = new Animation("swing_right",18,6,1); + anim->addFrame("Images/Game/Items/BeamSword/beamsword_swing.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("swing2_left",32,8,1); + anim->addFrame("Images/Game/Items/BeamSword/beamsword_swing2.png"); + addAnimation(anim); + + anim = new Animation("swing2_right",32,8,1); + anim->addFrame("Images/Game/Items/BeamSword/beamsword_swing2.png"); + anim->mirror(true); + addAnimation(anim); + + changeAnimation("normal",FORWARD); + } + + BeamSword::~BeamSword() + { + // + } + + boolean BeamSword::holderCanDo() + { + if(active && (attackDir==ATTACK_NORMAL || attackDir==ATTACK_SMASH)) + { + return false; + } + return true; + } + + void BeamSword::onDiscard(Player*discarder) + { + active = false; + attackDir = 0; + smashPower = 0; + y-=height/2; + switch(discarder->getPlayerDir()) + { + case Player::LEFT: + xvelocity = 1.5f; + break; + + case Player::RIGHT: + xvelocity = -1.5f; + break; + } + yvelocity = -1.5f; + changeAnimation("normal",FORWARD); + } + + boolean BeamSword::chargeSmash() + { + Player*playr = getPlayer(); + AttackTemplates::normalSmash(playr, 0, 0, Player::STEP_CHARGE, 1, 16, 4, 11); + return true; + } + + boolean BeamSword::use(byte attackDir) + { + this->attackDir = attackDir; + if(attackDir==ATTACK_NORMAL) + { + if(!active) + { + active = true; + switch(getPlayer()->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("swing_left",FORWARD); + break; + + case Player::RIGHT: + changeAnimation("swing_right",FORWARD); + break; + } + } + return true; + } + else if(attackDir==ATTACK_SIDE) + { + if(!active) + { + Player*playr = getPlayer(); + if(attackDir==ATTACK_SMASH) + { + smashPower = playr->getSmashPower(); + AttackTemplates::stopSmashAttack(playr); + } + active = true; + switch(playr->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("swing2_left",FORWARD); + //playr.changeAnimation("melee_weapon_left", FORWARD); + break; + + case Player::RIGHT: + changeAnimation("swing2_right",FORWARD); + //playr.changeAnimation("melee_weapon_right", FORWARD); + break; + } + } + return true; + } + else if(attackDir==ATTACK_SMASH) + { + if(!active) + { + Player*playr = getPlayer(); + if(attackDir==ATTACK_SMASH) + { + smashPower = playr->getSmashPower(); + AttackTemplates::stopSmashAttack(playr); + } + active = true; + switch(playr->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("swing2_left",FORWARD); + playr->changeAnimation("melee_weapon_left", FORWARD); + break; + + case Player::RIGHT: + changeAnimation("swing2_right",FORWARD); + playr->changeAnimation("melee_weapon_right", FORWARD); + break; + } + } + return true; + } + return false; + } + + void BeamSword::onPlayerHit(Player*collide, byte dir) + { + if(isHeld()) + { + if(attackDir==ATTACK_NORMAL) + { + causeDamage(collide,2); + switch(getPlayer()->getPlayerDir()) + { + case Player::LEFT: + causeHurtLaunch(collide, -1,2,3, -1,1,2); + causeHurt(collide, Player::RIGHT, 3); + break; + + case Player::RIGHT: + causeHurtLaunch(collide, 1,2,3, -1,1,2); + causeHurt(collide, Player::LEFT, 3); + break; + } + } + else if(attackDir==ATTACK_SIDE) + { + causeDamage(collide,3); + switch(getPlayer()->getPlayerDir()) + { + case Player::LEFT: + causeHurtLaunch(collide, -1,3,3.5f, -1,2,2.3f); + causeHurt(collide, Player::RIGHT, 3); + break; + + case Player::RIGHT: + causeHurtLaunch(collide, 1,3,3.5f, -1,2,2.3f); + causeHurt(collide, Player::LEFT, 3); + break; + } + } + else if(attackDir==ATTACK_SMASH) + { + causeDamage(collide,smashPower); + switch(getPlayer()->getPlayerDir()) + { + case Player::LEFT: + causeHurtLaunch(collide, -1,2+((float)smashPower/4),2.1f, -1,2+((float)smashPower/4),2.6f); + causeHurt(collide, Player::RIGHT, 4); + break; + + case Player::RIGHT: + causeHurtLaunch(collide, 1,2+((float)smashPower/4),2.1f, -1,2+((float)smashPower/4),2.6f); + causeHurt(collide, Player::LEFT, 4); + break; + } + } + } + } + + void BeamSword::onAnimationFinish(const String&name) + { + if(name.equals("swing_left") || name.equals("swing_right") + || name.equals("swing2_left") || name.equals("swing2_right")) + { + active = false; + Player*playr = getPlayer(); + if(playr!=null) + { + switch(playr->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("carry_left",FORWARD); + break; + + case Player::RIGHT: + changeAnimation("carry_right",FORWARD); + break; + } + } + else + { + changeAnimation("normal",FORWARD); + } + } + } + + void BeamSword::Update(long gameTime) + { + Item::Update(gameTime); + if(active) + { + if(isHeld()) + { + setHitState(true); + setHoldOffset(0, 0); + } + } + else + { + setHitState(false); + if(isHeld()) + { + Player*playr = getPlayer(); + switch(playr->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("carry_left",FORWARD); + break; + + case Player::RIGHT: + changeAnimation("carry_right",FORWARD); + break; + } + setHoldOffset(4,-4); + } + else + { + active = false; + changeAnimation("normal",FORWARD); + } + } + } +} \ No newline at end of file diff --git a/SmashBros/BeamSword.h b/SmashBros/BeamSword.h new file mode 100755 index 0000000..f6ad02e --- /dev/null +++ b/SmashBros/BeamSword.h @@ -0,0 +1,27 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class BeamSword : public Item + { + private: + boolean active; + byte attackDir; + int smashPower; + + public: + BeamSword(float x1, float y1); + virtual ~BeamSword(); + + virtual void Update(long gameTime); + + virtual boolean holderCanDo(); + virtual void onDiscard(Player*discarder); + virtual boolean chargeSmash(); + virtual boolean use(byte attackDir); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onAnimationFinish(const String&name); + }; +} \ No newline at end of file diff --git a/SmashBros/Camera.cpp b/SmashBros/Camera.cpp new file mode 100755 index 0000000..0500df9 --- /dev/null +++ b/SmashBros/Camera.cpp @@ -0,0 +1,496 @@ +#include "Camera.h" + +namespace SmashBros +{ + float Camera::x = 0; + float Camera::y = 0; + float Camera::Zoom = 1; + + float Camera::prevCenterX = 0; + float Camera::prevCenterY = 0; + + boolean Camera::firstUpdate = true; + boolean Camera::firstFocus = true; + + const double Camera::zoomOutSpeed = 0.08; + const double Camera::zoomInSpeed = 0.016; + + byte Camera::mode = MODE_ZOOM; + + //Camera::PrevP2PData Camera::prevP2PData = {true, 0,0,0,0,0}; + + //View::x View::y x y Zoom + //4 4 4 4 4 = 20 + /*void Camera::handleAddP2PData(DataVoid&data) + { + if(prevP2PData.firstTime) + { + Bitset bits = Bitset("11111000"); + byte active = bits.getByte(); + data.add(&active, sizeof(active)); + data.add(&View::x, sizeof(View::x)); + data.add(&View::y, sizeof(View::y)); + data.add(&x, sizeof(x)); + data.add(&y, sizeof(y)); + data.add(&Zoom, sizeof(Zoom)); + + prevP2PData.firstTime = false; + prevP2PData.View_x = View::x; + prevP2PData.View_y = View::y; + prevP2PData.x = x; + prevP2PData.y = y; + prevP2PData.Zoom = Zoom; + } + else + { + char*active = "00000000"; + + if(prevP2PData.View_x!=View::x) + { + active[0] = '1'; + } + if(prevP2PData.View_y!=View::y) + { + active[1] = '1'; + } + if(prevP2PData.x!=x) + { + active[2] = '1'; + } + if(prevP2PData.y!=y) + { + active[3] = '1'; + } + if(prevP2PData.Zoom!=Zoom) + { + active[4] = '1'; + } + + String activeString = active; + + if(activeString.equals("00000000")) + { + return; + } + + Bitset bits = Bitset(active); + byte activeBytes = bits.getByte(); + data.add(&activeBytes, sizeof(activeBytes)); + + if(active[0]=='1') + { + data.add(&View::x, sizeof(View::x)); + } + if(active[1]=='1') + { + data.add(&View::y, sizeof(View::y)); + } + if(active[2]=='1') + { + data.add(&x, sizeof(x)); + } + if(active[3]=='1') + { + data.add(&y, sizeof(y)); + } + if(active[4]=='1') + { + data.add(&Zoom, sizeof(Zoom)); + } + prevP2PData.View_x = View::x; + prevP2PData.View_y = View::y; + prevP2PData.x = x; + prevP2PData.y = y; + prevP2PData.Zoom = Zoom; + } + } + + void Camera::handleSetP2PData(byte*&data) + { + byte active = data[0]; + data += sizeof(byte); + Bitset bits = Bitset(active); + + if(bits.get(0)) + { + //View::x + View::x = DataVoid::toFloat(data); + data += sizeof(float); + } + if(bits.get(1)) + { + //View::y + View::y = DataVoid::toFloat(data); + data += sizeof(float); + } + if(bits.get(2)) + { + //x + x = DataVoid::toFloat(data); + data += sizeof(float); + } + if(bits.get(3)) + { + //y + y = DataVoid::toFloat(data); + data += sizeof(float); + } + if(bits.get(4)) + { + //Zoom + Zoom = DataVoid::toFloat(data); + data += sizeof(float); + } + }*/ + + void Camera::reset() + { + firstUpdate = true; + firstFocus = true; + Zoom = 1; + x = 0; + y = 0; + mode = MODE_ZOOM; + } + + void Camera::Update() + { + RectangleF rect = getFocusRect(); + float camX; + float camY; + + Rect borders = Global::currentStage->getViewBorders(); + + switch(mode) + { + default: + case MODE_FIXED: + { + View::x = (float)(x + (float)Global::currentStage->x - (float)View::ScaleWidth()/2); + View::y = (float)(y + (float)Global::currentStage->y - (float)View::ScaleHeight()/2); + float zoomH = (float)View::ScaleHeight()/(float)(Global::currentStage->bottomViewBorder - Global::currentStage->topViewBorder); + float zoomW = (float)View::ScaleWidth()/(float)(Global::currentStage->rightViewBorder - Global::currentStage->leftViewBorder); + if(zoomH>zoomW) + { + Zoom = zoomH; + } + else + { + Zoom = zoomW; + } + float centerX = (float)(x + Global::currentStage->x); + float centerY = (float)(y + Global::currentStage->y); + + float left = (float)(centerX - ((float)View::ScaleWidth()/((float)2*Zoom))); + float right = (float)(centerX +((float)View::ScaleWidth()/((float)2*Zoom))); + float top = (float)(centerY - ((float)View::ScaleHeight()/((float)2*Zoom))); + float bottom = (float)(centerY +((float)View::ScaleHeight()/((float)2*Zoom))); + + if(left<(Global::currentStage->x + Global::currentStage->leftViewBorder)) + { + centerX = (float)((Global::currentStage->x + Global::currentStage->leftViewBorder) + View::ScaleWidth()/(Zoom*2)); + } + else if(right>(Global::currentStage->x + Global::currentStage->rightViewBorder)) + { + centerX = (float)((Global::currentStage->x + Global::currentStage->rightViewBorder) - View::ScaleWidth()/(Zoom*2)); + } + if(top<(Global::currentStage->y + Global::currentStage->topViewBorder)) + { + centerY = (float)((Global::currentStage->y + Global::currentStage->topViewBorder) + View::ScaleHeight()/(Zoom*2)); + } + else if(bottom>(Global::currentStage->y + Global::currentStage->bottomViewBorder)) + { + centerY = (float)((Global::currentStage->y + Global::currentStage->bottomViewBorder) - View::ScaleHeight()/(Zoom*2)); + } + camX = (float)((centerX*Zoom) - ((float)View::ScaleWidth()/2)); + camY = (float)((centerY*Zoom) - ((float)View::ScaleHeight()/2)); + + View::x = camX; + View::y = camY; + } + break; + + case MODE_FOLLOW: + { + camX = (float)(((float)rect.x*Zoom) - (((float)View::ScaleWidth() - ((float)rect.width*Zoom))/2)); + camY = (float)(((float)rect.y*Zoom) - (((float)View::ScaleHeight() - ((float)rect.height*Zoom))/2)); + + float leftSide = (float)((Global::currentStage->x + borders.left)*Zoom); + float rightSide = (float)((Global::currentStage->x + borders.right)*Zoom); + float topSide = (float)((Global::currentStage->y + borders.top)*Zoom); + float bottomSide = (float)((Global::currentStage->y + borders.bottom)*Zoom); + + if(camX < leftSide) + { + camX = leftSide; + } + else if((camX + View::ScaleWidth()) > rightSide) + { + camX = (rightSide - View::ScaleWidth()); + } + if(camY < topSide) + { + camY = topSide; + } + else if((camY + View::ScaleHeight()) > bottomSide) + { + camY = (bottomSide - View::ScaleHeight()); + } + + View::x = (float)((x*Zoom) + camX); + View::y = (float)((y*Zoom) + camY); + } + break; + + case MODE_ZOOM: + { + float zoomW = (float)View::ScaleWidth()/(float)rect.width; + float zoomH = (float)View::ScaleHeight()/(float)rect.height; + float expzoom; + + if((rect.width*zoomH) > View::ScaleWidth()) + { + expzoom = zoomW; + //Zoom = zoomW; + } + else + { + expzoom = zoomH; + //Zoom = zoomH; + } + + float zoomx = (float)View::ScaleWidth()/(borders.right - borders.left); + float zoomy = (float)View::ScaleHeight()/(borders.bottom - borders.top); + float cmpzoom; + + float setZoom; + + if(zoomx > zoomy) + { + cmpzoom = zoomx; + } + else + { + cmpzoom = zoomy; + } + + if(expzoom < cmpzoom) + { + setZoom = cmpzoom; + } + else + { + setZoom = expzoom; + } + + //Zoom = setZoom; + + if(setZoom zoomOutSpeed) + { + Zoom -= (float)zoomOutSpeed; + } + else + { + Zoom = setZoom; + } + } + else if(setZoom>Zoom) + { + if((setZoom - Zoom)> zoomInSpeed) + { + Zoom += (float)zoomInSpeed; + } + else + { + Zoom = setZoom; + } + } + + //g.setColor(Color::BLUE); + //g.drawRect((int)(rect.x*Zoom), (int)(rect.y*Zoom), (int)(rect.width*Zoom), (int)(rect.height*Zoom)); + + camX = (float)(((float)rect.x*Zoom) - (((float)View::ScaleWidth() - ((float)rect.width*Zoom))/2)); + camY = (float)(((float)rect.y*Zoom) - (((float)View::ScaleHeight() - ((float)rect.height*Zoom))/2)); + + float leftSide = (float)((Global::currentStage->x + borders.left)*Zoom); + float rightSide = (float)((Global::currentStage->x + borders.right)*Zoom); + float topSide = (float)((Global::currentStage->y + borders.top)*Zoom); + float bottomSide = (float)((Global::currentStage->y + borders.bottom)*Zoom); + + if(camX < leftSide) + { + camX = leftSide; + } + else if((camX + View::ScaleWidth()) > rightSide) + { + camX = (rightSide - View::ScaleWidth()); + } + if(camY < topSide) + { + camY = topSide; + } + else if((camY + View::ScaleHeight()) > bottomSide) + { + camY = (bottomSide - View::ScaleHeight()); + } + + float centerX = (float)((camX + ((float)View::ScaleWidth()/2))/Zoom); + float centerY = (float)((camY + ((float)View::ScaleHeight()/2))/Zoom); + + if(firstUpdate) + { + centerX = (float)Global::currentStage->x; + centerY = (float)Global::currentStage->y; + float zoom1 = (float)View::ScaleWidth()/(float)(borders.right - borders.left); + float zoom2 = (float)View::ScaleHeight()/(float)(borders.bottom - borders.top); + if(zoom1 > zoom2) + { + Zoom = zoom1; + } + else + { + Zoom = zoom2; + } + } + else + { + if(!firstFocus) + { + if(centerX < prevCenterX) + { + if((prevCenterX - centerX) > moveSpeed) + { + centerX = prevCenterX - moveSpeed; + } + } + else if(prevCenterX < centerX) + { + if((centerX - prevCenterX) > moveSpeed) + { + centerX = prevCenterX + moveSpeed; + } + } + + if(centerY < prevCenterY) + { + if((prevCenterY - centerY) > moveSpeed) + { + centerY = prevCenterY - moveSpeed; + } + } + else if(prevCenterY < centerY) + { + if((centerY - prevCenterY) > moveSpeed) + { + centerY = prevCenterY + moveSpeed; + } + } + } + + camX = (float)((centerX*Zoom) - ((float)View::ScaleWidth()/2)); + camY = (float)((centerY*Zoom) - ((float)View::ScaleHeight()/2)); + + firstFocus = false; + } + + prevCenterX = centerX; + prevCenterY = centerY; + + View::x = (float)((x*Zoom) + camX); + View::y = (float)((y*Zoom) + camY); + } + break; + } + firstUpdate = false; + } + + void Camera::setMode(byte camera_mode) + { + mode = camera_mode; + } + + RectangleF Camera::getFocusRect() + { + RectangleF rect; + + Vector2f ws; + Vector2f hs; + float w = 0; + float h = 0; + + for(int i=1; i<=Global::possPlayers; i++) + { + for(int j=1; j<=Global::possPlayers; j++) + { + if(Global::characters[i]==null || !Global::characters[i]->isAlive()) + { + j=(Global::possPlayers+1); + } + else if(Global::characters[j]==null || !Global::characters[j]->isAlive()) + { + // + } + else + { + float w1 = abs(Global::characters[i]->x - Global::characters[j]->x) + (Global::characters[i]->width/2) + (Global::characters[j]->width/2) + 2*offset; + float h1 = abs(Global::characters[i]->y - Global::characters[j]->y) + (Global::characters[i]->height/2) + (Global::characters[j]->height/2) + 2*offset; + if(w1>w || w==0) + { + w = w1; + if(Global::characters[i]->x < Global::characters[j]->x) + { + ws.x = Global::characters[i]->x; + ws.y = (float)Global::characters[i]->width; + } + else + { + ws.x = Global::characters[j]->x; + ws.y = (float)Global::characters[j]->width; + } + } + if(h1>h || h==0) + { + h = h1; + if(Global::characters[i]->y < Global::characters[j]->y) + { + hs.x = Global::characters[i]->y; + hs.y = (float)Global::characters[i]->height; + } + else + { + hs.x = Global::characters[j]->y; + hs.y = (float)Global::characters[j]->height; + } + } + } + } + } + + rect.x = ws.x - ws.y/2 - offset; + rect.y = hs.x - hs.y/2 - offset; + rect.width = w; + rect.height = h + bottomOffset; + + if(rect.width <=1 || rect.height<=1) + { + rect.width = 300; + rect.height = 300; + rect.x = Global::currentStage->x - rect.width/2; + rect.y = Global::currentStage->y - rect.height/2; + } + + return rect; + } + + int Camera::Width() + { + return (int)((double)View::ScaleWidth()/Zoom); + } + + int Camera::Height() + { + return (int)((double)View::ScaleHeight()/Zoom); + } +} \ No newline at end of file diff --git a/SmashBros/Camera.h b/SmashBros/Camera.h new file mode 100755 index 0000000..8920e96 --- /dev/null +++ b/SmashBros/Camera.h @@ -0,0 +1,59 @@ +#include "Global.h" + +#pragma once + +namespace SmashBros +{ + class Camera + { + friend class P2PDataManager; + private: + /*typedef struct + { + bool firstTime; + float View_x; + float View_y; + float x; + float y; + float Zoom; + } PrevP2PData; + + static PrevP2PData prevP2PData;*/ + + static float prevCenterX; + static float prevCenterY; + + static boolean firstUpdate; + static boolean firstFocus; + + static byte mode; + + static const int offset = 50; + static const int bottomOffset = 60; + + static RectangleF getFocusRect(); + + //static void handleAddP2PData(DataVoid&data); + //static void handleSetP2PData(byte*&data); + + public: + static float x; + static float y; + static float Zoom; + + static const int moveSpeed = 8; + static const double zoomOutSpeed; + static const double zoomInSpeed; + + static const byte MODE_FIXED = 0; + static const byte MODE_FOLLOW = 1; + static const byte MODE_ZOOM = 2; + + static void reset(); + static void Update(); + static void setMode(byte camera_mode); + + static int Width(); + static int Height(); + }; +} \ No newline at end of file diff --git a/SmashBros/CharSelectScreen.cpp b/SmashBros/CharSelectScreen.cpp new file mode 100755 index 0000000..082d695 --- /dev/null +++ b/SmashBros/CharSelectScreen.cpp @@ -0,0 +1,920 @@ +#include "CharSelectScreen.h" +#include "Global.h" +#include "Menus.h" + +namespace SmashBros +{ + void CharSelectScreen::createCharIcons()//TODO: add characters + { + newCharIcon(Global::CHAR_MARIO,"Images/Menus/CharacterSelect/icons/mario.png"); + newCharIcon(Global::CHAR_ICHIGO,"Images/Menus/CharacterSelect/icons/ichigo.png"); + newCharIcon(Global::CHAR_SONIC,"Images/Menus/CharacterSelect/icons/sonic.png"); + newCharIcon(Global::CHAR_FOX,"Images/Menus/CharacterSelect/icons/fox.png"); + //newCharIcon(Global.CHAR_PIKACHU,"Images/Menus/CharacterSelect/icons/pikachu.png"); + charSelectArea->width = 472; + charSelectArea->height = 60; + } + + void CharSelectScreen::loadCharPreviews(int num)//TODO: add characters + { + Actor*a = charPreviews.get(num-1); + for(int i=1; i<=Global::totalCharacters; i++) + { + switch(i) + { + case Global::CHAR_MARIO: + a->addAnimation(new Animation("Mario",1,"Images/Menus/CharacterSelect/previews/mario.png")); + break; + + case Global::CHAR_ICHIGO: + a->addAnimation(new Animation("Ichigo",1,"Images/Menus/CharacterSelect/previews/ichigo.png")); + break; + + case Global::CHAR_SONIC: + a->addAnimation(new Animation("Sonic",1,"Images/Menus/CharacterSelect/previews/sonic.png")); + break; + + case Global::CHAR_FOX: + a->addAnimation(new Animation("Fox",1,"Images/Menus/CharacterSelect/previews/fox.png")); + break; + + case Global::CHAR_PIKACHU: + a->addAnimation(new Animation("Pikachu",1,"Images/Menus/CharacterSelect/previews/pikachu.png")); + break; + } + } + a->changeAnimation("Mario",FORWARD); + a->Scale = 2.0f; + a->setAlpha(1); + } + + CharSelectScreen::CharSelectScreen(const String&name) : Screen(name) + { + canGrabCoin = false; + selectedCoin = 0; + cardTypes = null; + charSelectArea = null; + coinPoints = null; + cardAvailable = null; + } + + CharSelectScreen::~CharSelectScreen() + { + for(int i=0; i types; + for(int i=1; i<=4; i++) + { + types.add(0); + } + createCards(types); + createCharIcons(); + resetCards(types); + } + + void CharSelectScreen::LoadContent() + { + //Menus::menuNo=3; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + } + + void CharSelectScreen::UnloadContent() + { + // + } + + void CharSelectScreen::Update(long gameTime) + { + if(Global::gameFinished) + { + Global::gameFinished = false; + Global::onReturnToMenu(); + Menus::playSong("Menu Theme"); + } + charSelectArea->Update(gameTime); + for(int i=0; iUpdate(gameTime); + setCardAnimation(i+1); + } + for(int i=0; iUpdate(gameTime); + } + int skip = selectedCoin-1; + canGrabCoin=true; + if(selectedCoin>0) + { + charCoins.get(selectedCoin-1)->Update(gameTime); + if(charCoins.get(selectedCoin-1)->isClicked()) + { + canGrabCoin = false; + } + else + { + selectedCoin = 0; + } + } + for(int i=0; iUpdate(gameTime); + if(charCoins.get(i)->isClicked()) + { + canGrabCoin = false; + selectedCoin = i+1; + } + } + } + for(int i=0; irectsColliding(charIconPoints.get(j))) + { + int selected=charIcons.get(j)->num; + if(selected != Global::selectedChar[i]) + { + onSelectCharacter(i+1, selected); + } + Global::selectedChar[i]=selected; + j=charIconPoints.size(); + } + } + if(!charCoins.get(i)->rectsColliding(charSelectArea)) + { + if(Global::selectedChar[i]!=0) + { + onSelectCharacter(i+1, 0); + } + Global::selectedChar[i]=0; + } + if(charCoins.get(i)->isClicked() && !charCoins.get(i)->wasClicked() && !cardAvailable[i]) + { + switch(cardTypes[i]) + { + default: + cardAvailable[i] = true; + Global::CPU[i] = false; + break; + + case 2: + case 3: + cardAvailable[i] = true; + Global::CPU[i] = true; + break; + } + } + else if(!charCoins.get(i)->isClicked() && charCoins.get(i)->wasClicked() && Global::selectedChar[i]==0) + { + cardAvailable[i] = false; + Global::CPU[i] = false; + } + } + } + for(int i=0; isetAlpha(1); + } + else + { + charPreviews.get(i)->setAlpha(0); + charPreviews.get(i)->changeAnimation(Global::getCharName(cNum), NO_CHANGE); + } + charPreviews.get(i)->Update(gameTime); + charNames.get(i)->Update(gameTime); + charNames.get(i)->setText(Global::getCharName(cNum)); + } + Menus::button_back->Update(gameTime); + } + + void CharSelectScreen::Draw(Graphics2D&g, long gameTime) + { + Menus::button_back->Draw(g, gameTime); + charSelectArea->Draw(g,gameTime); + for(int i=0; iDraw(g, gameTime); + } + for(int i=0; iDraw(g, gameTime); + } + for(int i=0; iDraw(g, gameTime); + } + for(int i=0; iDraw(g, gameTime); + } + for(int i=0; iDraw(g, gameTime); + } + for(int i=(charCoins.size()-1); i>=0; i--) + { + if(!coinHidden(i)) + { + charCoins.get(i)->Draw(g, gameTime); + } + } + } + + void CharSelectScreen::onSelectCharacter(int player, int character) + { + //Open for implementation + } + + void CharSelectScreen::selectCharacter(int player, int character) + { + Global::selectedChar[player-1]=character; + if(character!=0) + { + CharCoin*charCoin = charCoins.get(player-1); + charCoin->x = charIcons.get(character-1)->x; + charCoin->y = charIcons.get(character-1)->y; + } + } + + void CharSelectScreen::selectRandomCharacter(int player) + { + int select = (int)(GameEngine::random()*charIcons.size()); + int index = player-1; + CharCoin*charCoin = charCoins.get(index); + charCoin->x = charIcons.get(select)->x; + charCoin->y = charIcons.get(select)->y; + } + + boolean CharSelectScreen::checkReadyToFight(int minPlayers) + { + if(Global::teamBattle) + { + ArrayList selected; + for(int i=0; i0) + { + selected.add(i+1); + } + } + if(selected.size()>=minPlayers) + { + ArrayList teamTotals; + for(int i=0; i<=Global::possTeams; i++) + { + teamTotals.add(0); + } + + for(int i=0; i0) + { + activeTeams++; + if(activeTeams>1) + { + return true; + } + } + } + + if(activeTeams>1) + { + return true; + } + return false; + } + return false; + } + else + { + int total = 0; + for(int i=0; i0) + { + total++; + } + } + if(total>=minPlayers) + { + return true; + } + } + return false; + } + + boolean CharSelectScreen::coinsClicked() + { + for(int i=0; iisClicked()) + { + return true; + } + } + return false; + } + + void CharSelectScreen::createCards(ArrayList type) + { + int total = type.size(); + + if(charSelectArea!=null) + { + delete charSelectArea; + charSelectArea = null; + } + if(coinPoints!=null) + { + delete[] coinPoints; + coinPoints = null; + } + if(cardTypes!=null) + { + delete[] cardTypes; + cardTypes = null; + } + if(cardAvailable!=null) + { + delete[] cardAvailable; + cardAvailable = null; + } + + for(int i=0; isetVisible(true); + int space = View::ScaleWidth()/(total); + for(int i=1; i<=total; i++) + { + Global::CPU[i-1]=false; + cardAvailable[i-1]=false; + cardTypes[i-1] = (byte)type.get(i-1); + Actor*a = setUpCard(i,type.get(i-1)); + a->Scale = 1.65f; + Actor*a2 = new Actor(0,0); + TextActor*a3 = new TextActor(" ", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 12), Color::WHITE); + a3->setAlignment(TextActor::ALIGN_CENTER); + addToGrid(a,100+(space/10),500,type.size(),1,space,0,i); + a2->x = a->x; + a2->y = a->y - 10; + a3->x = a->x - 5; + a3->y = a->y + 43; + charCards.add(a); + charPreviews.add(a2); + charNames.add(a3); + addCardAnimations(i); + loadCharPreviews(i); + } + createCharCoins(total); + } + + void CharSelectScreen::createCharCoins(int num) + { + for(int i=1; i<=num; i++) + { + CharCoin*a = new CharCoin(this,i); + int space = View::ScaleWidth()/(num); + addToGrid(a,25+(space/10),500,num,1,space,0,i); + coinPoints[i-1].x=(int)a->x; + coinPoints[i-1].y=(int)a->y; + a->Scale = 1.4f; + charCoins.add(a); + } + } + + void CharSelectScreen::newCharIcon(int num, String anim) + { + CharIcon*a = new CharIcon(num, 0,0, new Animation("normal",1,anim)); + a->Scale = 1.8f; + addToGrid(a,70,115,9,5,95,65,charIcons.size()+1); + if(charIcons.size()==0) + { + charSelectArea->x = a->x - 46; + charSelectArea->y = a->y - 30; + } + WireframeActor*a2 = new WireframeActor(a->x-20,a->y-20,40,40); + //a2->setVisible(true); + charIconPoints.add(a2); + charIcons.add(a); + } + + void CharSelectScreen::setCardState(int card, bool cardOn, bool cpu) + { + cardAvailable[card] = cardOn; + Global::CPU[card] = cpu; + } + + void CharSelectScreen::clickCharCard(int num) + { + if(!cardAvailable[num-1]) + { + cardAvailable[num-1]=true; + } + else if(!Global::CPU[num-1]) + { + Global::CPU[num-1]=true; + } + else + { + Global::CPU[num-1]=false; + cardAvailable[num-1]=false; + charCoins.get(num-1)->moveTo((float)coinPoints[num-1].x, (float)coinPoints[num-1].y, 45); + } + } + + void CharSelectScreen::clickCharCardFirstCPU(int num) + { + if(!cardAvailable[num-1]) + { + cardAvailable[num-1]=true; + Global::CPU[num-1]=true; + } + else if(Global::CPU[num-1]) + { + Global::CPU[num-1]=false; + } + else + { + Global::CPU[num-1]=false; + cardAvailable[num-1]=false; + charCoins.get(num-1)->moveTo((float)coinPoints[num-1].x, (float)coinPoints[num-1].y, 45); + } + } + + void CharSelectScreen::clickCharCardOnlyCPU(int num) + { + if(!cardAvailable[num-1]) + { + cardAvailable[num-1]=true; + Global::CPU[num-1]=true; + } + else + { + cardAvailable[num-1]=false; + Global::CPU[num-1]=false; + charCoins.get(num-1)->moveTo((float)coinPoints[num-1].x, (float)coinPoints[num-1].y, 45); + } + } + + void CharSelectScreen::clickCharCardOnlyHMU(int num) + { + if(!cardAvailable[num-1]) + { + cardAvailable[num-1]=true; + Global::CPU[num-1]=false; + } + else + { + cardAvailable[num-1]=false; + Global::CPU[num-1]=false; + charCoins.get(num-1)->moveTo((float)coinPoints[num-1].x, (float)coinPoints[num-1].y, 45); + } + } + + void CharSelectScreen::resetCards(ArrayList type) + { + for(int i=0; ix = (float)coinPoints[i].x; + charCoins.get(i)->y = (float)coinPoints[i].y; + } + + for(int i=0; i<=Global::possPlayers; i++) + { + Global::currentTeams[i] = Global::TEAM_RED; + } + + Global::teamBattle = false; + } + + void CharSelectScreen::setCardType(int card, byte type) + { + cardTypes[card] = type; + } + + void CharSelectScreen::hideCoin(int num, boolean toggle) + { + for(int i=0; ichangeAnimation("NA", FORWARD); + } + else if(Global::CPU[num-1]) + { + charCards.get(num-1)->changeAnimation("CPU", FORWARD); + } + else + { + charCards.get(num-1)->changeAnimation("HMU", FORWARD); + } + } + + void CharSelectScreen::addCardAnimations(int num) + { + charCards.get(num-1)->addAnimation(new Animation("NA",1,"Images/Menus/CharacterSelect/cards/na.png")); + charCards.get(num-1)->addAnimation(new Animation("CPU",1,"Images/Menus/CharacterSelect/cards/cpu.png")); + switch(num) + { + case 1: + charCards.get(num-1)->addAnimation(new Animation("HMU",1,"Images/Menus/CharacterSelect/cards/p1_red.png")); + break; + + case 2: + charCards.get(num-1)->addAnimation(new Animation("HMU",1,"Images/Menus/CharacterSelect/cards/p2_blue.png")); + break; + + case 3: + charCards.get(num-1)->addAnimation(new Animation("HMU",1,"Images/Menus/CharacterSelect/cards/p3_yellow.png")); + break; + + case 4: + charCards.get(num-1)->addAnimation(new Animation("HMU",1,"Images/Menus/CharacterSelect/cards/p4_green.png")); + break; + } + charCards.get(num-1)->changeAnimation("NA", FORWARD); + } + + void CharSelectScreen::addToGrid(Actor*a,int x1,int y1,int xAmount,int yAmount,int xspace,int yspace,int num) + { + int xLoc; + int yLoc; + int xCreate; + int yCreate; + if(num>xAmount) + { + xLoc = ((num-1)%xAmount)+1; + yLoc = ((num-1)/xAmount)+1; + } + else + { + xLoc=num; + yLoc=1; + } + xCreate=x1+(xspace*(xLoc-1)); + yCreate=y1+(yspace*(yLoc-1)); + a->x=(float)xCreate; + a->y=(float)yCreate; + } + + Actor*CharSelectScreen::setUpCard(int num, int cType) + { + Actor*a; + a = new CharCard(this,0,0,num,cType); + return a; + } + + CharSelectScreen::CharCoin::CharCoin(CharSelectScreen*screen,int num) : Actor(0,0) + { + drag = false; + dragId = 0; + this->screen = screen; + Animation*anim; + switch(num) + { + default: + anim = new Animation("normal",1,"Images/Menus/CharacterSelect/coins/coin.png"); + break; + + case 1: + anim = new Animation("normal",1,"Images/Menus/CharacterSelect/coins/coin1.png"); + break; + + case 2: + anim = new Animation("normal",1,"Images/Menus/CharacterSelect/coins/coin2.png"); + break; + + case 3: + anim = new Animation("normal",1,"Images/Menus/CharacterSelect/coins/coin3.png"); + break; + + case 4: + anim = new Animation("normal",1,"Images/Menus/CharacterSelect/coins/coin4.png"); + break; + } + addAnimation(anim); + changeAnimation("normal",FORWARD); + } + + CharSelectScreen::CharCoin::~CharCoin() + { + // + } + + void CharSelectScreen::CharCoin::onClick() + { + if(screen->canGrabCoin) + { + drag = true; + dragId = getTouchId(); + } + } + + void CharSelectScreen::CharCoin::onRelease() + { + drag = false; + } + + void CharSelectScreen::CharCoin::Update(long gameTime) + { + Actor::Update(gameTime); + if(drag && Game::checkTouchActive(dragId)) + { + x = (float)Game::TouchX(dragId); + y = (float)Game::TouchY(dragId); + } + else + { + drag = false; + } + } + + CharSelectScreen::CharIcon::CharIcon(int num, float x1, float y1, Animation*anim) : Actor(x1,y1) + { + addAnimation(anim); + changeAnimation(anim->name, FORWARD); + this->num = num; + } + + CharSelectScreen::CharIcon::~CharIcon() + { + // + } + + CharSelectScreen::CharCard::TeamFlag::TeamFlag(float x1, float y1, int num) : Actor(x1,y1) + { + this->num = num; + } + + CharSelectScreen::CharCard::TeamFlag::~TeamFlag() + { + // + } + + void CharSelectScreen::CharCard::TeamFlag::onRelease() + { + if(Global::currentTeams[num]==Global::TEAM_RED) + { + Global::currentTeams[num]=Global::TEAM_BLUE; + } + else if(Global::currentTeams[num]==Global::TEAM_BLUE) + { + Global::currentTeams[num]=Global::TEAM_GREEN; + } + else + { + Global::currentTeams[num] = Global::TEAM_RED; + } + } + + CharSelectScreen::CharCard::CharCard(CharSelectScreen*screen,float x1,float y1, int pNum, int type) : Actor(x1,y1) + { + this->screen = screen; + this->type = type; + this->num = pNum; + Animation*anim = new Animation("normal",1); + anim->addFrame("Images/Menus/CharacterSelect/cards/na.png"); + addAnimation(anim); + + Global::currentTeams[num] = Global::TEAM_RED; + + teamFlag = new TeamFlag(0,0, num); + + teamFlag->addAnimation(new Animation("red",1, "Images/Menus/CharacterSelect/flags/red.png")); + teamFlag->addAnimation(new Animation("blue",1, "Images/Menus/CharacterSelect/flags/blue.png")); + teamFlag->addAnimation(new Animation("green",1, "Images/Menus/CharacterSelect/flags/green.png")); + teamFlag->changeAnimation("red", FORWARD); + + teamFlag->Scale = 1.4f; + } + + CharSelectScreen::CharCard::~CharCard() + { + delete teamFlag; + } + + void CharSelectScreen::CharCard::onRelease() + { + if(!screen->cardChangeDisabled(num-1) && !screen->coinsClicked() && !teamFlag->mouseOver() && !teamFlag->isClicked() && !teamFlag->wasClicked()) + { + switch(type) + { + default: + screen->clickCharCard(num); + break; + + case 1: + screen->clickCharCardOnlyHMU(num); + break; + + case 2: + screen->clickCharCardFirstCPU(num); + break; + + case 3: + screen->clickCharCardOnlyCPU(num); + break; + } + } + } + + void CharSelectScreen::CharCard::Update(long gameTime) + { + if(Global::teamBattle) + { + teamFlag->Update(gameTime); + switch(Global::currentTeams[num]) + { + default: + Global::currentTeams[num] = Global::TEAM_RED; + case Global::TEAM_RED: + teamFlag->changeAnimation("red", FORWARD); + break; + + case Global::TEAM_BLUE: + teamFlag->changeAnimation("blue", FORWARD); + break; + + case Global::TEAM_GREEN: + teamFlag->changeAnimation("green", FORWARD); + break; + } + } + Actor::Update(gameTime); + } + + void CharSelectScreen::CharCard::Draw(Graphics2D&g, long gameTime) + { + Actor::Draw(g, gameTime); + if(Global::teamBattle) + { + teamFlag->x = x + 30; + teamFlag->y = y - 60; + teamFlag->Draw(g, gameTime); + } + } +} \ No newline at end of file diff --git a/SmashBros/CharSelectScreen.h b/SmashBros/CharSelectScreen.h new file mode 100755 index 0000000..025d00e --- /dev/null +++ b/SmashBros/CharSelectScreen.h @@ -0,0 +1,122 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class CharSelectScreen : public Screen + { + private: + class CharCoin : public Actor + { + friend class CharSelectScreen; + private: + CharSelectScreen*screen; + boolean drag; + long dragId; + + public: + CharCoin(CharSelectScreen*screen,int num); + virtual ~CharCoin(); + + virtual void onClick(); + virtual void onRelease(); + virtual void Update(long gameTime); + }; + + class CharIcon : public Actor + { + public: + int num; + CharIcon(int num, float x1, float y1, Animation*anim); + virtual ~CharIcon(); + }; + + class CharCard : public Actor + { + private: + int type; + int num; + CharSelectScreen*screen; + + class TeamFlag : public Actor + { + private: + int num; + public: + TeamFlag(float x1, float y1, int num); + virtual ~TeamFlag(); + virtual void onRelease(); + }; + + TeamFlag*teamFlag; + public: + CharCard(CharSelectScreen*screen,float x1,float y1, int pNum, int type); + virtual ~CharCard(); + + virtual void onRelease(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + ArrayList charCards; + ArrayList charIcons; + ArrayList charIconPoints; + ArrayList charCoins; + ArrayList charPreviews; + ArrayList charNames; + + ArrayList hiddenCoins; + ArrayList disabledCards; + + boolean canGrabCoin; + int selectedCoin; + WireframeActor*charSelectArea; + + Vector2i*coinPoints; + byte*cardTypes; + boolean*cardAvailable; + + void clickCharCard(int num); + void clickCharCardFirstCPU(int num); + void clickCharCardOnlyCPU(int num); + void clickCharCardOnlyHMU(int num); + void setCardAnimation(int num); + void addCardAnimations(int num); + void addToGrid(Actor*a,int x1,int y1,int xAmount,int yAmount,int xspace,int yspace,int num); + Actor*setUpCard(int num, int cType); + + boolean coinHidden(int num); + + protected: + void loadCharPreviews(int num); + void selectCharacter(int player, int character); + void selectRandomCharacter(int player); + boolean checkReadyToFight(int minPlayers); + boolean coinsClicked(); + void setCardType(int card, byte type); + void hideCoin(int num, boolean toggle); + void disableCardChange(int card); + void enableCardChange(int card); + boolean cardChangeDisabled(int card); + void setCardState(int card, bool cardOn, bool cpu); + void createCharCoins(int num); + void newCharIcon(int num, String anim); + void resetCards(ArrayList type); + + public: + CharSelectScreen(const String&name); + virtual ~CharSelectScreen(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void onSelectCharacter(int player, int character); + + void createCharIcons(); + void createCards(ArrayList type); + }; +} \ No newline at end of file diff --git a/SmashBros/Chargebar.cpp b/SmashBros/Chargebar.cpp new file mode 100755 index 0000000..704c140 --- /dev/null +++ b/SmashBros/Chargebar.cpp @@ -0,0 +1,69 @@ +#include "Chargebar.h" +#include "Player.h" +#include "Global.h" + +namespace SmashBros +{ + Chargebar::Chargebar(byte playerNo, float cMin, float cMax, long totalTime, byte type) + { + inactive = false; + + this->playerNo = playerNo; + + currentPower = cMin; + totalPower = cMax; + + increment = (cMax - cMin)/totalTime; + + finishTime = Global::getWorldTime() + totalTime; + + this->type = type; + + lastTime = Global::getWorldTime(); + } + + Chargebar::~Chargebar() + { + // + } + + void Chargebar::Update(long gameTime) + { + if(Global::getWorldTime() >= finishTime) + { + currentPower = totalPower; + Player*playr = Global::getPlayerActor(playerNo); + playr->smashPower = (int)currentPower; + switch(type) + { + case TYPE_SPECIALATTACK: + playr->onFinishCharge(); + break; + + case TYPE_SMASHATTACK: + switch(playr->chargeSmash) + { + case 1: + playr->attackSideSmash(Player::STEP_GO); + break; + + case 2: + playr->attackUpSmash(Player::STEP_GO); + break; + + case 3: + playr->attackDownSmash(Player::STEP_GO); + break; + } + playr->chargingAttack = false; + break; + } + inactive = true; + } + else if(lastTime < Global::getWorldTime()) + { + lastTime = Global::getWorldTime(); + currentPower+=increment; + } + } +} \ No newline at end of file diff --git a/SmashBros/Chargebar.h b/SmashBros/Chargebar.h new file mode 100755 index 0000000..c4c2149 --- /dev/null +++ b/SmashBros/Chargebar.h @@ -0,0 +1,34 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class Chargebar + { + friend class AttackTemplates; + friend class Player; + private: + boolean inactive; + + float currentPower; + float totalPower; + float increment; + + long finishTime; + long lastTime; + + byte playerNo; + + byte type; + + public: + static const byte TYPE_SPECIALATTACK = 1; + static const byte TYPE_SMASHATTACK = 2; + + Chargebar(byte playerNo, float cMin, float cMax, long totalTime, byte type); + virtual ~Chargebar(); + + virtual void Update(long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/CollisionManager.cpp b/SmashBros/CollisionManager.cpp new file mode 100755 index 0000000..cf9caa0 --- /dev/null +++ b/SmashBros/CollisionManager.cpp @@ -0,0 +1,53 @@ +#include "CollisionManager.h" + +namespace SmashBros +{ + CollisionManager::CollisionManager() + { + collisions = ArrayList(); + } + + CollisionManager::~CollisionManager() + { + collisions.clear(); + } + + void CollisionManager::addCollision(int id) + { + if(!isColliding(id)) + { + collisions.add(id); + } + } + + void CollisionManager::removeCollision(int id) + { + for(int i=0; i collisions; + + public: + CollisionManager(); + virtual ~CollisionManager(); + + void addCollision(int id); + void removeCollision(int id); + void clear(); + boolean isColliding(int id); + }; +} \ No newline at end of file diff --git a/SmashBros/Controls.cpp b/SmashBros/Controls.cpp new file mode 100755 index 0000000..3a1d358 --- /dev/null +++ b/SmashBros/Controls.cpp @@ -0,0 +1,2570 @@ +#include "Controls.h" +#include "Global.h" +#include "Game.h" +#include "AttackTemplates.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + int**Controls::controls = null; + Controls::ControlHUD*Controls::touchControls = null; + bool Controls::touchEnabled = true; + bool Controls::joystickEnabled = true; + byte Controls::touchPlayer = 1; + + typedef struct + { + long center; + byte dir; + bool far; + bool down; + bool pull; + } JoystickData; + + typedef struct + { + bool lift; + byte dir; + bool far; + byte button; + } ControlData; + + Controls::ControlHUD::ControlHUD() + { + button_a = new Actor(820, 450); + button_a->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_a.png")); + button_a->changeAnimation("normal", FORWARD); + button_a->relativeToView(false); + button_a->Scale = 2; + button_a->setAlpha(0.2f); + + button_b = new Actor(707.5f, 525); + button_b->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_b.png")); + button_b->changeAnimation("normal", FORWARD); + button_b->relativeToView(false); + button_b->Scale = 2; + button_b->setAlpha(0.2f); + + button_x = new Actor(820, 337.5f); + button_x->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_xy.png")); + button_x->changeAnimation("normal", FORWARD); + button_x->relativeToView(false); + button_x->Scale = 2; + button_x->setAlpha(0.2f); + + button_z = new Actor(790, 60); + button_z->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_z.png")); + button_z->changeAnimation("normal", FORWARD); + button_z->relativeToView(false); + button_z->Scale = 2; + button_z->setAlpha(0.2f); + + arrow_up = new Actor(150, 375); + arrow_up->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_up.png")); + arrow_up->changeAnimation("normal", FORWARD); + arrow_up->relativeToView(false); + arrow_up->Scale = 2; + arrow_up->setAlpha(0.5f); + + arrow_down = new Actor(150, 525); + arrow_down->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_down.png")); + arrow_down->changeAnimation("normal", FORWARD); + arrow_down->relativeToView(false); + arrow_down->Scale = 2; + arrow_down->setAlpha(0.5f); + + arrow_left = new Actor(75, 450); + arrow_left->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_left.png")); + arrow_left->changeAnimation("normal", FORWARD); + arrow_left->relativeToView(false); + arrow_left->Scale = 2; + arrow_left->setAlpha(0.5f); + + arrow_right = new Actor(225, 450); + arrow_right->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_right.png")); + arrow_right->changeAnimation("normal", FORWARD); + arrow_right->relativeToView(false); + arrow_right->Scale = 2; + arrow_right->setAlpha(0.5f); + + joystickArea = new WireframeActor(0,0,View::ScaleWidth()/2, View::ScaleHeight()); + joystickArea->relativeToView(false); + + joystick = new Actor(150, 450); + joystick->addAnimation(new Animation("center", 1, "Images/Game/Controls/joystick_center.png")); + joystick->addAnimation(new Animation("up", 1, "Images/Game/Controls/joystick_up.png")); + joystick->addAnimation(new Animation("up2", 1, "Images/Game/Controls/joystick_up2.png")); + joystick->addAnimation(new Animation("down", 1, "Images/Game/Controls/joystick_down.png")); + joystick->addAnimation(new Animation("down2", 1, "Images/Game/Controls/joystick_down2.png")); + joystick->addAnimation(new Animation("left", 1, "Images/Game/Controls/joystick_left.png")); + joystick->addAnimation(new Animation("left2", 1, "Images/Game/Controls/joystick_left2.png")); + joystick->addAnimation(new Animation("right", 1, "Images/Game/Controls/joystick_right.png")); + joystick->addAnimation(new Animation("right2", 1, "Images/Game/Controls/joystick_right2.png")); + joystick->addAnimation(new Animation("up_left", 1, "Images/Game/Controls/joystick_up_left.png")); + joystick->addAnimation(new Animation("up_left2", 1, "Images/Game/Controls/joystick_up_left2.png")); + joystick->addAnimation(new Animation("up_right", 1, "Images/Game/Controls/joystick_up_right.png")); + joystick->addAnimation(new Animation("up_right2", 1, "Images/Game/Controls/joystick_up_right2.png")); + joystick->addAnimation(new Animation("down_left", 1, "Images/Game/Controls/joystick_down_left.png")); + joystick->addAnimation(new Animation("down_left2", 1, "Images/Game/Controls/joystick_down_left2.png")); + joystick->addAnimation(new Animation("down_right", 1, "Images/Game/Controls/joystick_down_right.png")); + joystick->addAnimation(new Animation("down_right2", 1, "Images/Game/Controls/joystick_down_right2.png")); + joystick->changeAnimation("center", FORWARD); + joystick->relativeToView(false); + joystick->Scale = 2; + joystick->setAlpha(0.5f); + + joystickDir = new byte[Global::possPlayers+1]; + joystickFar = new bool[Global::possPlayers+1]; + joystickDown = new bool[Global::possPlayers+1]; + justPulled = new bool[Global::possPlayers+1]; + lastCenterTime = new long[Global::possPlayers+1]; + for(int i=0; i<=Global::possPlayers; i++) + { + joystickDir[i] = 0; + joystickFar[i] = false; + joystickDown[i] = false; + justPulled[i] = false; + lastCenterTime[i] = 0; + } + } + + Controls::ControlHUD::~ControlHUD() + { + delete button_a; + delete button_b; + delete button_x; + delete button_z; + delete arrow_up; + delete arrow_down; + delete arrow_left; + delete arrow_right; + delete joystickArea; + delete joystick; + delete[] joystickDir; + delete[] joystickFar; + delete[] joystickDown; + delete[] justPulled; + delete[] lastCenterTime; + } + + void Controls::ControlHUD::Update(long gameTime) + { + joystickArea->Update(gameTime); + joystick->Update(gameTime); + button_a->Update(gameTime); + button_b->Update(gameTime); + button_x->Update(gameTime); + button_z->Update(gameTime); + arrow_up->Update(gameTime); + arrow_down->Update(gameTime); + arrow_left->Update(gameTime); + arrow_right->Update(gameTime); + + JoystickData joystickData; + ArrayList buttonsPressed; + bool storeButtons = false; + + if(P2PDataManager::isEnabled() && !P2PDataManager::isServer()) + { + storeButtons = true; + joystickData.dir = joystickDir[touchPlayer]; + joystickData.far = joystickFar[touchPlayer]; + joystickData.down = joystickDown[touchPlayer]; + joystickData.pull = justPulled[touchPlayer]; + joystickData.center = lastCenterTime[touchPlayer]; + } + + if(Controls::touchEnabled && !Global::hud->isClicked()) + { + if(button_a->isClicked() && !button_a->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_STANDARD; + buttonsPressed.add(ctrlData); + } + else + { + buttonA(touchPlayer, DOWN); + } + button_a->setColor(Color::BLUE); + } + else if(!button_a->isClicked() && button_a->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_STANDARD; + buttonsPressed.add(ctrlData); + } + else + { + buttonA(touchPlayer, UP); + } + button_a->setColor(Color::WHITE); + } + else if(button_b->isClicked() && !button_b->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_SPECIAL; + buttonsPressed.add(ctrlData); + } + else + { + buttonB(touchPlayer, DOWN); + } + button_b->setColor(Color::GREEN); + } + else if(!button_b->isClicked() && button_b->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_SPECIAL; + buttonsPressed.add(ctrlData); + } + else + { + buttonB(touchPlayer, UP); + } + button_b->setColor(Color::WHITE); + } + else if(button_x->isClicked() && !button_x->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_JUMP; + buttonsPressed.add(ctrlData); + } + else + { + buttonX(touchPlayer, DOWN); + } + button_x->setColor(Color::YELLOW); + } + else if(!button_x->isClicked() && button_x->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_JUMP; + buttonsPressed.add(ctrlData); + } + else + { + buttonX(touchPlayer, UP); + } + button_x->setColor(Color::WHITE); + } + else if(button_z->isClicked() && !button_z->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_GRAB; + buttonsPressed.add(ctrlData); + } + else + { + Global::characters[touchPlayer]->discardItem(); + } + button_z->setColor(Color::YELLOW); + } + else if(!button_z->isClicked() && button_z->wasClicked()) + { + button_z->setColor(Color::WHITE); + } + + if(joystickEnabled) + { + if(joystickArea->isClicked()) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir(joystick->x, joystick->y, (float)mousex, (float)mousey); + float dist = (float)PrimitiveActor::distanceUnSqr(joystick->x, joystick->y, (float)mousex, (float)mousey); + if(dist<=centerDist) + { + if((lastCenterTime[touchPlayer]+runDelay)>=Game::getGameTime()) + { + justPulled[touchPlayer] = true; + if(storeButtons) + { + joystickData.pull = true; + } + } + if(joystickDir[touchPlayer]!=0) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_NONE; + buttonsPressed.add(ctrlData); + + joystickDir[touchPlayer] = 0; + joystickFar[touchPlayer] = false; + joystickDown[touchPlayer] = true; + + joystick->changeAnimation("center", FORWARD); + } + else + { + js_center(touchPlayer); + } + lastCenterTime[touchPlayer] = Game::getGameTime(); + } + } + else if(dist=Game::getGameTime()) + { + justPulled[touchPlayer] = true; + if(storeButtons) + { + joystickData.pull = true; + } + } + if(joystickDir[touchPlayer]==0) + { + Player*playr = Global::getPlayerActor(touchPlayer); + playr->smashTime = Game::getGameTime(); + } + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = dir; + ctrlData.far = false; + ctrlData.button = BUTTON_NONE; + buttonsPressed.add(ctrlData); + + joystickDir[touchPlayer] = dir; + joystickFar[touchPlayer] = false; + joystickDown[touchPlayer] = true; + + switch(dir) + { + case PrimitiveActor::DIR_UP: + joystick->changeAnimation("up", FORWARD); + break; + + case PrimitiveActor::DIR_UPLEFT: + joystick->changeAnimation("up_left", FORWARD); + break; + + case PrimitiveActor::DIR_UPRIGHT: + joystick->changeAnimation("up_right", FORWARD); + break; + + case PrimitiveActor::DIR_LEFT: + joystick->changeAnimation("left", FORWARD); + break; + + case PrimitiveActor::DIR_RIGHT: + joystick->changeAnimation("right", FORWARD); + break; + + case PrimitiveActor::DIR_DOWNLEFT: + joystick->changeAnimation("down_left", FORWARD); + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + joystick->changeAnimation("down_right", FORWARD); + break; + + case PrimitiveActor::DIR_DOWN: + joystick->changeAnimation("down", FORWARD); + break; + } + } + else + { + switch(dir) + { + case PrimitiveActor::DIR_UP: + js_up(touchPlayer); + break; + + case PrimitiveActor::DIR_UPLEFT: + js_upleft(touchPlayer); + break; + + case PrimitiveActor::DIR_UPRIGHT: + js_upright(touchPlayer); + break; + + case PrimitiveActor::DIR_LEFT: + js_left(touchPlayer); + break; + + case PrimitiveActor::DIR_RIGHT: + js_right(touchPlayer); + break; + + case PrimitiveActor::DIR_DOWNLEFT: + js_downleft(touchPlayer); + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + js_downright(touchPlayer); + break; + + case PrimitiveActor::DIR_DOWN: + js_down(touchPlayer); + break; + } + } + } + } + else + { + if(!(joystickDir[touchPlayer]==dir && joystickFar[touchPlayer])) + { + if((lastCenterTime[touchPlayer]+runDelay)>=Game::getGameTime()) + { + justPulled[touchPlayer] = true; + if(storeButtons) + { + joystickData.pull = true; + } + } + if(joystickDir[touchPlayer]==0) + { + Player*playr = Global::getPlayerActor(touchPlayer); + playr->smashTime = Game::getGameTime(); + } + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = dir; + ctrlData.far = true; + ctrlData.button = BUTTON_NONE; + buttonsPressed.add(ctrlData); + + joystickDir[touchPlayer] = dir; + joystickFar[touchPlayer] = true; + joystickDown[touchPlayer] = true; + + switch(dir) + { + case PrimitiveActor::DIR_UP: + joystick->changeAnimation("up2", FORWARD); + break; + + case PrimitiveActor::DIR_UPLEFT: + joystick->changeAnimation("up_left2", FORWARD); + break; + + case PrimitiveActor::DIR_UPRIGHT: + joystick->changeAnimation("up_right2", FORWARD); + break; + + case PrimitiveActor::DIR_LEFT: + joystick->changeAnimation("left2", FORWARD); + break; + + case PrimitiveActor::DIR_RIGHT: + joystick->changeAnimation("right2", FORWARD); + break; + + case PrimitiveActor::DIR_DOWNLEFT: + joystick->changeAnimation("down_left2", FORWARD); + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + joystick->changeAnimation("down_right2", FORWARD); + break; + + case PrimitiveActor::DIR_DOWN: + joystick->changeAnimation("down2", FORWARD); + break; + } + } + else + { + switch(dir) + { + case PrimitiveActor::DIR_UP: + js_up2(touchPlayer); + break; + + case PrimitiveActor::DIR_UPLEFT: + js_upleft2(touchPlayer); + break; + + case PrimitiveActor::DIR_UPRIGHT: + js_upright2(touchPlayer); + break; + + case PrimitiveActor::DIR_LEFT: + js_left2(touchPlayer); + break; + + case PrimitiveActor::DIR_RIGHT: + js_right2(touchPlayer); + break; + + case PrimitiveActor::DIR_DOWNLEFT: + js_downleft2(touchPlayer); + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + js_downright2(touchPlayer); + break; + + case PrimitiveActor::DIR_DOWN: + js_down2(touchPlayer); + break; + } + } + } + } + } + else + { + if(joystickDown[touchPlayer]) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_NONE; + buttonsPressed.add(ctrlData); + + joystickDir[touchPlayer] = 0; + joystickFar[touchPlayer] = false; + joystickDown[touchPlayer] = false; + + joystick->changeAnimation("center", FORWARD); + } + else + { + js_release(touchPlayer); + } + } + lastCenterTime[touchPlayer] = Game::getGameTime(); + joystickDir[touchPlayer] = 0; + } + } + else + { + if(arrow_up->isClicked() && !arrow_up->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_UP; + buttonsPressed.add(ctrlData); + } + else + { + buttonUp(touchPlayer, DOWN); + } + arrow_up->setColor(Color::YELLOW); + } + else if(!arrow_up->isClicked() && arrow_up->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_UP; + buttonsPressed.add(ctrlData); + } + else + { + buttonUp(touchPlayer, UP); + } + arrow_up->setColor(Color::WHITE); + } + if(arrow_down->isClicked() && !arrow_down->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_DOWN; + buttonsPressed.add(ctrlData); + } + else + { + buttonDown(touchPlayer, DOWN); + } + arrow_down->setColor(Color::YELLOW); + } + else if(!arrow_down->isClicked() && arrow_down->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_DOWN; + buttonsPressed.add(ctrlData); + } + else + { + buttonDown(touchPlayer, UP); + } + arrow_down->setColor(Color::WHITE); + } + if(arrow_left->isClicked() && !arrow_left->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_LEFT; + buttonsPressed.add(ctrlData); + } + else + { + buttonLeft(touchPlayer, DOWN); + } + arrow_left->setColor(Color::YELLOW); + } + else if(!arrow_left->isClicked() && arrow_left->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_LEFT; + buttonsPressed.add(ctrlData); + } + else + { + buttonLeft(touchPlayer, UP); + } + arrow_left->setColor(Color::WHITE); + } + if(arrow_right->isClicked() && !arrow_right->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = false; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_RIGHT; + buttonsPressed.add(ctrlData); + } + else + { + buttonRight(touchPlayer, DOWN); + } + arrow_right->setColor(Color::YELLOW); + } + else if(!arrow_right->isClicked() && arrow_right->wasClicked()) + { + if(storeButtons) + { + ControlData ctrlData; + ctrlData.lift = true; + ctrlData.dir = 0; + ctrlData.far = false; + ctrlData.button = BUTTON_RIGHT; + buttonsPressed.add(ctrlData); + } + else + { + buttonRight(touchPlayer, UP); + } + arrow_right->setColor(Color::WHITE); + } + } + } + justPulled[touchPlayer] = false; + + if(storeButtons) + { + DataVoid data; + byte type = P2PDataManager::DATA_JOYSTICK; + data.add(&type, sizeof(type)); + long gametime = Game::getGameTime(); + data.add(&gametime, sizeof(gametime)); + data.add(&joystickData.center, sizeof(joystickData.center)); + data.add(&joystickData.dir, sizeof(joystickData.dir)); + data.add(&joystickData.far, sizeof(joystickData.far)); + data.add(&joystickData.down, sizeof(joystickData.down)); + data.add(&joystickData.pull, sizeof(joystickData.pull)); + int size = buttonsPressed.size(); + data.add(&size, sizeof(size)); + for(int i=0; ilastCenterTime[playrNo] = DataVoid::toLong(data); + data += sizeof(long); + + touchControls->joystickDir[playrNo] = data[0]; + data += sizeof(byte); + + touchControls->joystickFar[playrNo] = (bool)data[0]; + data += sizeof(byte); + + touchControls->joystickDown[playrNo] = (bool)data[0]; + data += sizeof(byte); + + touchControls->justPulled[playrNo] = (bool)data[0]; + data += sizeof(byte); + + ArrayList buttonsPressed; + + int totalButtons = DataVoid::toInt(data); + data += sizeof(int); + for(int i=0; idiscardItem(); + } + break; + } + } + else + { + switch(ctrlData.dir) + { + case 0: + { + if(ctrlData.lift) + { + touchControls->js_release(playrNo); + } + else + { + touchControls->js_center(playrNo); + } + touchControls->lastCenterTime[playrNo] = Game::getGameTime(); + } + break; + + case PrimitiveActor::DIR_UP: + { + if(ctrlData.far) + { + touchControls->js_up2(playrNo); + } + else + { + touchControls->js_up(playrNo); + } + } + break; + + case PrimitiveActor::DIR_UPLEFT: + { + if(ctrlData.far) + { + touchControls->js_upleft2(playrNo); + } + else + { + touchControls->js_upleft(playrNo); + } + } + break; + + case PrimitiveActor::DIR_UPRIGHT: + { + if(ctrlData.far) + { + touchControls->js_upright2(playrNo); + } + else + { + touchControls->js_upright(playrNo); + } + } + break; + + case PrimitiveActor::DIR_LEFT: + { + if(ctrlData.far) + { + touchControls->js_left2(playrNo); + } + else + { + touchControls->js_left(playrNo); + } + } + break; + + case PrimitiveActor::DIR_RIGHT: + { + if(ctrlData.far) + { + touchControls->js_right2(playrNo); + } + else + { + touchControls->js_right(playrNo); + } + } + break; + + case PrimitiveActor::DIR_DOWNLEFT: + { + if(ctrlData.far) + { + touchControls->js_downleft2(playrNo); + } + else + { + touchControls->js_downleft(playrNo); + } + } + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + { + if(ctrlData.far) + { + touchControls->js_downright2(playrNo); + } + else + { + touchControls->js_downright(playrNo); + } + } + break; + + case PrimitiveActor::DIR_DOWN: + { + if(ctrlData.far) + { + touchControls->js_down2(playrNo); + } + else + { + touchControls->js_down(playrNo); + } + } + break; + } + } + } + } + + void Controls::ControlHUD::Draw(Graphics2D&g, long gameTime) + { + button_a->Draw(g, gameTime); + button_b->Draw(g, gameTime); + button_x->Draw(g, gameTime); + button_z->Draw(g, gameTime); + if(joystickEnabled) + { + joystickArea->Draw(g, gameTime); + joystick->Draw(g, gameTime); + } + else + { + arrow_up->Draw(g, gameTime); + arrow_down->Draw(g, gameTime); + arrow_left->Draw(g, gameTime); + arrow_right->Draw(g, gameTime); + } + } + + void Controls::ControlHUD::js_release(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("center", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + playr->checkAttacks(); + playr->smashTime=0; + playr->buttondir=0; + playr->down=false; + playr->up=false; + playr->upKey=false; + playr->moveLeft=0; + playr->moveRight=0; + if(playr->chargeSmash > 0 && joystickDir[pNum]!=0) + { + int chargeSmash = playr->chargeSmash; + playr->destroyCharge(); + switch(chargeSmash) + { + case AttackTemplates::SMASH_SIDE: + playr->attackSideSmash(Player::STEP_GO); + break; + + case AttackTemplates::SMASH_UP: + playr->attackUpSmash(Player::STEP_GO); + break; + + case AttackTemplates::SMASH_DOWN: + playr->attackDownSmash(Player::STEP_GO); + break; + } + } + else if((playr->isOnGround())&&(playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + playr->changeAnimation("stand_right", NO_CHANGE); + break; + } + } + if(playr->chargingAttack) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); + switch(dir) + { + case PrimitiveActor::DIR_UP: + playr->doChargingAttack(BUTTON_UP); + break; + + case PrimitiveActor::DIR_DOWN: + playr->doChargingAttack(BUTTON_DOWN); + break; + + case PrimitiveActor::DIR_LEFT: + playr->doChargingAttack(BUTTON_LEFT); + break; + + case PrimitiveActor::DIR_RIGHT: + playr->doChargingAttack(BUTTON_RIGHT); + break; + } + } + joystickDir[pNum] = 0; + joystickFar[pNum] = false; + joystickDown[pNum] = false; + } + + void Controls::ControlHUD::js_center(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("center", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->checkAttacks(); + playr->buttondir=0; + playr->smashTime=0; + playr->down=false; + playr->up=false; + playr->upKey=false; + playr->moveLeft=0; + playr->moveRight=0; + if(playr->canDo) + { + if((playr->isOnGround())&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + playr->changeAnimation("stand_right", NO_CHANGE); + break; + } + } + } + } + joystickDir[pNum] = 0; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_up(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("up", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=1; + playr->moveLeft=0; + playr->moveRight=0; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + if((playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + if(playr->hanging) + { + playr->hanging=false; + playr->climbUp(); + /*switch(playr->playerdir) + { + case 1: + playr->x-=30; + break; + + case 2: + playr->x+=30; + break; + }*/ + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_UP; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_up2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("up2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + + playr->buttondir=1; + if((joystickDir[pNum] == PrimitiveActor::DIR_UPLEFT)||(joystickDir[pNum] == PrimitiveActor::DIR_UPRIGHT)) + { + playr->moveLeft=0; + playr->moveRight=0; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + } + else + { + playr->moveLeft=0; + playr->moveRight=0; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + if(justPulled[pNum] && (playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + if(playr->hanging) + { + playr->y-=playr->hitbox->height; + playr->hanging=false; + } + playr->destroyCharge(); + playr->jump(); + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_UP; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_upleft(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("up_left", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); + if(dir == PrimitiveActor::DIR_UP) + { + playr->buttondir=1; + } + else if(dir == PrimitiveActor::DIR_LEFT) + { + playr->buttondir=4; + } + playr->up=true; + playr->upKey=false; + playr->down=false; + if(playr->hanging && !((joystickDir[pNum]==PrimitiveActor::DIR_UPLEFT || joystickDir[pNum]==PrimitiveActor::DIR_LEFT) && joystickFar[pNum])) + { + if(playr->playerdir == 1) + { + playr->hanging=false; + playr->climbUp(); + playr->x-=4; + } + } + else + { + playr->moveLeft = 1; + playr->moveRight = 0; + } + + } + joystickDir[pNum] = PrimitiveActor::DIR_UPLEFT; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_upleft2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("up_left2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); + if(dir == PrimitiveActor::DIR_UP) + { + playr->buttondir=1; + } + else if(dir == PrimitiveActor::DIR_LEFT) + { + playr->buttondir=4; + } + if(joystickDir[pNum]==PrimitiveActor::DIR_UP && joystickFar[pNum]) + { + playr->moveLeft=1; + playr->moveRight=0; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + } + else + { + playr->moveLeft=1; + playr->moveRight=0; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + if(justPulled[pNum] && (playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + if(playr->hanging) + { + playr->climbUp(); + playr->hanging=false; + } + playr->destroyCharge(); + playr->jump(); + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_UPLEFT; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_upright(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("up_right", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); + if(dir == PrimitiveActor::DIR_UP) + { + playr->buttondir=1; + } + else if(dir == PrimitiveActor::DIR_RIGHT) + { + playr->buttondir=2; + } + playr->up=true; + playr->upKey=false; + playr->down=false; + if(playr->hanging && !((joystickDir[pNum]==PrimitiveActor::DIR_UPRIGHT || joystickDir[pNum]==PrimitiveActor::DIR_RIGHT) && joystickFar[pNum])) + { + if(playr->playerdir == 2) + { + playr->hanging=false; + playr->climbUp(); + playr->x+=4; + } + } + else + { + playr->moveLeft = 0; + playr->moveRight = 1; + } + + } + joystickDir[pNum] = PrimitiveActor::DIR_UPRIGHT; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_upright2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("up_right2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir2(joystick->x, joystick->y, (float)mousex, (float)mousey); + if(dir == PrimitiveActor::DIR_UP) + { + playr->buttondir=1; + } + else if(dir == PrimitiveActor::DIR_RIGHT) + { + playr->buttondir=2; + } + if(joystickDir[pNum] == PrimitiveActor::DIR_UP && joystickFar[pNum]) + { + playr->moveLeft=0; + playr->moveRight=1; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + } + else + { + playr->moveLeft=0; + playr->moveRight=1; + playr->down=false; + playr->upKey=true; + playr->checkAttacks(); + if(justPulled[pNum] && (playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + if(playr->hanging) + { + playr->climbUp(); + playr->hanging=false; + } + playr->destroyCharge(); + playr->jump(); + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_UPRIGHT; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_left(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("left", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=4; + playr->up=false; + playr->upKey=false; + playr->down=false; + playr->moveRight=0; + playr->moveLeft=1; + if(playr->hanging && !((joystickDir[pNum]==PrimitiveActor::DIR_LEFT || joystickDir[pNum]==PrimitiveActor::DIR_DOWNLEFT) && joystickFar[pNum]) + && joystickDir[pNum]!=PrimitiveActor::DIR_UPLEFT) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->climbUp(); + playr->x-=4; + break; + + case 2: + playr->changeAnimation("fall_right", NO_CHANGE); + playr->y+=6; + break; + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_LEFT; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_left2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("left2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=4; + playr->up=false; + playr->upKey=false; + playr->down=false; + playr->moveRight=0; + if(justPulled[pNum]) + { + playr->moveLeft=2; + } + else + { + playr->moveLeft=1; + } + if(playr->hanging && !(joystickDir[pNum]==PrimitiveActor::DIR_DOWNLEFT && joystickFar[pNum]) + && joystickDir[pNum]!=PrimitiveActor::DIR_UPLEFT) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->climbUp(); + playr->x-=4; + break; + + case 2: + playr->changeAnimation("fall_right", NO_CHANGE); + playr->y+=6; + break; + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_LEFT; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_right(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("right", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=4; + playr->up=false; + playr->upKey=false; + playr->down=false; + playr->moveLeft=0; + playr->moveRight=1; + if(playr->hanging && !((joystickDir[pNum]==PrimitiveActor::DIR_RIGHT || joystickDir[pNum]==PrimitiveActor::DIR_DOWNRIGHT) && joystickFar[pNum]) + && joystickDir[pNum]!=PrimitiveActor::DIR_UPRIGHT) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("fall_left", NO_CHANGE); + playr->y+=6; + break; + + case 2: + playr->climbUp(); + playr->x+=4; + break; + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_RIGHT; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_right2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("right2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=4; + playr->up=false; + playr->upKey=false; + playr->down=false; + playr->moveLeft=0; + if(justPulled[pNum]) + { + playr->moveRight=2; + } + else + { + playr->moveRight = 1; + } + + if(playr->hanging && !(joystickDir[pNum]==PrimitiveActor::DIR_DOWNRIGHT && joystickFar[pNum]) + && joystickDir[pNum]!=PrimitiveActor::DIR_UPRIGHT) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("fall_left", NO_CHANGE); + playr->y+=6; + break; + + case 2: + playr->climbUp(); + playr->x+=4; + break; + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_RIGHT; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_down(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("down", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=3; + playr->up=false; + playr->upKey=false; + playr->down = true; + playr->checkAttacks(); + if((playr->isOnGround())&&(playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("crouch_left", NO_CHANGE); + break; + + case 2: + playr->changeAnimation("crouch_right", NO_CHANGE); + break; + } + } + } + joystickDir[pNum] = PrimitiveActor::DIR_DOWN; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_down2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("down2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=3; + playr->checkAttacks(); + if(justPulled[pNum] && playr->canDo) + { + playr->moveDown(); + } + } + joystickDir[pNum] = PrimitiveActor::DIR_DOWN; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_downleft(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("down_left", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=4; + playr->up=false; + playr->upKey=false; + playr->down=false; + if(playr->hanging && !(joystickDir[pNum]==PrimitiveActor::DIR_DOWNLEFT && joystickFar[pNum])) + { + if(playr->playerdir==2) + { + playr->hanging=false; + playr->changeAnimation("fall_right", NO_CHANGE); + playr->y+=6; + } + } + else + { + playr->moveRight=0; + playr->moveLeft=1; + } + } + joystickDir[pNum] = PrimitiveActor::DIR_DOWNLEFT; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_downleft2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("down_left2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=4; + if(joystickDir[pNum] == PrimitiveActor::DIR_DOWN && joystickFar[pNum]) + { + playr->up=false; + playr->upKey=false; + playr->down=false; + playr->moveRight=0; + playr->moveLeft=1; + if(playr->hanging) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("fall_right", NO_CHANGE); + playr->y+=6; + break; + + case 2: + playr->x-=4; + break; + } + } + } + else + { + playr->moveLeft = 0; + playr->moveRight = 0; + playr->checkAttacks(); + playr->moveDown(); + } + } + joystickDir[pNum] = PrimitiveActor::DIR_LEFT; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_downright(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("down_right", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=2; + playr->up=false; + playr->upKey=false; + playr->down=false; + if(playr->hanging && !(joystickDir[pNum]==PrimitiveActor::DIR_DOWNRIGHT && joystickFar[pNum])) + { + if(playr->playerdir==1) + { + playr->hanging=false; + playr->changeAnimation("fall_left", NO_CHANGE); + playr->y-=6; + } + } + else + { + playr->moveRight=1; + playr->moveLeft=0; + } + } + joystickDir[pNum] = PrimitiveActor::DIR_DOWNRIGHT; + joystickFar[pNum] = false; + joystickDown[pNum] = true; + } + + void Controls::ControlHUD::js_downright2(byte pNum) + { + if(pNum == Controls::touchPlayer) + { + joystick->changeAnimation("down_right2", NO_CHANGE); + } + Player*playr=Global::getPlayerActor(pNum); + if(playr->attacksPriority!=-1) + { + playr->buttondir=2; + if(joystickDir[pNum]==PrimitiveActor::DIR_DOWN && joystickFar[pNum]) + { + playr->up=false; + playr->upKey=false; + playr->down=false; + playr->moveLeft=0; + playr->moveRight=1; + if(playr->hanging) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->x+=4; + break; + + case 2: + playr->changeAnimation("fall_left", NO_CHANGE); + playr->y+=6; + break; + } + } + } + else + { + playr->moveLeft = 0; + playr->moveRight = 0; + playr->checkAttacks(); + playr->moveDown(); + } + } + joystickDir[pNum] = PrimitiveActor::DIR_DOWNRIGHT; + joystickFar[pNum] = true; + joystickDown[pNum] = true; + } + + void Controls::enableTouchControls(bool toggle) + { + if(toggle && !touchEnabled) + { + touchEnabled = true; + } + else if(!toggle && touchEnabled) + { + touchEnabled = false; + if(touchControls->button_a->isClicked()) + { + buttonA(touchPlayer,UP); + } + if(touchControls->button_b->isClicked()) + { + buttonB(touchPlayer,UP); + } + if(touchControls->button_x->isClicked()) + { + buttonX(touchPlayer, UP); + } + + if(joystickEnabled) + { + if(touchControls->joystickDown) + { + touchControls->js_release(touchPlayer); + } + } + else + { + if(touchControls->arrow_up->isClicked()) + { + buttonUp(touchPlayer, UP); + } + if(touchControls->arrow_down->isClicked()) + { + buttonDown(touchPlayer, UP); + } + if(touchControls->arrow_left->isClicked()) + { + buttonLeft(touchPlayer, UP); + } + if(touchControls->arrow_right->isClicked()) + { + buttonRight(touchPlayer, UP); + } + } + } + } + + void Controls::setJoystickActive(bool toggle) + { + joystickEnabled = toggle; + } + + bool Controls::isJoystickActive() + { + return joystickEnabled; + } + + void Controls::loadControls() + { + touchControls = new ControlHUD(); + controls = new int*[Global::possPlayers+1]; + + for(int i=0; i<=Global::possPlayers; i++) + { + controls[i] = new int[10]; + for(int j=0; j<10; j++) + { + controls[i][j] = 0; + } + } + + setDefaultControls(); + } + + void Controls::setDefaultControls() + { + controls[0][BUTTON_PAUSE]=Keys::ENTER; + + controls[1][BUTTON_UP]=Keys::UPARROW; + controls[1][BUTTON_DOWN]=Keys::DOWNARROW; + controls[1][BUTTON_LEFT]=Keys::LEFTARROW; + controls[1][BUTTON_RIGHT]=Keys::RIGHTARROW; + controls[1][BUTTON_JUMP]=Keys::P; + controls[1][BUTTON_STANDARD]=Keys::I; + controls[1][BUTTON_SPECIAL]=Keys::O; + controls[1][BUTTON_GRAB]=Keys::U; + + controls[2][BUTTON_UP]=Keys::W; + controls[2][BUTTON_DOWN]=Keys::S; + controls[2][BUTTON_LEFT]=Keys::A; + controls[2][BUTTON_RIGHT]=Keys::D; + controls[2][BUTTON_JUMP]=Keys::SHIFT_LEFT; + controls[2][BUTTON_STANDARD]=Keys::X; + controls[2][BUTTON_SPECIAL]=Keys::C; + controls[2][BUTTON_GRAB]=Keys::Z; + + controls[3][BUTTON_UP]=Keys::NUMPAD_8; + controls[3][BUTTON_DOWN]=Keys::NUMPAD_5; + controls[3][BUTTON_LEFT]=Keys::NUMPAD_4; + controls[3][BUTTON_RIGHT]=Keys::NUMPAD_6; + controls[3][BUTTON_JUMP]=Keys::NUMPAD_0; + controls[3][BUTTON_STANDARD]=Keys::NUMPAD_2; + controls[3][BUTTON_SPECIAL]=Keys::NUMPAD_3; + controls[3][BUTTON_GRAB]=Keys::NUMPAD_1; + + controls[4][BUTTON_UP]=Keys::T; + controls[4][BUTTON_DOWN]=Keys::G; + controls[4][BUTTON_LEFT]=Keys::F; + controls[4][BUTTON_RIGHT]=Keys::H; + controls[4][BUTTON_JUMP]=Keys::M; + controls[4][BUTTON_STANDARD]=Keys::B; + controls[4][BUTTON_SPECIAL]=Keys::N; + controls[4][BUTTON_GRAB]=Keys::V; + } + + bool Controls::controlsDown() + { + if(touchControls->button_a->isClicked()) + { + return true; + } + else if(touchControls->button_b->isClicked()) + { + return true; + } + else if(touchControls->button_x->isClicked()) + { + return true; + } + + if(joystickEnabled) + { + if(touchControls->joystickDown[touchPlayer]) + { + return true; + } + } + else + { + if(touchControls->arrow_up->isClicked()) + { + return true; + } + else if(touchControls->arrow_down->isClicked()) + { + return true; + } + else if(touchControls->arrow_left->isClicked()) + { + return true; + } + else if(touchControls->arrow_right->isClicked()) + { + return true; + } + } + return false; + } + + void Controls::CheckKeysDown() + { + for(byte i=1; i<=Global::possPlayers; i++) + { + if(Global::characters[i]!=null && !Global::characters[i]->isCPU() && Global::characters[i]->isAlive()) + { + if(Game::KeyPressed(controls[i][BUTTON_UP]) && !Game::PrevKeyPressed(controls[i][BUTTON_UP])) + { + buttonUp(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_DOWN]) && !Game::PrevKeyPressed(controls[i][BUTTON_DOWN])) + { + buttonDown(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_LEFT]) && !Game::PrevKeyPressed(controls[i][BUTTON_LEFT])) + { + buttonLeft(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_RIGHT]) && !Game::PrevKeyPressed(controls[i][BUTTON_RIGHT])) + { + buttonRight(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_JUMP]) && !Game::PrevKeyPressed(controls[i][BUTTON_JUMP])) + { + buttonX(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_STANDARD]) && !Game::PrevKeyPressed(controls[i][BUTTON_STANDARD])) + { + buttonA(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_SPECIAL]) && !Game::PrevKeyPressed(controls[i][BUTTON_SPECIAL])) + { + buttonB(i,DOWN); + } + + if(Game::KeyPressed(controls[i][BUTTON_GRAB]) && !Game::PrevKeyPressed(controls[i][BUTTON_GRAB])) + { + Global::characters[i]->discardItem(); + } + } + } + } + + void Controls::CheckKeysUp() + { + for(byte i=1; i<=Global::possPlayers; i++) + { + if(Global::characters[i]!=null && !Global::characters[i]->isCPU() && Global::characters[i]->isAlive()) + { + if(!Game::KeyPressed(controls[i][BUTTON_UP]) && Game::PrevKeyPressed(controls[i][BUTTON_UP])) + { + buttonUp(i,UP); + if(Game::KeyPressed(controls[i][BUTTON_LEFT])) + { + Global::characters[i]->buttondir=4; + } + else if(Game::KeyPressed(controls[i][BUTTON_RIGHT])) + { + Global::characters[i]->buttondir=2; + } + else if(Game::KeyPressed(controls[i][BUTTON_DOWN])) + { + Global::characters[i]->buttondir=3; + } + } + + if(!Game::KeyPressed(controls[i][BUTTON_DOWN]) && Game::PrevKeyPressed(controls[i][BUTTON_DOWN])) + { + buttonDown(i,UP); + if(Game::KeyPressed(controls[i][BUTTON_LEFT])) + { + Global::characters[i]->buttondir=4; + } + else if(Game::KeyPressed(controls[i][BUTTON_RIGHT])) + { + Global::characters[i]->buttondir=2; + } + else if(Game::KeyPressed(controls[i][BUTTON_UP])) + { + Global::characters[i]->buttondir=1; + } + } + + if(!Game::KeyPressed(controls[i][BUTTON_LEFT]) && Game::PrevKeyPressed(controls[i][BUTTON_LEFT])) + { + buttonLeft(i,UP); + if(Game::KeyPressed(controls[i][BUTTON_RIGHT])) + { + Global::characters[i]->buttondir=2; + } + else if(Game::KeyPressed(controls[i][BUTTON_UP])) + { + Global::characters[i]->buttondir=1; + } + else if(Game::KeyPressed(controls[i][BUTTON_DOWN])) + { + Global::characters[i]->buttondir=3; + } + } + + if(!Game::KeyPressed(controls[i][BUTTON_RIGHT]) && Game::PrevKeyPressed(controls[i][BUTTON_RIGHT])) + { + buttonRight(i,UP); + if(Game::KeyPressed(controls[i][BUTTON_LEFT])) + { + Global::characters[i]->buttondir=4; + } + else if(Game::KeyPressed(controls[i][BUTTON_UP])) + { + Global::characters[i]->buttondir=1; + } + else if(Game::KeyPressed(controls[i][BUTTON_DOWN])) + { + Global::characters[i]->buttondir=3; + } + } + + if(!Game::KeyPressed(controls[i][BUTTON_JUMP]) && Game::PrevKeyPressed(controls[i][BUTTON_JUMP])) + { + buttonX(i,UP); + } + + if(!Game::KeyPressed(controls[i][BUTTON_STANDARD]) && Game::PrevKeyPressed(controls[i][BUTTON_STANDARD])) + { + buttonA(i,UP); + } + + if(!Game::KeyPressed(controls[i][BUTTON_SPECIAL]) && Game::PrevKeyPressed(controls[i][BUTTON_SPECIAL])) + { + buttonB(i,UP); + } + + /*if(!Game::KeyPressed(controls[i][BUTTON_GRAB]) && Game::PrevKeyPressed(controls[i][BUTTON_GRAB])) + { + discardItem(player1.clonename); + }*/ + } + } + } + + void Controls::Update(long gameTime) + { + CheckKeysDown(); + CheckKeysUp(); + touchControls->Update(gameTime); + } + + void Controls::Draw(Graphics2D&g, long gameTime) + { + touchControls->Draw(g, gameTime); + } + + void Controls::buttonUp(byte pNum, byte type) + { + Player*playr=Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->smashTime=Global::worldTime; + playr->buttondir=1; + playr->checkAttacks(); + playr->upKey=true; + if(playr->hanging) + { + playr->hanging=false; + playr->climbUp(); + } + else if((playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + playr->jump(); + //ActorEndDownB(); + } + break; + + case UP: + playr->smashTime=0; + if(playr->buttondir==1) + { + playr->buttondir=0; + } + playr->up=false; + playr->upKey=false; + if(playr->chargeSmash>0) + { + int chargeSmash = playr->chargeSmash; + playr->destroyCharge(); + switch(chargeSmash) + { + case 1: + playr->attackSideSmash(Player::STEP_GO); + break; + + case 2: + playr->attackUpSmash(Player::STEP_GO); + break; + + case 3: + playr->attackDownSmash(Player::STEP_GO); + break; + } + } + if(playr->chargingAttack) + { + playr->doChargingAttack(BUTTON_UP); + } + break; + } + } + + void Controls::buttonDown(byte pNum, byte type) + { + Player*playr=Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->buttondir=3; + playr->checkAttacks(); + playr->smashTime=Global::worldTime; + playr->moveDown(); + break; + + case UP: + playr->checkAttacks(); + playr->smashTime=0; + if(playr->buttondir==3) + { + playr->buttondir=0; + } + playr->down=false; + if(playr->chargeSmash>0) + { + int chargeSmash = playr->chargeSmash; + playr->destroyCharge(); + switch(chargeSmash) + { + case 1: + playr->attackSideSmash(Player::STEP_GO); + break; + + case 2: + playr->attackUpSmash(Player::STEP_GO); + break; + + case 3: + playr->attackDownSmash(Player::STEP_GO); + break; + } + } + else if((playr->isOnGround())&&(playr->canDo)&&(!playr->chargingAttack)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + playr->changeAnimation("stand_right", NO_CHANGE); + break; + } + } + if(playr->chargingAttack) + { + playr->doChargingAttack(BUTTON_DOWN); + } + break; + } + } + + void Controls::buttonLeft(byte pNum, byte type) + { + Player*playr = Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->buttondir=4; + playr->smashTime=Global::worldTime; + if((Global::worldTime<=playr->runTime && playr->isOnGround())||(playr->moveRight==2)) + { + playr->moveLeft=2; + } + else + { + playr->moveLeft=1; + if(playr->isOnGround()) + { + playr->runTime=Global::worldTime+1; + } + } + if(playr->hanging) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->climbUp(); + playr->x-=4; + break; + + case 2: + playr->changeAnimation("fall_right", NO_CHANGE); + playr->y+=6; + break; + } + } + break; + + case UP: + playr->checkAttacks(); + playr->smashTime=0; + if(playr->buttondir==4) + { + playr->buttondir=0; + } + if(playr->moveLeft==2 && playr->isOnGround()) + { + playr->runTime=Global::worldTime; + } + playr->moveLeft=0; + if(playr->chargeSmash>0) + { + int chargeSmash = playr->chargeSmash; + playr->destroyCharge(); + switch(chargeSmash) + { + case 1: + playr->attackSideSmash(Player::STEP_GO); + break; + + case 2: + playr->attackUpSmash(Player::STEP_GO); + break; + + case 3: + playr->attackDownSmash(Player::STEP_GO); + break; + } + } + else if((playr->isOnGround())&&(playr->canDo)&&(!playr->chargingAttack)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + playr->changeAnimation("stand_right", NO_CHANGE); + break; + } + } + if(playr->chargingAttack) + { + playr->doChargingAttack(BUTTON_LEFT); + } + break; + } + } + + void Controls::buttonRight(byte pNum, byte type) + { + Player*playr = Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->buttondir=2; + playr->smashTime=Global::worldTime; + if((Global::worldTime<=playr->runTime && playr->isOnGround())||(playr->moveLeft==2)) + { + playr->moveRight=2; + } + else + { + playr->moveRight=1; + if(playr->isOnGround()) + { + playr->runTime=Global::worldTime+1; + } + } + if(playr->hanging) + { + playr->hanging=false; + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("fall_left", NO_CHANGE); + playr->y+=6; + break; + + case 2: + playr->climbUp(); + playr->x+=4; + break; + } + } + break; + + case UP: + playr->checkAttacks(); + playr->smashTime=0; + if(playr->buttondir==2) + { + playr->buttondir=0; + } + if(playr->moveRight==2 && playr->isOnGround()) + { + playr->runTime=Global::worldTime; + } + playr->moveRight=0; + if(playr->chargeSmash>0) + { + int chargeSmash = playr->chargeSmash; + playr->destroyCharge(); + switch(chargeSmash) + { + case 1: + playr->attackSideSmash(Player::STEP_GO); + break; + + case 2: + playr->attackUpSmash(Player::STEP_GO); + break; + + case 3: + playr->attackDownSmash(Player::STEP_GO); + break; + } + } + else if((playr->isOnGround())&&(playr->canDo)&&(!playr->chargingAttack)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->playerdir) + { + case 1: + playr->changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + playr->changeAnimation("stand_right", NO_CHANGE); + break; + } + } + if(playr->chargingAttack) + { + playr->doChargingAttack(BUTTON_RIGHT); + } + break; + } + } + + void Controls::buttonX(byte pNum, byte type) + { + Player*playr=Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->checkAttacks(); + playr->hanging=false; + playr->upKey=true; + if((playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + playr->destroyCharge(); + playr->jump(); + } + break; + + case UP: + playr->upKey=false; + break; + } + } + + void Controls::buttonA(byte pNum, byte type) + { + Player*playr = Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->checkAttacks(); + if((playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())&&(!playr->hanging)) + { + //ActorEndDownB(pNum); + switch(playr->buttondir) + { + case 0: + playr->attackA(); + break; + + case 1: + if(Global::worldTime<=playr->smashTime+1) + { + playr->attackUpSmash(Player::STEP_CHARGE); + if(playr->jumping) + { + playr->jumping=false; + playr->yvelocity=0; + } + } + else + { + playr->attackUpA(); + } + break; + + case 2: + if(Global::worldTime<=playr->smashTime+1) + { + playr->attackSideSmash(Player::STEP_CHARGE); + } + else + { + playr->attackSideA(); + } + break; + + case 3: + if(Global::worldTime<=playr->smashTime+1) + { + playr->attackDownSmash(Player::STEP_CHARGE); + playr->canDropThrough=false; + playr->dropping=false; + playr->dropTime=0; + } + else + { + playr->attackDownA(); + } + break; + + case 4: + if(Global::worldTime<=playr->smashTime+1) + { + playr->attackSideSmash(Player::STEP_CHARGE); + } + else + { + playr->attackSideA(); + } + break; + } + playr->smashTime=0; + playr->canDo=false; + } + else if(playr->hanging) + { + playr->climbUpAttack(); + } + break; + + case UP: + { + playr->checkAttacks(); + playr->smashTime=0; + int chargeSmash = playr->chargeSmash; + playr->destroyCharge(); + switch(chargeSmash) + { + case AttackTemplates::SMASH_SIDE: + playr->attackSideSmash(Player::STEP_GO); + break; + + case AttackTemplates::SMASH_UP: + playr->attackUpSmash(Player::STEP_GO); + break; + + case AttackTemplates::SMASH_DOWN: + playr->attackDownSmash(Player::STEP_GO); + break; + } + } + break; + } + } + + void Controls::buttonB(byte pNum, byte type) + { + Player*playr=Global::getPlayerActor(pNum); + switch(type) + { + case DOWN: + playr->checkAttacks(); + playr->smashTime=0; + if((playr->canDo)&&(!playr->isGrabbing())&&(!playr->hasGrabbed())&&(!playr->isGrabbed())) + { + switch(playr->buttondir) + { + case 0: + playr->attackB(); + break; + + case 1: + playr->attackUpB(); + break; + + case 2: + playr->attackSideB(); + break; + + case 3: + playr->attackDownB(); + break; + + case 4: + playr->attackSideB(); + break; + } + playr->canDo=false; + playr->hanging=false; + } + break; + + case UP: + if(playr->chargingAttack) + { + playr->doChargingAttack(BUTTON_SPECIAL); + } + break; + } + } +} \ No newline at end of file diff --git a/SmashBros/Controls.h b/SmashBros/Controls.h new file mode 100755 index 0000000..a9a9906 --- /dev/null +++ b/SmashBros/Controls.h @@ -0,0 +1,120 @@ +#include "Global.h" +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class Controls + { + friend class Preferences; + friend class P2PDataManager; + private: + class ControlHUD + { + friend class Controls;//nafe + private: + + static const float farDist = 12100; + static const float centerDist = 625; + static const long runDelay = 50; + + Actor*button_a; + Actor*button_b; + Actor*button_x; + Actor*button_z; + + Actor*arrow_up; + Actor*arrow_down; + Actor*arrow_left; + Actor*arrow_right; + + WireframeActor*joystickArea; + Actor*joystick; + + byte*joystickDir; + bool*joystickFar; + bool*joystickDown; + bool*justPulled; + long*lastCenterTime; + + public: + ControlHUD(); + ~ControlHUD(); + + void Update(long gameTime); + void Draw(Graphics2D&g, long gameTime); + + void js_release(byte pNum); + void js_center(byte pNum); + void js_up(byte pNum); + void js_up2(byte pNum); + void js_down(byte pNum); + void js_down2(byte pNum); + void js_left(byte pNum); + void js_left2(byte pNum); + void js_right(byte pNum); + void js_right2(byte pNum); + void js_upleft(byte pNum); + void js_upleft2(byte pNum); + void js_upright(byte pNum); + void js_upright2(byte pNum); + void js_downleft(byte pNum); + void js_downleft2(byte pNum); + void js_downright(byte pNum); + void js_downright2(byte pNum); + }; + + static void handleP2PData(byte*&data); + + static int**controls; + static ControlHUD*touchControls; + static bool touchEnabled; + static bool joystickEnabled; + static byte touchPlayer; + + public: + static const byte UP = 0; + static const byte DOWN = 1; + + static const byte BUTTONS_TOTAL = 7; + + static const byte BUTTON_UP = 0; + static const byte BUTTON_LEFT = 1; + static const byte BUTTON_DOWN = 2; + static const byte BUTTON_RIGHT = 3; + static const byte BUTTON_JUMP = 4; + static const byte BUTTON_STANDARD = 5; + static const byte BUTTON_SPECIAL = 6; + static const byte BUTTON_GRAB = 7; + static const byte BUTTON_NONE = 8; + + static const byte BUTTONS_TOTAL2 = 1; + + static const byte BUTTON_PAUSE = 8; + + static void enableTouchControls(bool toggle); + static void setJoystickActive(bool toggle); + static bool isJoystickActive(); + static bool controlsDown(); + + static void loadControls(); + static void setDefaultControls(); + + static void CheckKeysDown(); + static void CheckKeysUp(); + + static void Update(long gameTime); + static void Draw(Graphics2D&g, long gameTime); + + static void buttonUp(byte pNum, byte type); + static void buttonDown(byte pNum, byte type); + static void buttonLeft(byte pNum, byte type); + static void buttonRight(byte pNum, byte type); + + static void buttonX(byte pNum, byte type); + static void buttonA(byte pNum, byte type); + static void buttonB(byte pNum, byte type); + }; +} + diff --git a/SmashBros/FinalDestinationBrawl.cpp b/SmashBros/FinalDestinationBrawl.cpp new file mode 100755 index 0000000..33cfaff --- /dev/null +++ b/SmashBros/FinalDestinationBrawl.cpp @@ -0,0 +1,121 @@ +#include "FinalDestinationBrawl.h" + +namespace SmashBros +{ + FinalDestinationBrawl::FinalDestinationBrawl(int x1, int y1) : Stage(x1,y1) + { + fg_left = null; + fg_right = null; + + setSpawnPoint(0, 0,0); + setSpawnPoint(1, -150, -150); + setSpawnPoint(2, 150, -150); + setSpawnPoint(3, -50, -150); + setSpawnPoint(4, 50, -150); + + bottomViewBorder = 276; + topViewBorder = -276; + + topBorder = - 460; + + setItemBoundaries(-274, -250, 274, -70); + + loadGameElements(); + loadPlatforms(); + loadHangPoints(); + + setBackground("Images/Game/Stages/FinalDestinationBrawl/bg.png"); + setBackgroundScale(1.6); + setBackgroundType(BG_FIXED); + + //setWireframeColor(Color.green); + //showWireframes(true); + + MusicManager::loadSong("Final Destination"); + } + + FinalDestinationBrawl::~FinalDestinationBrawl() + { + if(fg_left!=null) + { + delete fg_left; + } + if(fg_right!=null) + { + delete fg_right; + } + } + + void FinalDestinationBrawl::loadGameElements() + { + GameElement*bg; + + float y1 = 30; + + bg = new GameElement(0,y1); + Animation*anim = new Animation("normal", 6,6,1); + anim->addFrame("Images/Game/Stages/FinalDestinationBrawl/mainstage.png"); + bg->addAnimation(anim); + bg->changeAnimation("normal", FORWARD); + bg->Scale = 1.4f; + addElement(bg); + + fglx = (-180*bg->Scale); + fgly = (float)(-23.5*bg->Scale) + y1; + + fg_left = new GameElement(x + fglx, y + fgly); + fg_left->addAnimation(new Animation("normal",1,"Images/Game/Stages/FinalDestinationBrawl/foreground_left.png")); + fg_left->changeAnimation("normal", FORWARD); + fg_left->Scale = bg->Scale; + + fgrx = (178*bg->Scale); + fgry = (-30.5f*bg->Scale) + y1; + + fg_right = new GameElement(x + fgrx, y + fgry); + fg_right->addAnimation(new Animation("normal",1,"Images/Game/Stages/FinalDestinationBrawl/foreground_right.png")); + fg_right->changeAnimation("normal", FORWARD); + fg_right->Scale = bg->Scale; + } + + void FinalDestinationBrawl::loadPlatforms() + { + Platform*plat; + + plat = new Platform(Platform::TYPE_NORMAL, 0 - 274, 0 - 66, 548, 50); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_NORMAL, 0 - 240, 0 - 30, 480, 70); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_NORMAL, 0 - 180, 0 + 20, 360, 70); + addPlatform(plat); + } + + void FinalDestinationBrawl::loadHangPoints() + { + HangPoint*hp; + + hp = new HangPoint(HangPoint::LEFT,-287,-64); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,277,-64); + addHangPoint(hp); + } + + void FinalDestinationBrawl::Draw(Graphics2D&g, long gameTime) + { + fg_left->x = x + fglx; + fg_left->y = y + fgly; + fg_right->x = x + fgrx; + fg_right->y = y + fgry; + + drawBackground(g,gameTime); + drawBottomLayer(g,gameTime); + drawMiddleLayer(g,gameTime); + + fg_left->Draw(g, gameTime); + fg_right->Draw(g, gameTime); + + drawTopLayer(g,gameTime); + } +} \ No newline at end of file diff --git a/SmashBros/FinalDestinationBrawl.h b/SmashBros/FinalDestinationBrawl.h new file mode 100755 index 0000000..b4f0ce2 --- /dev/null +++ b/SmashBros/FinalDestinationBrawl.h @@ -0,0 +1,24 @@ +#include "Stage.h" + +#pragma once + +namespace SmashBros +{ + class FinalDestinationBrawl : public Stage + { + private: + GameElement*fg_left; + GameElement*fg_right; + float fglx,fgly,fgrx,fgry; + + void loadGameElements(); + void loadPlatforms(); + void loadHangPoints(); + + public: + FinalDestinationBrawl(int x1,int y1); + ~FinalDestinationBrawl(); + + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/Fox.cpp b/SmashBros/Fox.cpp new file mode 100755 index 0000000..2f53507 --- /dev/null +++ b/SmashBros/Fox.cpp @@ -0,0 +1,1369 @@ +#include "Fox.h" +#include "AttackTemplates.h" +#include "Global.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + void Fox::addProjectileInfo(byte type, int projID, float x, float y) + { + ProjectileInfo info; + info.type = type; + info.projID = projID; + info.x = x; + info.y = y; + createdProjectiles.add(info); + } + + Fox::Fox(float x1, float y1, byte playerNo, byte team) : Player(x1, y1, playerNo, team) + { + finalSmashing = false; + finalsmashFinishing = false; + prevJumping = false; + finalsmashTime = 0; + lastKickFrame = 0; + lastBUpChargeDir = 0; + lastDir = 0; + landmaster = null; + + walkSpeed = 4.5f; + runSpeed = 7; + fallWalk = 2.8f; + fallRun = 3; + + weight = 0.29; + + name = "Fox"; + + setHitbox(-10, -14, 20, 35); + setHitboxColor(Color::GREEN); + //showHitboxWireframe(true); + //setWireframeColor(Color.red); + //showWireframe(true); + + setHangPoint(15, 8); + + oldScale = Scale; + + Console::WriteLine((String)"finished creating player " + playerNo); + } + + Fox::~Fox() + { + if(landmaster!=null) + { + landmaster = null; + } + } + + void Fox::addP2PData(DataVoid&data) + { + int total = createdProjectiles.size(); + + if(total>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + int total = createdProjectiles.size(); + data.add(&total, sizeof(total)); + + for(int i=0; idestroy(); + landmaster = null; + } + } + + void Fox::onAnimationFinish(const String&n) + { + if(n.equals("special_prep_side_left") || n.equals("special_prep_side_right")) + { + landing=false; + yvelocity=0; + if(finalSmashing) + { + animFinish(); + } + else + { + AttackTemplates::dashSideB(this, 12, 4.24, 16); + } + } + else if(n.equals("special_attack_side_left") || n.equals("special_attack_side_right")) + { + animFinish(); + xVel=0; + landing=true; + yvelocity=0; + switch(playerdir) + { + case 1: + changeAnimation("special_finish_side_left", FORWARD); + break; + + + case 2: + changeAnimation("special_finish_side_right", FORWARD); + break; + } + } + else if(n.equals("special_charge_up_left") || n.equals("special_charge_up_right")) + { + xvelocity = 0; + yvelocity = 0; + + attacksHolder = 14; + attacksPriority = 4.56; + + bUp = true; + + byte currentDir = 0; + + if(lastBUpChargeDir!=0) + { + currentDir = lastBUpChargeDir; + } + else + { + currentDir = getDirFacing(); + } + + switch(currentDir) + { + default: + case DIR_UP: + switch(playerdir) + { + case LEFT: + changeAnimation("special_attack_up_up_left", FORWARD); + break; + + case RIGHT: + changeAnimation("special_attack_up_up_right", FORWARD); + break; + } + yVel = -5; + break; + + case DIR_DOWN: + switch(playerdir) + { + case LEFT: + changeAnimation("special_attack_up_down_left", FORWARD); + break; + + case RIGHT: + changeAnimation("special_attack_up_down_right", FORWARD); + break; + } + yVel = 5; + break; + + case DIR_LEFT: + changeAnimation("special_attack_up_side_left", FORWARD); + xVel = -5; + break; + + case DIR_RIGHT: + changeAnimation("special_attack_up_side_right", FORWARD); + xVel = 5; + break; + + case DIR_UPLEFT: + changeAnimation("special_attack_up_upside_left", FORWARD); + yVel = -3.5f; + xVel = -3.5f; + break; + + case DIR_UPRIGHT: + changeAnimation("special_attack_up_upside_right", FORWARD); + yVel = -3.5f; + xVel = 3.5f; + break; + + case DIR_DOWNLEFT: + changeAnimation("special_attack_up_downside_left", FORWARD); + yVel = 3.5f; + xVel = -3.5f; + break; + + case DIR_DOWNRIGHT: + changeAnimation("special_attack_up_downside_right", FORWARD); + yVel = 3.5f; + xVel = 3.5f; + break; + } + + lastBUpChargeDir = 0; + lastDir = 0; + } + else + { + Player::onAnimationFinish(n); + } + } + + void Fox::jump() + { + Player::jump(7,(float)7.2); + } + + void Fox::Update(long gameTime) + { + if(attacksHolder==2) + { + Animation*anim = getLastAnimation(); + if((anim->getCurrentFrame()==1 || anim->getCurrentFrame()==3 || anim->getCurrentFrame()==5) + && lastKickFrame!=anim->getCurrentFrame()) + { + resetAttackCollisions(); + } + lastKickFrame = anim->getCurrentFrame(); + } + + if(attacksHolder==13 || attacksHolder==14) + { + xvelocity = 0; + yvelocity = 0; + } + + Player::Update(gameTime); + checkAttacks(); + + if(attacksHolder==13) + { + byte newDir = getDirFacing(); + if(newDir!=0) + { + if(!((lastDir==DIR_UPLEFT && (newDir==DIR_UP || newDir==DIR_LEFT)) + ||(lastDir==DIR_UPRIGHT && (newDir==DIR_UP || newDir==DIR_RIGHT)) + ||(lastDir==DIR_DOWNLEFT && (newDir==DIR_DOWN || newDir==DIR_LEFT)) + ||(lastDir==DIR_DOWNRIGHT && (newDir==DIR_DOWN || newDir==DIR_RIGHT)))) + { + lastBUpChargeDir = newDir; + } + } + lastDir = newDir; + } + else + { + updateGravity(); + } + updateFrame(); + + if(attacksHolder==19) + { + setAlpha(getAlpha()+0.05f); + if(getAlpha()>=1) + { + animFinish(); + attacksHolder=-1; + attacksPriority=7; + setAlpha(0); + setVisible(false); + Scale = 0; + finalSmashing=true; + finalsmashFinishing=false; + finalsmashTime = Global::getWorldTime() + 180; + float y1 = y - 200; + if(y1<((float)Global::currentStage->getItemBoundaries().y)) + { + y1=(float)Global::currentStage->getItemBoundaries().y; + } + landmaster = new Landmaster(getPlayerNo(),x,y1); + createProjectile(landmaster); + + addProjectileInfo(3, landmaster->getID(), x, y1); + + animFinish(); + } + } + else if(finalSmashing) + { + if(finalsmashTime<=Global::getWorldTime() || finalsmashFinishing) + { + finalsmashFinishing = true; + x = landmaster->x; + y = landmaster->y; + yvelocity = 0; + xvelocity = 0; + yVel = 0; + xVel = 0; + attacksHolder = -1; + attacksPriority = 7; + doubleJump = 1; + bUp = false; + landmaster->setAlpha(landmaster->getAlpha()+0.05f); + if(landmaster->getAlpha()>=1) + { + landmaster->destroy(); + landmaster = null; + AttackTemplates::finishFinalSmash(this); + finalSmashing = false; + Scale = oldScale; + setVisible(true); + float y1 = y - 200; + if(y1<((float)Global::currentStage->getItemBoundaries().y)) + { + y1=(float)Global::currentStage->getItemBoundaries().y; + } + y = y1; + } + } + else + { + if(landmaster->getAttackNo()==-1) + { + if((attacksHolder>=0 && attacksHolder<=10) + ||(attacksHolder>=16 && attacksHolder<=18)) + { + landmaster->shoot(); + } + } + + x = landmaster->x; + y = landmaster->y; + yvelocity = 0; + xvelocity = 0; + yVel = 0; + xVel = 0; + attacksHolder = -1; + attacksPriority = 7; + doubleJump = 1; + bUp = false; + + if(isJumping() && prevJumping) + { + setJumping(false); + } + prevJumping = isJumping(); + } + } + + if(!finalSmashing) + { + updateMovement(); + } + + updateHanging(); + updateHurt(); + updateDrop(); + updateAI(); + } + + void Fox::onPlayerHit(Player*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + switch(attacksHolder) + { + case 0: + //A1 + if(playerdir==LEFT) + { + causeDamage(collide, 2); + collide->y-=3; + causeHurt(collide, RIGHT, 1); + } + break; + + case 1: + //A2 + if(playerdir==LEFT) + { + causeDamage(collide, 2); + collide->y-=3; + causeHurt(collide, RIGHT, 1); + } + break; + + case 2: + //A3 + if(playerdir==LEFT) + { + causeDamage(collide, 2); + collide->y-=5; + collide->x-=3; + causeHurt(collide, RIGHT, 1); + } + break; + + case 3: + //A Dash + break; + + case 16: + //Smash Side + if(playerdir==LEFT) + { + causeDamage(collide, smashPower); + causeHurtLaunch(collide, -1,((float)smashPower/6),4.3f, -1,2,2); + causeHurt(collide, RIGHT, 6); + } + break; + + case 17: + //Smash Up + causeDamage(collide, smashPower); + causeHurtLaunch(collide, -1,2,2, -1,((float)smashPower/5),4.3f); + causeHurt(collide, RIGHT, 6); + break; + + case 18: + //Smash Down + causeDamage(collide, smashPower); + causeHurtLaunch(collide, -1,((float)smashPower/5),4.1f, -1,((float)smashPower/8),2.1f); + causeHurt(collide, RIGHT, 6); + break; + } + break; + + case DIR_RIGHT: + switch(attacksHolder) + { + case 0: + //A1 + if(playerdir==RIGHT) + { + causeDamage(collide, 2); + collide->y-=3; + causeHurt(collide, LEFT, 1); + } + break; + + case 1: + //A2 + if(playerdir==RIGHT) + { + causeDamage(collide, 2); + collide->y-=3; + causeHurt(collide, LEFT, 1); + } + break; + + case 2: + //A3 + if(playerdir==RIGHT) + { + causeDamage(collide, 2); + collide->y-=5; + collide->x+=3; + causeHurt(collide, LEFT, 1); + } + break; + + case 3: + //A Dash + break; + + case 16: + //Smash Side + if(playerdir==RIGHT) + { + causeDamage(collide, smashPower); + causeHurtLaunch(collide, 1,((float)smashPower/6),4.3f, -1,2,2); + causeHurt(collide, LEFT, 6); + } + break; + + case 17: + //Smash Up + causeDamage(collide, smashPower); + causeHurtLaunch(collide, 1,2,2, -1,((float)smashPower/5),4.3f); + causeHurt(collide, LEFT, 6); + break; + + case 18: + //Smash Down + causeDamage(collide, smashPower); + causeHurtLaunch(collide, 1,((float)smashPower/5),4.1f, -1,((float)smashPower/8),2.1f); + causeHurt(collide, LEFT, 6); + break; + } + break; + + case DIR_UP: + switch(attacksHolder) + { + case 17: + //Smash Up + causeDamage(collide, smashPower); + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide, -1,2,2, -1,((float)smashPower/5),4.3f); + causeHurt(collide, RIGHT, 6); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,2,2, -1,((float)smashPower/5),4.3f); + causeHurt(collide, LEFT, 6); + break; + } + break; + } + break; + + case DIR_DOWN: + switch(attacksHolder) + { + case 18: + //Smash Down + causeDamage(collide, smashPower); + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide, -1,((float)smashPower/5),4.1f, 1,((float)smashPower/8),2.1f); + causeHurt(collide, RIGHT, 6); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,((float)smashPower/5),4.1f, 1,((float)smashPower/8),2.1f); + causeHurt(collide, LEFT, 6); + break; + } + break; + } + break; + } + + if(attacksHolder==13) + { + causeDamage(collide,2); + collide->y=y-60; + if(collide->xx+=2; + causeHurt(collide, RIGHT, 1); + } + else + { + collide->x-=2; + causeHurt(collide, LEFT, 1); + } + collide->xvelocity=0; + } + else if(attacksHolder==14) + { + double dist = distance(x,y,collide->x,collide->y); + float xDif = collide->x - x; + float yDif = collide->y - y; + + int multX = 1; + int multY = 1; + + causeDamage(collide, 8); + + if(collide->xyxmoveLeft==2) || (playr->moveRight==2)) && (playr->onGround==1)) + //{ + //normalDashA(playr, 3,2.3, 3.5); + //} + //else + //{ + if(!checkItemUseSide()) + { + if(isOnGround()) + { + switch(playerdir) + { + case LEFT: + x-=5; + break; + + case RIGHT: + x+=5; + break; + } + AttackTemplates::normalSideA(this, 4,2.411); + } + else + { + if(!bUp) + { + AttackTemplates::normalAirSideA(this, 8,2.234); + switch(playerdir) + { + case LEFT: + xvelocity-=1; + break; + + case RIGHT: + xvelocity+=1; + break; + } + yvelocity-=1.5; + } + } + } + //} + } + + void Fox::attackUpA() + { + addAttackInfo(DIR_LEFT, 5, LEFT, 3, 4, -1,3,2.7f, -1,2,2); + addAttackInfo(DIR_LEFT, 5,RIGHT, 3, 4, -1,3,2.7f, -1,2,2); + addAttackInfo(DIR_RIGHT, 5, LEFT, 3, 4, 1,3,2.7f, -1,2,2); + addAttackInfo(DIR_RIGHT, 5,RIGHT, 3, 4, 1,3,2.7f, -1,2,2); + addAttackInfo(DIR_LEFT, 9, LEFT, 9, 5, -1,0.9f,1.2f, -1,2.1f,4.1f); + addAttackInfo(DIR_LEFT, 9,RIGHT, 9, 5, -1,0.9f,1.2f, -1,2.1f,4.1f); + addAttackInfo(DIR_RIGHT,9, LEFT, 9, 5, 1,0.9f,1.2f, -1,2.1f,4.1f); + addAttackInfo(DIR_RIGHT,9,RIGHT, 9, 5, 1,0.9f,1.2f, -1,2.1f,4.1f); + addAttackInfo(DIR_UP, 5, LEFT, 3, 4, -1,0.5f,1.1f, -1,3,2.8f); + addAttackInfo(DIR_UP, 5,RIGHT, 3, 4, 1,0.5f,1.1f, -1,3,2.8f); + addAttackInfo(DIR_UP, 9, LEFT, 9, 5, -1,0.9f,1.2f, -1,2.1f,4.1f); + addAttackInfo(DIR_UP, 9,RIGHT, 9, 5, 1,0.9f,1.2f, -1,2.1f,4.1f); + + if(isOnGround()) + { + AttackTemplates::normalUpA(this, 5, 2.911); + } + else + { + if(!bUp) + { + AttackTemplates::normalAirUpA(this, 9,2.956); + } + } + } + + void Fox::attackDownA() + { + addAttackInfo(DIR_LEFT, 6, LEFT, 9, 4, -1,3,2, -1,3,2); + addAttackInfo(DIR_RIGHT,6,RIGHT, 9, 4, 1,3,2, -1,3,2); + addAttackInfo(DIR_LEFT, 10, LEFT, 7, 4, -1,0.9f,1.2f, 1,2.1f,4.1f); + addAttackInfo(DIR_RIGHT,10,RIGHT, 7, 4, 1,0.9f,1.2f, 1,2.1f,4.1f); + addAttackInfo(DIR_DOWN, 6, LEFT, 9, 4, -1,2,1.4f, 1,3.5f,3.4f); + addAttackInfo(DIR_DOWN, 6,RIGHT, 9, 4, 1,2,1.4f, 1,3.5f,3.4f); + addAttackInfo(DIR_DOWN, 10, LEFT, 7, 4, -1,0.9f,1.2f, 1,3.1f,4.1f); + addAttackInfo(DIR_DOWN, 10,RIGHT, 7, 4, 1,0.9f,1.2f, 1,3.1f,4.1f); + + if(isOnGround()) + { + switch(playerdir) + { + case LEFT: + x-=3; + break; + + case RIGHT: + x+=3; + break; + } + AttackTemplates::normalDownA(this, 6,1.399); + } + else + { + if(!bUp) + { + AttackTemplates::normalAirDownA(this, 10,2.454); + } + } + } + + void Fox::attackB() + { + if(!bUp) + { + if(canFinalSmash()) + { + attackFinalSmash(); + } + else + { + int x1=25; + switch(playerdir) + { + case LEFT: + x1=-25; + changeAnimation("special_attack_left",FORWARD); + break; + + case RIGHT: + x1=25; + changeAnimation("special_attack_right",FORWARD); + break; + } + if(!finalSmashing) + { + Ray*ray = new Ray(getPlayerNo(),x + x1, y); + AttackTemplates::singleProjectile(this, 11, 0, ray); + + addProjectileInfo(1, ray->getID(), x + x1, y); + } + } + } + } + + void Fox::attackSideB() + { + addAttackInfo(DIR_LEFT, 12, LEFT, 7, 5, -1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_LEFT, 12,RIGHT, 7, 5, -1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_RIGHT, 12, LEFT, 7, 5, 1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_RIGHT, 12,RIGHT, 7, 5, 1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_UP, 12, LEFT, 7, 5, -1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_UP, 12,RIGHT, 7, 5, 1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_DOWN, 12, LEFT, 7, 5, -1,0.5f,1.2f, -1,4,1.6f); + addAttackInfo(DIR_DOWN, 12,RIGHT, 7, 5, 1,0.5f,1.2f, -1,4,1.6f); + + if(!bUp) + { + bUp=true; + landing=true; + switch(playerdir) + { + case 1: + changeAnimation("special_prep_side_left", FORWARD); + break; + + case 2: + changeAnimation("special_prep_side_right", FORWARD); + break; + } + } + } + + void Fox::attackUpB() + { + if(!bUp) + { + bUp=true; + attacksPriority=4.1; + attacksHolder=13; + xvelocity = 0; + yvelocity = 0; + switch(playerdir) + { + case LEFT: + changeAnimation("special_charge_up_left", FORWARD); + break; + + + case 2: + changeAnimation("special_charge_up_right", FORWARD); + break; + } + + lastBUpChargeDir = 0; + lastDir = 0; + } + } + + void Fox::attackDownB() + { + if(!bUp) + { + AttackTemplates::normalDownB(this, 15,6); + } + } + + void Fox::attackSideSmash(byte type) + { + if(!checkItemUseSmash(type)&&!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,16,3.557,type,1,30,15,42); + if(type==STEP_GO) + { + yvelocity=-2*(((float)smashPower)/18); + switch(playerdir) + { + case 1: + xvelocity=-3*(((float)smashPower)/18); + break; + + case 2: + xvelocity=3*(((float)smashPower)/18); + break; + } + } + } + else + { + attackSideA(); + } + } + } + + void Fox::attackUpSmash(byte type) + { + if(!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,17,3.224,type,2,30,17,31); + } + else + { + attackUpA(); + } + } + } + + void Fox::attackDownSmash(byte type) + { + if(!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,18,3.043,type,3,20,14,30); + } + else + { + attackDownA(); + } + } + } + + void Fox::attackFinalSmash() + { + if(!bUp) + { + landing=true; + destroyCharge(); + AttackTemplates::finalSmash(this, 19); + setAlpha(0); + discardItem(); + switch(playerdir) + { + case 1: + changeAnimation("crouch_left", FORWARD); + break; + + case 2: + changeAnimation("crouch_right", FORWARD); + break; + } + } + } + + Fox::Ray::Ray(byte playerNo, float x1, float y1) : Projectile(playerNo, x1, y1) + { + addAnimation(new Animation("normal",1,"Images/Game/Characters/Fox/ray.png")); + changeAnimation("normal",FORWARD); + + switch(itemdir) + { + case LEFT: + xvelocity=-7.5f; + break; + + case RIGHT: + xvelocity=7.5f; + break; + } + } + + Fox::Ray::~Ray() + { + // + } + + void Fox::Ray::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + causeDamage(collide, 1); + destroy(); + } + } + + Fox::LandmasterShot::LandmasterShot(byte playerNo, float x1, float y1) : Projectile(playerNo, x1,y1) + { + Animation*anim; + + anim = new Animation("left",12,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_shot.png"); + addAnimation(anim); + + anim = new Animation("right",12,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_shot.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case LEFT: + changeAnimation("left",FORWARD); + xvelocity = -5; + break; + + case RIGHT: + changeAnimation("right",FORWARD); + xvelocity = 5; + break; + } + + setLayer(LAYER_MIDDLEUPPER); + } + + Fox::LandmasterShot::~LandmasterShot() + { + // + } + + void Fox::LandmasterShot::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + causeDamage(collide,17); + if(collide->xx) + { + causeHurtLaunch(collide, 1,6,6, -1,3,6); + causeHurt(collide, LEFT, 4); + } + else + { + causeHurtLaunch(collide, 1,0,0, -1,6,6); + causeHurt(collide, collide->getPlayerDir(), 4); + } + } + } + + Fox::Landmaster::Landmaster(byte playerNo, float x1, float y1) : Projectile(playerNo, x1, y1) + { + Animation*anim; + + anim = new Animation("idle_left",1,"Images/Game/Characters/Fox/landmaster_idle.png"); + addAnimation(anim); + anim = new Animation("idle_right",1,"Images/Game/Characters/Fox/landmaster_idle.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("move_left",8,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_move.png"); + addAnimation(anim); + anim = new Animation("move_right",8,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_move.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("hover_left",10,3,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_hover.png"); + addAnimation(anim); + anim = new Animation("hover_right",10,3,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_hover.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("shoot_left",10,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_shoot.png"); + addAnimation(anim); + anim = new Animation("shoot_right",10,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_shoot.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("boost_left",8,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_boost.png"); + addAnimation(anim); + anim = new Animation("boost_right",8,4,1); + anim->addFrame("Images/Game/Characters/Fox/landmaster_boost.png"); + anim->mirror(true); + addAnimation(anim); + + Scale = 0.8f; + + setSolid(true); + setOwnerSolid(false); + + weight = 0.1f; + + attack = -1; + + idle(); + } + + Fox::Landmaster::~Landmaster() + { + Fox*fox = (Fox*)Global::getPlayerActor(getPlayerNo()); + if(fox!=NULL) + { + fox->landmaster = NULL; + } + } + + void Fox::Landmaster::onAnimationFinish(const String&n) + { + if(n.equals("hover_left") || n.equals("hover_right")) + { + hovering = false; + idle(); + } + else if(n.equals("shoot_left") || n.equals("shoot_right")) + { + Player*owner = Global::getPlayerActor(getPlayerNo()); + Fox*fox = (Fox*)owner; + switch(attack) + { + case 0: + { + owner->setPlayerDir(LEFT); + LandmasterShot*shot = new LandmasterShot(getPlayerNo(),x - (120*Scale), y - (24*Scale)); + createProjectile(shot); + + fox->addProjectileInfo(2, shot->getID(), x - (120*Scale), y - (24*Scale)); + } + break; + + case 1: + { + owner->setPlayerDir(RIGHT); + LandmasterShot*shot = new LandmasterShot(getPlayerNo(),x + (120*Scale), y - (24*Scale)); + createProjectile(shot); + + fox->addProjectileInfo(2, shot->getID(), x + (120*Scale), y - (24*Scale)); + } + break; + } + idle(); + } + } + + void Fox::Landmaster::Update(long gameTime) + { + Projectile::Update(gameTime); + yvelocity+=(float)(Global::currentStage->getGravity() + weight); + + Player*owner = Global::getPlayerActor(getPlayerNo()); + + if(attack==-1) + { + if(owner->isJumping() && !hovering) + { + hovering = true; + switch(owner->getPlayerDir()) + { + case LEFT: + changeAnimation("hover_left",FORWARD); + break; + + case RIGHT: + changeAnimation("hover_right",FORWARD); + break; + } + yvelocity -=5; + } + if(owner->getMoveLeft()>0) + { + x-=1; + owner->setPlayerDir(LEFT); + if(hovering) + { + changeAnimation("hover_left",NO_CHANGE); + } + else + { + changeAnimation("move_left",NO_CHANGE); + } + } + else if(owner->getMoveRight()>0) + { + x+=1; + owner->setPlayerDir(RIGHT); + if(hovering) + { + changeAnimation("hover_right",NO_CHANGE); + } + else + { + changeAnimation("move_right",NO_CHANGE); + } + } + else + { + if(!hovering) + { + switch(owner->getPlayerDir()) + { + case LEFT: + changeAnimation("idle_left",FORWARD); + break; + + case RIGHT: + changeAnimation("idle_right",FORWARD); + break; + } + } + } + } + } + + int Fox::Landmaster::getAttackNo() + { + return attack; + } + + void Fox::Landmaster::idle() + { + attack=-1; + //playr->attacksPriority=0; + Fox*owner = (Fox*)Global::getPlayerActor(getPlayerNo()); + owner->animFinish(); + owner->attacksHolder=-1; + owner->attacksPriority=7; + owner->animFinish(); + owner->bUp=false; + switch(owner->playerdir) + { + case 1: + changeAnimation("idle_left", FORWARD); + break; + + case 2: + changeAnimation("idle_right", FORWARD); + break; + } + } + + void Fox::Landmaster::shoot() + { + Player*owner = Global::getPlayerActor(getPlayerNo()); + switch(owner->getPlayerDir()) + { + case LEFT: + changeAnimation("shoot_left",FORWARD); + attack = 0; + break; + + case RIGHT: + changeAnimation("shoot_right",FORWARD); + attack = 1; + break; + } + } +} \ No newline at end of file diff --git a/SmashBros/Fox.h b/SmashBros/Fox.h new file mode 100755 index 0000000..613ceda --- /dev/null +++ b/SmashBros/Fox.h @@ -0,0 +1,100 @@ +#include "Player.h" + +#pragma once + +namespace SmashBros +{ + class Fox : public Player + { + private: + typedef struct + { + byte type; + int projID; + float x; + float y; + } ProjectileInfo; + + void addProjectileInfo(byte type, int projID, float x, float y); + + ArrayList createdProjectiles; + + class Ray : public Projectile + { + public: + Ray(byte playerNo, float x1, float y1); + virtual ~Ray(); + + virtual void onPlayerHit(Player*collide, byte dir); + }; + + class LandmasterShot : public Projectile + { + public: + LandmasterShot(byte playerNo, float x1, float y1); + virtual ~LandmasterShot(); + + virtual void onPlayerHit(Player*collide, byte dir); + }; + + class Landmaster : public Projectile + { + private: + int attack; + float weight; + boolean hovering; + + public: + Landmaster(byte playerNo, float x1, float y1); + virtual ~Landmaster(); + + virtual void Update(long gameTime); + virtual void onAnimationFinish(const String&n); + int getAttackNo(); + void idle(); + void shoot(); + }; + + boolean finalSmashing; + long finalsmashTime; + boolean finalsmashFinishing; + boolean prevJumping; + float oldScale; + int lastKickFrame; + byte lastBUpChargeDir; + byte lastDir; + Landmaster*landmaster; + + public: + Fox(float x1, float y1, byte playerNo, byte team); + virtual ~Fox(); + + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + + virtual void Update(long gameTime); + + virtual void Load(); + virtual void LoadAttackTypes(); + virtual void onDestroy(); + virtual void onAnimationFinish(const String&n); + virtual void jump(); + + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onFinishCharge(); + virtual void doChargingAttack(byte button); + + virtual void attackA(); + virtual void attackSideA(); + virtual void attackUpA(); + virtual void attackDownA(); + virtual void attackB(); + virtual void attackSideB(); + virtual void attackUpB(); + virtual void attackDownB(); + virtual void attackSideSmash(byte type); + virtual void attackUpSmash(byte type); + virtual void attackDownSmash(byte type); + virtual void attackFinalSmash(); + }; +} \ No newline at end of file diff --git a/SmashBros/FractalStage.cpp b/SmashBros/FractalStage.cpp new file mode 100755 index 0000000..45d53f2 --- /dev/null +++ b/SmashBros/FractalStage.cpp @@ -0,0 +1,502 @@ +#include "FractalStage.h" +#include "Global.h" +#include "Camera.h" + +namespace SmashBros +{ + FractalStage::FractalStage(int x1, int y1) : Stage(x1,y1) + { + Console::WriteLine("loading fractal"); + f = new Fractal(); + Console::WriteLine("loading trippy ass shit"); + randomstuff = new RandomStuff(); + + setSpawnPoint(0, 0,0); + setSpawnPoint(1, -150, -150); + setSpawnPoint(2, -50, -150); + setSpawnPoint(3, 50, -150); + setSpawnPoint(4, 150, -150); + + loadGameElements(); + loadPlatforms(); + loadHangPoints(); + + setWireframeColor(Color::GREEN); + showWireframes(true); + + setItemBoundaries(-350, -260, 350, 0); + + //setBackground("Images/Game/Stages/TestStage/bg.png"); + //setBackgroundScale(2.8); + + loadFile("Images/Game/Stages/TestStage/nyan_cat.png"); + loadFile("Images/Game/Stages/TestStage/roflsaurus.png"); + loadFile("Images/Game/Stages/TestStage/swirl.png"); + loadFile("Images/Game/Stages/TestStage/nic_cage.png"); + } + + FractalStage::~FractalStage() + { + delete f; + delete randomstuff; + } + + void FractalStage::loadGameElements() + { + GameElement*a; + + a = new GameElement(0,0); + a->addAnimation(new Animation("normal",1,"Images/Game/Stages/TestStage/platform1.png")); + a->changeAnimation("normal", FORWARD); + addElement(a); + } + + void FractalStage::loadPlatforms() + { + Platform*plat; + + plat = new Platform(Platform::TYPE_NORMAL,-295, -67, 590, 134); + addPlatform(plat); + + createGenericPlatform(Platform::TYPE_GOTHROUGH,0,-160); + createGenericPlatform(Platform::TYPE_NORMAL,-340,40); + createGenericPlatform(Platform::TYPE_NORMAL,-370,120); + createGenericPlatform(Platform::TYPE_NORMAL,-280,160); + createSolidPlatform(130,-180); + + //createCirclePlatform(130,-60); + } + + void FractalStage::loadHangPoints() + { + HangPoint*hp; + + hp = new HangPoint(HangPoint::LEFT,-302,-65); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,292,-65); + addHangPoint(hp); + } + + void FractalStage::createGenericPlatform(byte type, float x1, float y1) + { + GameElement*a; + a = new GameElement(x1,y1); + a->addAnimation(new Animation("normal",1,"Images/Game/Stages/TestStage/gothrough_plat1.png")); + a->changeAnimation("normal", FORWARD); + addElement(a); + + Platform*plat; + plat = new Platform(type,x1-34,y1-8,68,16); + addPlatform(plat); + } + + void FractalStage::createSolidPlatform(float x1, float y1) + { + Platform*a; + a = new Platform(Platform::TYPE_NORMAL,x1,y1); + a->addAnimation(new Animation("normal",1,"Images/Game/Stages/TestStage/circle.png")); + a->changeAnimation("normal", FORWARD); + addPlatform(a); + } + + void FractalStage::Update(long gameTime) + { + Stage::Update(gameTime); + randomstuff->Update(gameTime); + //cage.Update(gameTime); + } + + void FractalStage::Draw(Graphics2D&g, long gameTime) + { + f->Draw(g, gameTime); + setElementColor(Color(f->inverted,true)); + //DrawBackground(g,gameTime); + randomstuff->Draw(g, gameTime); + Stage::Draw(g, gameTime); + } + + FractalStage::RandomStuff::RandomStuff() + { + nextSpawnTime = (long)(GameEngine::random()*140); + } + + FractalStage::RandomStuff::~RandomStuff() + { + for(int i=0; i= nextSpawnTime) + { + int num = (int)(300*GameEngine::random()); + + if(num>200) + { + NicCage*cage = new NicCage(); + if(num > 240) + { + cage->isrotating = true; + } + creepy.add(cage); + } + else + { + creepy.add(new RandomThing()); + nextSpawnTime = Global::getWorldTime() + (long)(GameEngine::random()*50); + } + } + + for(int i=(creepy.size()-1); i>=0; i--) + { + creepy.get(i)->Update(gameTime); + if(creepy.get(i)->isDead) + { + delete creepy.get(i); + creepy.remove(i); + } + } + } + + void FractalStage::RandomStuff::Draw(Graphics2D&g, long gameTime) + { + for(int i=(creepy.size()-1); i>=0; i--) + { + creepy.get(i)->Draw(g, gameTime); + } + } + + FractalStage::RandomThing::RandomThing() : GameElement((float)(GameEngine::random()*900), (float)(GameEngine::random()*600)) + { + newScale = 1; + scaleIncr = 1; + isDead = false; + + int creature = (int)(GameEngine::random()*2); + + Animation*anim; + + switch(creature) + { + default: + anim = new Animation("normal", 8,1,6); + anim->addFrame("Images/Game/Stages/TestStage/nyan_cat.png"); + break; + + case 1: + anim = new Animation("normal", 18,1,11); + anim->addFrame("Images/Game/Stages/TestStage/roflsaurus.png"); + break; + } + + addAnimation(anim); + changeAnimation("normal",FORWARD); + + Scale = (float)(GameEngine::random()*1.5 + 0.2); + + newScale = GameEngine::random()*1.5 + 0.2; + + float moveX = (float)(GameEngine::random()*900); + float moveY = (float)(GameEngine::random()*600); + float speed = 2; + + double dist = distance(x,y,moveX,moveY); + + int frames = (int)((double)dist/(float)speed); + + scaleIncr = (double)(newScale - Scale)/(double)frames; + + moveTo(moveX, moveY, speed); + + setColor(Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255), (unsigned char)(GameEngine::random()*255), 255)); + } + + FractalStage::RandomThing::RandomThing(boolean create) : GameElement((float)(GameEngine::random()*900), (float)(GameEngine::random()*600)) + { + newScale = 1; + scaleIncr = 1; + isDead = false; + + Scale = (float)(GameEngine::random()*1.5 + 0.2); + + newScale = GameEngine::random()*1.5 + 0.2; + + float moveX = (float)(GameEngine::random()*900); + float moveY = (float)(GameEngine::random()*600); + float speed = 2; + + double dist = distance(x,y,moveX,moveY); + + int frames = (int)((double)dist/(float)speed); + + scaleIncr = (double)(newScale - Scale)/(double)frames; + + moveTo(moveX, moveY, speed); + + //setColor(Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255), (unsigned char)(GameEngine::random()*255), 255)); + } + + FractalStage::RandomThing::~RandomThing() + { + // + } + + void FractalStage::RandomThing::Update(long gameTime) + { + GameElement::Update(gameTime); + Scale += (float)scaleIncr; + } + + void FractalStage::RandomThing::onMoveFinish() + { + isDead = true; + } + + FractalStage::NicCage::NicCage() : RandomThing(false) + { + rotate = 0; + isrotating = false; + + swirl = new GameElement(0,0); + Animation*anim = new Animation("normal", 15,15,1); + anim->addFrame("Images/Game/Stages/TestStage/swirl.png"); + swirl->addAnimation(anim); + swirl->changeAnimation("normal", FORWARD); + swirl->Scale = Scale*0.8f; + + addAnimation(new Animation("normal",1,"Images/Game/Stages/TestStage/nic_cage.png")); + changeAnimation("normal",FORWARD); + } + + FractalStage::NicCage::~NicCage() + { + delete swirl; + } + + void FractalStage::NicCage::Update(long gameTime) + { + RandomThing::Update(gameTime); + if(isrotating) + { + rotate+=0.5; + setRotation(rotate); + } + } + + void FractalStage::NicCage::Draw(Graphics2D&g, long gameTime) + { + float oldRotation = g.getRotation(); + + if(getRotation()!=0) + { + g.rotate(getRotation(),(float)(x*Camera::Zoom),(float)(y*Camera::Zoom)); + } + + setColor(Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255), (unsigned char)(GameEngine::random()*255), 255)); + + RandomThing::Draw(g, gameTime); + + if(!isrotating) + { + + swirl->Scale = Scale*0.1f; + + swirl->x = x - (float)(46*Scale); + swirl->y = y - (float)(3*Scale); + swirl->Draw(g, gameTime); + + swirl->x = x + (float)(34*Scale); + swirl->y = y - (float)(2*Scale); + swirl->Draw(g, gameTime); + } + + g.setRotation(oldRotation); + } + + FractalStage::Fractal::Fractal() + { + c = ComplexNumber(-0.223, 0.745); + + values = null; + + minX = -1.5; + maxX = 1.5; + minY = -1.5; + maxY = 1.5; + + Scale = 1; + + image = null; + + threshold = 1; + + iterations = 50; + + img.create(WIDTH,HEIGHT,Color::WHITE); + + color1 = Color(0,0,0,255); + color2 = Color(255,255,255,0); + + getValues(); + + for(unsigned int i=0;iupdate(img); + + color1 = Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255)); + color2 = Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255)); + while(color1.equals(color2)) + { + color2 = Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255)); + } + Game::setBackgroundColor(color2); + + g.rotate((float)(GameEngine::random()*360), 450, 300); + g.setImageMask(color1); + g.drawImage(image,x1,y1,w,h); + + g.setRotation(oldRotation); + } + + void FractalStage::Fractal::redrawFractal() + { + Color c1 = Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255)); + Color c2 = Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255)); + while(c1.equals(c2)) + { + c2 = Color((unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255),(unsigned char)(GameEngine::random()*255)); + } + Game::setBackgroundColor(Color::RED); + //inverted = getNegativeColor(color1.getRGB()); + Scale = (GameEngine::random()*4 + 1); + + unsigned int w = img.getWidth(); + unsigned int h = img.getHeight(); + + for(unsigned int y=0; ya = a; + this->b = b; + } + + FractalStage::ComplexNumber FractalStage::ComplexNumber::square() + { + return ComplexNumber(a*a - b*b, 2*a*b); + } + + FractalStage::ComplexNumber FractalStage::ComplexNumber::add(const ComplexNumber&cn) + { + return ComplexNumber(a+cn.a, b+cn.b); + } + + double FractalStage::ComplexNumber::magnitude() + { + return a*a+b*b; + } +} \ No newline at end of file diff --git a/SmashBros/FractalStage.h b/SmashBros/FractalStage.h new file mode 100755 index 0000000..760a593 --- /dev/null +++ b/SmashBros/FractalStage.h @@ -0,0 +1,119 @@ +#include "Stage.h" + +#pragma once + +namespace SmashBros +{ + class FractalStage : public Stage + { + private: + class RandomThing : public GameElement + { + private: + double newScale; + double scaleIncr; + + public: + boolean isDead; + + RandomThing(); + RandomThing(boolean create); + virtual ~RandomThing(); + + virtual void Update(long gameTime); + virtual void onMoveFinish(); + }; + + class NicCage : public RandomThing + { + private: + float rotate; + GameElement*swirl; + + public: + boolean isrotating; + + NicCage(); + virtual ~NicCage(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class RandomStuff + { + private: + ArrayList creepy; + long nextSpawnTime; + + public: + RandomStuff(); + virtual ~RandomStuff(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class ComplexNumber + { + private: + double a, b; + + public: + ComplexNumber(); + ComplexNumber(double a, double b); + ComplexNumber square(); + ComplexNumber add(const ComplexNumber&cn); + double magnitude(); + }; + + class Fractal + { + private: + static const unsigned int WIDTH = 350; + static const unsigned int HEIGHT = 350; + + ComplexNumber c; + boolean**values; + + double minX,maxX,minY,maxY; + double Scale; + + Color color1,color2; + + BufferedImage*image; + Image img; + + double threshold; + int iterations; + + void redrawFractal(); + void getValues(); + boolean isInSet(ComplexNumber cn); + + public: + int inverted; + + Fractal(); + virtual ~Fractal(); + + virtual void Draw(Graphics2D&g, long gameTime); + }; + + Fractal*f; + RandomStuff*randomstuff; + + void loadGameElements(); + void loadPlatforms(); + void loadHangPoints(); + void createGenericPlatform(byte type, float x1, float y1); + void createSolidPlatform(float x1, float y1); + + public: + FractalStage(int x1, int y1); + virtual ~FractalStage(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/Game.cpp b/SmashBros/Game.cpp new file mode 100755 index 0000000..ac81a1a --- /dev/null +++ b/SmashBros/Game.cpp @@ -0,0 +1,91 @@ +#include "Game.h" +#include "Preferences.h" +#include "Controls.h" +#include "Menus.h" +#include "GameScreen.h" + +namespace SmashBros +{ + Game::Game() + { + //Constructor + firstUpdate = true; + drawnOnce = false; + } + + Game::~Game() + { + // + } + + void Game::Initialize() + { + //Initialize things + scaleToWindow(true,900,600); + + Global::init(); + Controls::loadControls(); + Preferences::init(); + Preferences::load(); + + AssetManager::loadImage("Images/icon.png"); + setLoadScreen("Images/loading.png"); + + showRealFPS(true); + if(Preferences::highFPS()) + { + setFPS(60); + setUpdatesPerFrame(1); + } + else + { + setFPS(30); + setUpdatesPerFrame(2); + } + //setWindowTitle("Super Smash Bros."); + } + + void Game::LoadContent() + { + bool thingy = true; + Console::WriteLine((byte)thingy); + //Load Things + Menus::loadAssets(); + Menus::loadMenus(); + ScreenManager::Add(new GameScreen("Game")); + ScreenManager::GoToScreen("TitleScreen"); + if(Preferences::debuglog) + { + Console::OutputToFile(true, "iSSB.log"); + } + } + + void Game::UnloadContent() + { + // + } + + void Game::Update(long gameTime) + { + if(firstUpdate && drawnOnce) + { + if(Preferences::newVersion) + { + Preferences::newVersion = false; + Game::showMessage("Attention!", Preferences::versionMessage); + } + firstUpdate = false; + } + if(KeyPressed(Keys::ESCAPE) && !PrevKeyPressed(Keys::ESCAPE)) + { + Exit(); + } + ScreenManager::Update(gameTime); + } + + void Game::Draw(Graphics2D& g, long gameTime) + { + ScreenManager::Draw(g, gameTime); + drawnOnce = true; + } +} \ No newline at end of file diff --git a/SmashBros/Game.h b/SmashBros/Game.h new file mode 100755 index 0000000..f593a0f --- /dev/null +++ b/SmashBros/Game.h @@ -0,0 +1,22 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class Game : public GameEngine::Application + { + private: + bool firstUpdate; + bool drawnOnce; + public: + Game(); + virtual ~Game(); + + void Initialize(); + void LoadContent(); + void UnloadContent(); + void Update(long gameTime); + void Draw(Graphics2D& g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/GameElement.cpp b/SmashBros/GameElement.cpp new file mode 100755 index 0000000..5b48d11 --- /dev/null +++ b/SmashBros/GameElement.cpp @@ -0,0 +1,524 @@ +#include "GameElement.h" +#include "Camera.h" + +namespace SmashBros +{ + GameElement::GameElement(float x1, float y1) : Actor(x1,y1) + { + prevAnim = ""; + prevFrame = 0; + } + + GameElement::~GameElement() + { + // + } + + void GameElement::Update(long gameTime) + { + Actor::Update(gameTime); + } + + void GameElement::Draw(Graphics2D&g, long gameTime) + { + drawActor(g, gameTime,(float)(x*Camera::Zoom), (float)(y*Camera::Zoom), Scale*Camera::Zoom); + } + + bool GameElement::isOnScreen() + { + float left1, left2; + float right1, right2; + float top1, top2; + float bottom1, bottom2; + + Animation*anim = getAnimation(); + + float w = (float)anim->getWidth()*Scale*Camera::Zoom; + float h = (float)anim->getHeight()*Scale*Camera::Zoom; + + left1 = ((x*Camera::Zoom)-(((float)w/2)*Camera::Zoom)); + left2 = View::x; + right1 = ((x*Camera::Zoom)+(((float)w/2)*Camera::Zoom)); + right2 = (View::x+(View::ScaleWidth())); + top1 = ((y*Camera::Zoom)-(((float)h/2)*Camera::Zoom)); + top2 = View::y; + bottom1 = ((y*Camera::Zoom)+(((float)h/2)*Camera::Zoom)); + bottom2 = (View::y+(View::ScaleHeight())); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + byte GameElement::isColliding2(GameElement*collide) + { + RectF overlap = getOverlapArea(collide); + if(overlap.left != -1) + { + RectF overlap2 = collide->getOverlapArea(this); + + int w = (int)(overlap.right - overlap.left); + int h = (int)(overlap.bottom - overlap.top); + + float x1 = ((float)overlap.left/Scale); + float y1 = ((float)overlap.top/Scale); + float x2 = ((float)overlap2.left/collide->Scale); + float y2 = ((float)overlap2.top/collide->Scale); + + float incr1 = (float)(1/Scale); + float incr2 = (float)(1/collide->Scale); + + boolean colliding = false; + + boolean g1 = false; + boolean g2 = false; + + int left1 = 0; + int right1 = 0; + int top1 = 0; + int bottom1 = 0; + + int left2 = 0; + int right2 = 0; + int top2 = 0; + int bottom2 = 0; + + PixelIterator pxlIter(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)w,(int)h); + PixelIterator colPxlIter(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)w,(int)h); + + for(int cntY = 0; cntY right1) + { + right1 = cntX; + } + if(cntY < top1) + { + top1 = cntY; + } + else if(cntY > bottom1) + { + bottom1 = cntY; + } + } + g1 = true; + } + + if(grid2) + { + if(!g2) + { + left2 = cntX; + right2 = cntX; + top2 = cntY; + bottom2 = cntY; + } + else + { + if(cntX < left2) + { + left2 = cntX; + } + else if(cntX > right1) + { + right2 = cntX; + } + if(cntY < top2) + { + top2 = cntY; + } + else if(cntY > bottom2) + { + bottom2 = cntY; + } + } + g2 = true; + } + + if(grid1 && grid2) + { + colliding = true; + } + } + } + + if(colliding) + { + GameEngine::Rectangle r1 = GameEngine::Rectangle(left1,top1, right1-left1, bottom1-top1); + GameEngine::Rectangle r2 = GameEngine::Rectangle(left2,top2, right2-left2, bottom2-top2); + + byte dir = getDir(r1,r2); + + if(dir==DIR_UPLEFT) + { + dir = DIR_UP; + } + else if(dir==DIR_UPRIGHT) + { + dir = DIR_UP; + } + else if(dir==DIR_DOWNLEFT) + { + dir = DIR_DOWN; + } + else if(dir==DIR_DOWNRIGHT) + { + dir = DIR_DOWN; + } + + return dir; + } + } + return 0; + } + + boolean GameElement::rectsColliding(Rectangle r1, Rectangle r2) + { + float left1, left2; + float right1, right2; + float top1, top2; + float bottom1, bottom2; + + left1 = (float)r1.x; + left2 = (float)r2.x; + right1 = (float)r1.x + r1.width; + right2 = (float)r2.x + r2.width; + top1 = (float)r1.y; + top2 = (float)r2.y; + bottom1 = (float)r1.y+ r1.height; + bottom2 = (float)r2.y + r2.height; + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + boolean GameElement::rectsColliding(RectangleF r1, RectangleF r2) + { + float left1, left2; + float right1, right2; + float top1, top2; + float bottom1, bottom2; + + left1 = (float)r1.x; + left2 = (float)r2.x; + right1 = (float)r1.x + r1.width; + right2 = (float)r2.x + r2.width; + top1 = (float)r1.y; + top2 = (float)r2.y; + bottom1 = (float)r1.y+ r1.height; + bottom2 = (float)r2.y + r2.height; + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + RectangleF GameElement::getOverlapRect(RectangleF r1, RectangleF r2) + { + RectangleF overlap; + + if(rectsColliding(r1,r2)) + { + if(r1.x <= r2.x) + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.x = r2.x - r1.x; + overlap.width = r1.width; + } + else + { + overlap.x = r2.x - r1.x; + overlap.width = overlap.x + r2.width; + } + } + else + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.x = 0; + overlap.width = r1.width; + } + else + { + overlap.x = 0; + overlap.width = (r2.x + r2.width) - r1.x; + } + } + + if(r1.y <= r2.y) + { + if((r1.y + r1.height) <= (r2.y + r2.height)) + { + overlap.y = r2.y - r1.y; + overlap.height = r1.height; + } + else + { + overlap.y = r2.y - r1.y; + overlap.height = overlap.y + r2.height; + } + } + else + { + if((r1.y + r1.height)<= (r2.y + r2.height)) + { + overlap.y = 0; + overlap.height = r1.height; + } + else + { + overlap.y = 0; + overlap.height = (r2.y + r2.height) - r1.y; + } + } + } + else + { + overlap.x = -1; + overlap.y = -1; + overlap.width = -1; + overlap.height = -1; + } + return RectangleF(overlap.x,overlap.y, overlap.width - overlap.x, overlap.height - overlap.y); + } + + Rectangle GameElement::getOverlapRect(Rectangle r1, Rectangle r2) + { + Rectangle overlap; + + if(rectsColliding(r1,r2)) + { + if(r1.x <= r2.x) + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.x = r2.x - r1.x; + overlap.width = r1.width; + } + else + { + overlap.x = r2.x - r1.x; + overlap.width = overlap.x + r2.width; + } + } + else + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.x = 0; + overlap.width = r1.width; + } + else + { + overlap.x = 0; + overlap.width = (r2.x + r2.width) - r1.x; + } + } + + if(r1.y <= r2.y) + { + if((r1.y + r1.height) <= (r2.y + r2.height)) + { + overlap.y = r2.y - r1.y; + overlap.height = r1.height; + } + else + { + overlap.y = r2.y - r1.y; + overlap.height = overlap.y + r2.height; + } + } + else + { + if((r1.y + r1.height)<= (r2.y + r2.height)) + { + overlap.y = 0; + overlap.height = r1.height; + } + else + { + overlap.y = 0; + overlap.height = (r2.y + r2.height) - r1.y; + } + } + } + else + { + overlap.x = -1; + overlap.y = -1; + overlap.width = -1; + overlap.height = -1; + } + return Rectangle(overlap.x,overlap.y, overlap.width - overlap.x, overlap.height - overlap.y); + } + + byte GameElement::solidElementCollision(GameElement*collide) + { + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)x - width/2, (int)y - height/2, width, height); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)(collide->x - collide->width/2),(int)(collide->y - collide->height/2),collide->width,collide->height); + GameEngine::Rectangle collideOverlap = getOverlapRect(r2,r1); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX = collideOverlap.x; + int endX = collideOverlap.x + collideOverlap.width; + int startY = collideOverlap.y; + int endY = collideOverlap.y + collideOverlap.height; + + float x1 = ((float)startX/collide->Scale); + float y1 = ((float)startY/collide->Scale); + float incr = (float)(1/collide->Scale); + + int left=0; + int right=0; + int top=0; + int bottom=0; + boolean colliding = false; + + PixelIterator colPxlIter(collide); + colPxlIter.reset(x1,y1,incr,incr,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY; cntYright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + colliding = true; + } + } + } + + if(colliding) + { + int w = right - left; + int h = bottom - top; + GameEngine::Rectangle collideOverlap2 = GameEngine::Rectangle(left, top, w, h); + int overlapX = (left - startX) + overlap.x + (w/2); + int overlapY = (top - startY) + overlap.y + (h/2); + byte dir = getDir2((float)width/2,(float)height/2,(float)overlapX, (float)overlapY); + switch(dir) + { + case DIR_DOWN: + y = (collideOverlap2.y + (collide->y - collide->height/2)) - height/2; + return DIR_UP; + + case DIR_UP: + y = ((collide->y - collide->height/2) + (collideOverlap2.y + collideOverlap2.height)) + height/2; + return DIR_DOWN; + + case DIR_LEFT: + x = ((collide->x - collide->width/2) + (collideOverlap2.x + collideOverlap2.width) + width/2); + return DIR_RIGHT; + + case DIR_RIGHT: + x = (collideOverlap2.x + (collide->x - collide->width/2)) - width/2; + return DIR_LEFT; + } + } + } + return 0; + } +} \ No newline at end of file diff --git a/SmashBros/GameElement.h b/SmashBros/GameElement.h new file mode 100755 index 0000000..832a32c --- /dev/null +++ b/SmashBros/GameElement.h @@ -0,0 +1,34 @@ +#include "GameEngine/GameEngine.h" +#include "SmashForwards.h" + +#pragma once + +namespace SmashBros +{ + class GameElement : public Actor + { + private: + String prevAnim; + int prevFrame; + + static boolean rectsColliding(RectangleF r1, RectangleF r2); + byte solidElementCollision(GameElement*collide); + friend class Item; + + protected: + byte isColliding2(GameElement*collide); + static RectangleF getOverlapRect(RectangleF r1, RectangleF r2); + static GameEngine::Rectangle getOverlapRect(GameEngine::Rectangle r1, GameEngine::Rectangle r2); + + public: + GameElement(float x1, float y1); + virtual ~GameElement(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + bool isOnScreen(); + + static boolean rectsColliding(GameEngine::Rectangle r1, GameEngine::Rectangle r2); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Actor.cpp b/SmashBros/GameEngine/Actor.cpp new file mode 100755 index 0000000..e904ff7 --- /dev/null +++ b/SmashBros/GameEngine/Actor.cpp @@ -0,0 +1,1307 @@ +#include "Actor.h" +#include "Application.h" +#include "WireframeActor.h" +#include "PixelIterator.h" +#include "View.h" +#include "Console.h" + +namespace GameEngine +{ + void Actor::createActor(float x, float y) //common method called by 2 constructors + { + anim = NULL; + lastAnim = NULL; + currentImageX = 0; + currentImageY = 0; + currentImageW = 0; + currentImageH = 0; + moving = false; + moveSpeed = 0; + showwire=false; + visible = true; + mirrored = false; + mirroredVertical = false; + mouseover = false; + prevMouseover = false; + mouseOverPixel = false; + relative = true; + wireframeColor = Color::GREEN; + clicked = false; + prevclicked = false; + firstAnimChange = true; + touchId = 0; + currentTouchId = 0; + + animMgr = new AnimationManager(); + Scale = 1; + Alpha = 0; + this->x=x; + this->y=y; + xprev=x; + yprev=y; + xSpeed = 0; + ySpeed = 0; + xvelocity=0; + yvelocity=0; + width=1; + height=1; + color = Color(255,255,255,255); + frameTime=0; + lastFrameTime=0; + Rotation=0; + + actorType=1; + for(int i=0; i=movePoint[0])) || ((y=movePoint[1])) + || ((x>movePoint[0])&&(newX<=movePoint[0])) || ((y>movePoint[1])&&(newY<=movePoint[1]))) + { + finished = true; + } + + if(finished) + { + x = movePoint[0]; + y = movePoint[1]; + moving = false; + if(eventEnabled(EVENT_MOVEFINISH)) + { + onMoveFinish(); + } + } + else + { + x = newX; + y = newY; + } + } + } + + bool Actor::pixelAtPoint(int col, int row) + { + BufferedImage*currentImage = lastAnim->getCurrentImage(); + int x1 = 0; + int y1 = 0; + bool mirror = false; + bool mirrorVertical = false; + + if((lastAnim->mirrored() && !this->mirrored) || (!lastAnim->mirrored() && this->mirrored)) + { + mirror = true; + } + if((lastAnim->mirroredVertical() && !this->mirroredVertical) || (!lastAnim->mirroredVertical() && this->mirroredVertical)) + { + mirrorVertical = true; + } + + if(mirror) + { + x1 = currentImageX + ((currentImageW-1) - col); + } + else + { + x1 = currentImageX + col; + } + + if(mirrorVertical) + { + y1 = currentImageY + ((currentImageH-1) - row); + } + else + { + y1 = currentImageY + row; + } + + if(col < currentImageW && row < currentImageH) + { + return currentImage->pixelAtPoint(x1, y1); + } + return false; + } + + void Actor::updateSize() + { + if(lastAnim!=NULL) + { + BufferedImage*img = lastAnim->getCurrentImage(); + switch(lastAnim->getType()) + { + default: + this->width = (int)((img->getWidth()*Scale)/lastAnim->getCols()); + this->height = (int)((img->getHeight()*Scale)/lastAnim->getRows()); + break; + + case 0: + this->width = (int)(img->getWidth()*Scale); + this->height = (int)(img->getHeight()*Scale); + break; + } + } + } + + void Actor::updateAnim() + { + if(anim!=NULL) + { + BufferedImage*currentImage = anim->getCurrentImage(); + int imgW = currentImage->getWidth(); + int imgH = currentImage->getHeight(); + switch(anim->getType()) + { + case 0: + currentImageW = imgW; + currentImageH = imgH; + currentImageX = 0; + currentImageY = 0; + break; + + default: + currentImageW = imgW/anim->getCols(); + currentImageH = imgH/anim->getRows(); + currentImageX = (anim->getCurrentFrame()%anim->getCols())*currentImageW; + currentImageY = (anim->getCurrentFrame()/anim->getCols())*currentImageH; + break; + } + lastAnim = anim; + updateSize(); + } + } + + void Actor::drawActor(Graphics2D& g, long gameTime, float x1, float y1, double scale, bool relativeToScreen) + { + if(frameTime==0) + { + int addTime; + if(anim->fps == 0) + { + addTime = 0; + } + else + { + addTime=1000/anim->fps; + } + frameTime=gameTime+addTime; + lastFrameTime=gameTime; + anim->drawFrame(this,g,anim->getCurrentFrame(),x1,y1,scale,relativeToScreen); + } + else if(frameTime<=gameTime) + { + int addTime; + if(anim->fps == 0) + { + addTime = 0; + } + else + { + addTime=1000/anim->fps; + } + frameTime+=addTime; //frameTime = lastFrameTime + (addTime*2); //frameTime = gameTime+addTime; + lastFrameTime=gameTime; + anim->nextFrame(this,g,x1,y1,scale,relativeToScreen); + } + else + { + anim->drawFrame(this,g,anim->getCurrentFrame(),x1,y1,scale,relativeToScreen); + } + if(showwire) + { + Color color = g.getColor(); + int w = (int)(anim->width*scale); + int h = (int)(anim->height*scale); + g.setColor(wireframeColor); + g.drawRect((x1-View::x-w/2), (y1-View::y-h/2), (float)w, (float)h); + g.setColor(color); + } + } + + bool Actor::checkHover(float x1, float y1) + { + int mousex = 0; + int mousey = 0; + if(relative) + { + mousex = (int)((float)x1 + View::x); + mousey = (int)((float)y1 + View::y); + } + else + { + mousex = (int)x1; + mousey = (int)y1; + } + if(mouseOverPixel) + { + if (mousex<(x+(width/2)) && mousex>(x-(width/2)) && mousey<(y+(height/2)) && mousey>(y-(height/2))) + { + int rX = (int)((mousex - (x-(width/2)))/Scale); + int rY = (int)((mousey - (y-(height/2)))/Scale); + if(pixelAtPoint(rX, rY)) + { + return true; + } + return false; + } + return false; + } + else + { + if (mousex<(x+(width/2)) && mousex>(x-(width/2)) && mousey<(y+(height/2)) && mousey>(y-(height/2))) + { + return true; + } + return false; + } + } + + Actor::~Actor() + { + delete animMgr; + } + + Actor::Actor() + { + createActor(0,0); + } + + Actor::Actor(const Actor& actor) + { + xprev = actor.xprev; + yprev = actor.yprev; + + xSpeed = actor.xSpeed; + ySpeed = actor.ySpeed; + + currentImageX = actor.currentImageX; + currentImageY = actor.currentImageY; + currentImageW = actor.currentImageW; + currentImageH = actor.currentImageH; + + frameTime = actor.frameTime; + lastFrameTime = actor.lastFrameTime; + color = Color(actor.color); + + Alpha = actor.Alpha; + Rotation = actor.Rotation; + + for(int i=0; iget(actor.anim->name); + lastAnim = animMgr->get(actor.anim->name); + + xvelocity = actor.xvelocity; + yvelocity = actor.yvelocity; + + Scale = actor.Scale; + } + + Actor::Actor(float x1,float y1) + { + createActor(x1,y1); + } + + Actor& Actor::operator=(const Actor& actor) + { + delete animMgr; + + xprev = actor.xprev; + yprev = actor.yprev; + + xSpeed = actor.xSpeed; + ySpeed = actor.ySpeed; + + currentImageX = actor.currentImageX; + currentImageY = actor.currentImageY; + currentImageW = actor.currentImageW; + currentImageH = actor.currentImageH; + + frameTime = actor.frameTime; + lastFrameTime = actor.lastFrameTime; + color = Color(actor.color); + + Alpha = actor.Alpha; + Rotation = actor.Rotation; + + for(int i=0; iget(actor.anim->name); + lastAnim = animMgr->get(actor.anim->name); + + xvelocity = actor.xvelocity; + yvelocity = actor.yvelocity; + + Scale = actor.Scale; + + return *this; + } + + void Actor::Update(long gameTime) + { + updateAnim(); + + prevclicked = clicked; + + xSpeed = x - xprev; + ySpeed = y - yprev; + + xprev = x; + yprev = y; + + x+=xvelocity; + y+=yvelocity; + + updateMoveTo(); + + long prevTouchId = currentTouchId; + + bool onmouseenter = false; + bool onmouseleave = false; + bool onclick = false; + bool onrelease = false; + + if(mouseOver()) + { + bool prevMouseOver = mouseover; + if(!mouseover) + { + mouseover=true; + if(eventEnabled(EVENT_MOUSEENTER)) + { + onmouseenter = true; + } + } + if(!prevMouseOver && !Application::checkPrevTouchActive(touchId)) + { + clicked = true; + if(eventEnabled(EVENT_MOUSECLICK)) + { + onclick = true; + } + } + } + else if(mouseover) + { + mouseover=false; + if(eventEnabled(EVENT_MOUSELEAVE)) + { + onmouseleave = true; + } + } + if(clicked && prevMouseover && !Application::checkTouchActive(prevTouchId)) + { + clicked = false; + if(eventEnabled(EVENT_MOUSERELEASE)) + { + onrelease = true; + } + } + + if(clicked && !Application::checkTouchActive(touchId)) + { + clicked = false; + } + + currentTouchId = touchId; + prevMouseover = mouseover; + + if(onmouseenter) + { + onMouseEnter(); + } + if(onclick) + { + onClick(); + } + if(onmouseleave) + { + onMouseLeave(); + } + if(onrelease) + { + onRelease(); + } + } + + void Actor::Draw(Graphics2D& g,long gameTime) + { + drawActor(g,gameTime,x,y,Scale,relative); + } + + void Actor::mirror(bool toggle) + { + this->mirrored = toggle; + } + + void Actor::mirrorVertical(bool toggle) + { + this->mirroredVertical = toggle; + } + + bool Actor::eventEnabled(unsigned char eventCode) + { + if(eventCode>totalEvents) + { + Console::WriteLine((String)"Error: EventEnabled(unsigned char). Invalid argument " + eventCode + (String)". Event does not exist"); + return false; + } + else + { + return enabledEvents[eventCode]; + } + } + + void Actor::eventEnable(unsigned char eventCode) + { + if(eventCode>totalEvents) + { + Console::WriteLine((String)"Error: EventEnable(unsigned char). Invalid argument " + eventCode + (String)". Event does not exist"); + } + else + { + enabledEvents[eventCode]=true; + } + } + + void Actor::eventDisable(unsigned char eventCode) + { + if(eventCode>totalEvents) + { + Console::WriteLine((String)"Error: EventDisable(unsigned char). Invalid argument " + eventCode + (String)". Event does not exist"); + } + else + { + enabledEvents[eventCode]=false; + } + } + + void Actor::changeAnimation(Animation*animation, unsigned char dir) + { + if(dir==NO_CHANGE) + { + String aName=animation->name; + if(firstAnimChange) + { + this->anim=animation; + this->anim->setCurrentFrame(0); + frameTime=0; + //anim.drawFrame(graphics,0,x,y); + this->anim->direction=FORWARD; + } + else if(!(aName.equals(this->anim->name))) + { + this->anim=animation; + //anim.drawFrame(graphics,0,x,y); + long newFrameTime = lastFrameTime + (1000/anim->fps); + if(newFrameTimeanim=animation; + this->anim->setCurrentFrame(0); + frameTime=0; + //anim.drawFrame(graphics,0,x,y); + this->anim->direction=STOPPED; + } + else if(dir==FORWARD) + { + this->anim=animation; + this->anim->setCurrentFrame(0); + frameTime=0; + //anim.drawFrame(graphics,0,x,y); + this->anim->direction=FORWARD; + } + else if(dir==BACKWARD) + { + this->anim=animation; + this->anim->setCurrentFrame(0); + frameTime=0; + //anim.drawFrame(graphics,anim.frames,x,y); + this->anim->direction=BACKWARD; + } + if(firstAnimChange) + { + Vector2i size = animation->getSize(); + width = size.x; + height = size.y; + lastAnim = anim; + } + firstAnimChange = false; + } + + void Actor::changeAnimation(String animName, unsigned char dir) + { + Animation*animation = animMgr->get(animName); + changeAnimation(animation, dir); + } + + void Actor::changeAnimation(unsigned int index, unsigned char dir) + { + Animation*animation = animMgr->animations[index]; + changeAnimation(animation, dir); + } + + void Actor::changeAnimationDirection(unsigned char dir) + { + if(dir==FORWARD || dir==BACKWARD || dir==STOPPED) + { + this->anim->direction = dir; + } + } + + void Actor::onAnimationFinish(const String&n) //inherited user-defined method. is called when an animation ends and String is name of animation + { + //Open for implementation + } + + void Actor::addAnimation(Animation*a) //add an animation to Actor's AnimationManager + { + animMgr->add(a); + } + + void Actor::removeAnimation(String aName) //removes an animation from Actor's AnimationManager + { + animMgr->remove(aName); + } + + Animation*Actor::getAnimation() + { + return anim; + } + + Animation*Actor::getLastAnimation() + { + return lastAnim; + } + + void Actor::relativeToView(bool toggle) + { + relative = toggle; + } + + void Actor::mouseOverUsesPixel(bool toggle) + { + mouseOverPixel = toggle; + } + + bool Actor::mouseOver() + { + if(mouseover) + { + if(Application::checkTouchActive(currentTouchId)) + { + if(checkHover(Application::TouchX(currentTouchId), Application::TouchY(currentTouchId))) + { + return true; + } + } + } + ArrayList points = Application::getTouchPoints(); + for(int i=0; igetOverlapArea(this); + + int w = overlap.right - overlap.left; + int h = overlap.bottom - overlap.top; + + float x1 = ((float)overlap.left/Scale); + float y1 = ((float)overlap.top/Scale); + float x2 = ((float)overlap2.left/collide->Scale); + float y2 = ((float)overlap2.top/collide->Scale); + + float incr1 = (float)(1/Scale); + float incr2 = (float)(1/collide->Scale); + + float pntX1 = x1; + float pntY1 = y1; + float pntX2 = x2; + float pntY2 = y2; + + for(int cntY = 0; cntYpixelAtPoint((int)(pntX2),(int)(pntY2))) + { + return true; + } + pntX1+=incr1; + pntX2+=incr2; + } + pntY1+=incr1; + pntY2+=incr2; + } + return false; + } + return false; + }*/ + + bool Actor::isColliding(Actor*collide) + { + RectF overlap = getOverlapArea(collide); + if(overlap.left != -1) + { + RectF overlap2 = collide->getOverlapArea(this); + + int w = (int)(overlap.right - overlap.left); + int h = (int)(overlap.bottom - overlap.top); + + float x1 = ((float)overlap.left/Scale); + float y1 = ((float)overlap.top/Scale); + float x2 = ((float)overlap2.left/collide->Scale); + float y2 = ((float)overlap2.top/collide->Scale); + + float incr1 = (float)(1/Scale); + float incr2 = (float)(1/collide->Scale); + + PixelIterator pxlIter(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)w,(int)h); + PixelIterator colPxlIter(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)w,(int)h); + + for(int cntY = 0; cntYname; + } + + unsigned int Actor::getAnimIndex() + { + if(anim!=NULL) + { + for(unsigned int i=0; ianimations.size(); i++) + { + Animation*cmp = animMgr->animations.get(i); + if(anim == cmp) + { + return i; + } + } + } + return 0; + } + + int Actor::getCurrentFrame() + { + return anim->currentFrame; + } + + bool Actor::rectsColliding(Actor*collide) //tells if Actor's bounding boxes are colliding + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + left1 = (int)x-(width/2); + left2 = (int)collide->x-(collide->width/2); + right1 = (int)x+(width/2); + right2 = (int)collide->x+(collide->width/2); + top1 = (int)y-(height/2); + top2 = (int)collide->y-(collide->height/2); + bottom1 = (int)y+(height/2); + bottom2 = (int)collide->y+(collide->height/2); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + bool Actor::rectsColliding(WireframeActor*collide) //tells if WireframeActor's bounding boxes are colliding + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + left1 = (int)x-(width/2); + left2 = (int)collide->x; + right1 = (int)x+(width/2); + right2 = (int)collide->x + collide->width; + top1 = (int)y-(height/2); + top2 = (int)collide->y; + bottom1 = (int)y+(height/2); + bottom2 = (int)collide->y + collide->height; + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + bool Actor::circlesColliding(WireframeActor*collide) //tells if WireframeActor's "bounding circles" are colliding + { + double r1 = distanceUnSqr(x,y,x-(width/2),y-(height/2)); + double r2 = distanceUnSqr(collide->x,collide->y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + double dist = r1+r2; + double realDist = distanceUnSqr(x,y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + if(realDistx,collide->y,collide->x-(collide->width/2),collide->y-(collide->height/2)); + double dist = r1+r2; + double realDist = distanceUnSqr(x,y,collide->x,collide->y); + if(realDistx,collide->y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + double dist = (r1+r2)*mult; + double realDist = mult*distanceUnSqr(x,y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + if(realDistx,collide->y,collide->x-(collide->width/2),collide->y-(collide->height/2)); + double dist = (r1+r2)*mult; + double realDist = mult*distanceUnSqr(x,y,collide->x,collide->y); + if(realDistx,collide->y,collide->x-(collide->width/2),collide->y-(collide->height/2)); + double dist = (r1+r2); + double dir = direction(x,y,collide->x,collide->y); + double xIncr = (-cos(degtorad(dir))*(dist*0.71)); + double yIncr = (sin(degtorad(dir))*(dist*0.71)); + x=collide->x+(int)xIncr; + y=collide->y+(int)yIncr; + /*if(yy) + { + if(yvelocity>0) + { + yvelocity=0; + } + xvelocity=0; + onGround=true; + }*/ + } + + void Actor::circleResponse(WireframeActor*collide) //response to circle collision. commented out things are recommended for use by inherited Actor's in platformer games + { + double r1 = distance(x,y,x-(width/2),y-(height/2)); + double r2 = distance(collide->x+(collide->width/2),collide->y+(collide->width/2),collide->x,collide->y); + double dist = (r1+r2); + double dir = direction(x,y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + double xIncr = (-cos(degtorad(dir))*(dist*0.71)); + double yIncr = (sin(degtorad(dir))*(dist*0.71)); + x=collide->x + collide->width/2 + (int)xIncr; + y=collide->y + collide->height/2 + (int)yIncr; + /*if(y<(collide->y+(collide->height/2))) + { + if(yvelocity>0) + { + yvelocity=0; + } + xvelocity=0; + onGround=true; + }*/ + } + + void Actor::rectResponse(Actor*collide, unsigned char d) //response to box collision. commented out things are recommended for use by inherited Actor's in platformer games. can pass in direction (defined in PrimitiveActor) + { + //unsigned char d = CheckSide(collide,this); + if(d==DIR_UP) + { + y=((collide->y-(collide->height/2))-(height/2)); + } + else if(d==DIR_UPRIGHT) + { + y=((collide->y-(collide->height/2))-(height/2)); + x=(collide->x+(collide->width/2)+(width/2)); + } + else if(d==DIR_RIGHT) + { + x=(collide->x+(collide->width/2)+(width/2)); + } + else if(d==DIR_DOWNRIGHT) + { + y=((collide->y+(collide->height/2))+(height/2)); + x=(collide->x+(collide->width/2)+(width/2)); + } + else if(d==DIR_DOWN) + { + y=((collide->y+(collide->height/2))+(height/2)); + } + else if(d==DIR_DOWNLEFT) + { + y=((collide->y+(collide->height/2))+(height/2)); + x=((collide->x-(collide->width/2))-(width/2)); + } + else if(d==DIR_LEFT) + { + x=((collide->x-(collide->width/2))-(width/2)); + } + else if(d==DIR_UPLEFT) + { + y=((collide->y-(collide->height/2))-(height/2)); + x=((collide->x-(collide->width/2))-(width/2)); + } + /*if(d==DIR_UP) + { + if(yvelocity>0) + { + yvelocity=0; + } + xvelocity=0; + onGround=true; + } + else if(d==DIR_RIGHT) + { + xvelocity=0; + } + else if(d==DIR_LEFT) + { + xvelocity=0; + }*/ + } + + void Actor::rectResponse(WireframeActor*collide, unsigned char d) //response to box collision. commented out things are recommended for use by inherited Actor's in platformer games. can pass in direction (defined in PrimitiveActor) + { + //unsigned char d = CheckSide(collide,this); + if(d==DIR_UP) + { + y=(collide->y-(height/2)); + } + else if(d==DIR_UPRIGHT) + { + y=(collide->y-(height/2)); + x=(collide->x+collide->width+(width/2)); + } + else if(d==DIR_RIGHT) + { + x=(collide->x+collide->width+(width/2)); + } + else if(d==DIR_DOWNRIGHT) + { + y=(collide->y+collide->height+(height/2)); + x=(collide->x+collide->width+(width/2)); + } + else if(d==DIR_DOWN) + { + y=(collide->y+collide->height+(height/2)); + } + else if(d==DIR_DOWNLEFT) + { + y=(collide->y+collide->height+(height/2)); + x=(collide->x-(width/2)); + } + else if(d==DIR_LEFT) + { + x=(collide->x-(width/2)); + } + else if(d==DIR_UPLEFT) + { + y=(collide->y-(height/2)); + x=(collide->x-(width/2)); + } + /*if(d==DIR_UP) + { + if(yvelocity>0) + { + yvelocity=0; + } + xvelocity=0; + onGround=true; + } + else if(d==DIR_RIGHT) + { + xvelocity=0; + } + else if(d==DIR_LEFT) + { + xvelocity=0; + }*/ + } + + bool Actor::isOnScreen() + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + float w = anim->width*Scale; + float h = anim->height*Scale; + + left1 = (int)(x-(w/2)); + left2 = (int)View::x; + right1 = (int)(x+(w/2)); + right2 = (int)(View::x+(View::ScaleWidth())); + top1 = (int)(y-(h/2)); + top2 = (int)View::y; + bottom1 = (int)(y+(h/2)); + bottom2 = (int)(View::y+(View::ScaleHeight())); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + RectF Actor::getOverlapArea(Actor*a2) + { + RectangleF r1 = RectangleF(); + r1.x = this->x - ((float)this->width/2); + r1.y = this->y - ((float)this->height/2); + r1.width = (float)this->width; + r1.height = (float)this->height; + RectangleF r2 = RectangleF(); + r2.x = a2->x - ((float)a2->width/2); + r2.y = a2->y - ((float)a2->height/2); + r2.width = (float)a2->width; + r2.height = (float)a2->height; + + RectF overlap; + + if(this->rectsColliding(a2)) + { + if(r1.x <= r2.x) + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.left = r2.x - r1.x; + overlap.right = r1.width; + } + else + { + overlap.left = r2.x - r1.x; + overlap.right = overlap.left + r2.width; + } + } + else + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.left = 0; + overlap.right = r1.width; + } + else + { + overlap.left = 0; + overlap.right = (r2.x + r2.width) - r1.x; + } + } + + if(r1.y <= r2.y) + { + if((r1.y + r1.height) <= (r2.y + r2.height)) + { + overlap.top = r2.y - r1.y; + overlap.bottom = r1.height; + } + else + { + overlap.top = r2.y - r1.y; + overlap.bottom = overlap.top + r2.height; + } + } + else + { + if((r1.y + r1.height)<= (r2.y + r2.height)) + { + overlap.top = 0; + overlap.bottom = r1.height; + } + else + { + overlap.top = 0; + overlap.bottom = (r2.y + r2.height) - r1.y; + } + } + } + else + { + overlap.left = -1; + overlap.top = -1; + overlap.right = -1; + overlap.bottom = -1; + } + return overlap; + } + + void Actor::showWireframe(bool toggle) + { + showwire = toggle; + } + + void Actor::setWireframeColor(const Color&c) + { + wireframeColor = c; + } + + float Actor::getXSpeed() + { + return xSpeed; + } + + float Actor::getYSpeed() + { + return ySpeed; + } + + void Actor::setColor(const Color&c) //sets the actor's color tint + { + color = c; + } + + Color Actor::getColor() //returns the current color of the actor + { + return color; + } + + void Actor::setRotation(float degrees) //sets rotation of Actor in degrees + { + Rotation = degrees; + } + + float Actor::getRotation() //returns current rotation of Actor in degrees + { + return Rotation; + } + + void Actor::setAlpha(float alpha) + { + Alpha = alpha; + } + + float Actor::getAlpha() + { + return Alpha; + } + + void Actor::setVisible(bool toggle) + { + visible = toggle; + } + + bool Actor::isVisible() + { + return visible; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Actor.h b/SmashBros/GameEngine/Actor.h new file mode 100755 index 0000000..32dc119 --- /dev/null +++ b/SmashBros/GameEngine/Actor.h @@ -0,0 +1,173 @@ + +#include "forwards.h" +#include "PrimitiveActor.h" +#include "Animation.h" +#include "AnimationManager.h" + +#pragma once + +namespace GameEngine +{ + class Actor : public PrimitiveActor //Actor object + { + friend class PixelIterator; + friend class Animation; + private: + float xprev, yprev; + float xSpeed, ySpeed; + + int currentImageX; + int currentImageY; + int currentImageW; + int currentImageH; + + long frameTime; + long lastFrameTime; + Color color; + + float Alpha; + float Rotation; + + static const int totalEvents = 8; + bool enabledEvents[8]; + + bool moving; + float movePoint[2]; + float moveSpeed; + + bool showwire; + bool visible; + + bool mirrored; + bool mirroredVertical; + bool relative; + + bool mouseover; + bool prevMouseover; + bool mouseOverPixel; + + long touchId; + long currentTouchId; + + Color wireframeColor; + + AnimationManager*animMgr; + bool clicked; + bool prevclicked; + bool firstAnimChange; + + Animation*anim; + Animation*lastAnim; + + void createActor(float x, float y); + + void updateMoveTo(); + void updateSize(); + void updateAnim(); + + bool checkHover(float x1, float y1); + + protected: + void drawActor(Graphics2D& g, long gameTime, float x1, float y1, double scale, bool relativeToScreen=true); + + public: + static const unsigned char EVENT_MOUSECLICK = 0; + static const unsigned char EVENT_MOUSERELEASE = 1; + static const unsigned char EVENT_MOUSEENTER = 2; + static const unsigned char EVENT_MOUSELEAVE = 3; + static const unsigned char EVENT_ANIMATIONFINISH = 4; + static const unsigned char EVENT_MOVEFINISH = 5; + + float xvelocity,yvelocity; + + float Scale; + + Actor(); + Actor(const Actor& actor); + Actor(float x1,float y1); + virtual ~Actor(); + + Actor& operator=(const Actor& actor); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D& g,long gameTime); + + void mirror(bool toggle); + void mirrorVertical(bool toggle); + bool eventEnabled(unsigned char eventCode); + void eventEnable(unsigned char eventCode); + void eventDisable(unsigned char eventCode); + + void changeAnimation(Animation*anim, unsigned char dir); + void changeAnimation(String animName, unsigned char dir); + void changeAnimation(unsigned int index, unsigned char dir); + void changeAnimationDirection(unsigned char dir); + virtual void onAnimationFinish(const String&n); + void addAnimation(Animation*a); + void removeAnimation(String aName); + + Animation*getAnimation(); + Animation*getLastAnimation(); + + void relativeToView(bool toggle); + + void mouseOverUsesPixel(bool toggle); + bool mouseOver(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onClick(); + virtual void onRelease(); + + bool isClicked(); + bool wasClicked(); + + long getTouchId(); + + void moveTo(float x1, float y1, float speed); + + virtual void onMoveFinish(); + + String getAnimName(); + unsigned int getAnimIndex(); + int getCurrentFrame(); + + bool pixelAtPoint(int col, int row); + + bool isColliding(Actor*collide); + + bool rectsColliding(Actor*collide); + bool rectsColliding(WireframeActor*collide); + + bool circlesColliding(WireframeActor*collide); + bool circlesColliding(Actor*collide); + bool circlesColliding(WireframeActor*collide, double mult); + bool circlesColliding(Actor*collide, double mult); + void circleResponse(Actor*collide); + void circleResponse(WireframeActor*collide); + void rectResponse(Actor*collide, unsigned char d); + void rectResponse(WireframeActor*collide, unsigned char d); + + virtual bool isOnScreen(); + + RectF getOverlapArea(Actor*a2); + + void showWireframe(bool toggle); + void setWireframeColor(const Color&c); + + float getXSpeed(); + float getYSpeed(); + + void setColor(const Color&c); + Color getColor(); + + void setRotation(float degrees); + float getRotation(); + + void setAlpha(float alpha); + float getAlpha(); + + void setVisible(bool toggle); + bool isVisible(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Animation.cpp b/SmashBros/GameEngine/Animation.cpp new file mode 100755 index 0000000..6b9acbc --- /dev/null +++ b/SmashBros/GameEngine/Animation.cpp @@ -0,0 +1,786 @@ +#include "Animation.h" +#include "Application.h" +#include "AssetManager.h" +#include "Console.h" +#include "View.h" +#include "Actor.h" + +namespace GameEngine +{ + Animation::Animation(const Animation& anim) + { + frames = anim.frames; + names = anim.names; + currentFrame = anim.currentFrame; + recentFrame = anim.recentFrame; + isMirrored = anim.isMirrored; + isMirroredVertical = anim.isMirroredVertical; + rows = anim.rows; + cols = anim.cols; + + if(anim.sequence!=null) + { + sequence = new int[anim.frames]; + for(int i=0; i(); + recentFrame = 0; + animType = 0; + name = n; + frames = 0; + fps = speed; + currentFrame = 0; + direction = FORWARD; + width = 1; + height = 1; + isMirrored = false; + isMirroredVertical = false; + } + + Animation::Animation(String n,int speed,String frame) //(animType 0) + { + rows = 0; + cols = 0; + sequence = NULL; + names = ArrayList(); + recentFrame = 0; + animType = 0; + name = n; + frames = 0; + fps = speed; + currentFrame = 0; + direction = FORWARD; + width = 1; + height = 1; + isMirrored = false; + isMirroredVertical = false; + + addFrame(frame); + } + + Animation::Animation(String n,int speed,int xFrames,int yFrames) //(animType 1) + { + sequence = NULL; + names = ArrayList(); + recentFrame = 0; + animType=1; + name=n; + fps=speed; + currentFrame=0; + direction=FORWARD; + width = 1; + height = 1; + rows = xFrames; + cols = yFrames; + frames = 0; + isMirrored=false; + isMirroredVertical = false; + } + + Animation::Animation(String n,int speed,int xFrames,int yFrames,ArrayList seq) //(animType 2) + { + sequence = new int[seq.size()]; + names = ArrayList(); + recentFrame = 0; + animType=2; + + for(int i=0; igetWidth(); + size.y = img->getHeight(); + break; + + default: + img = AssetManager::getImage(names[0]); + size.x = img->getWidth()/cols; + size.y = img->getHeight()/rows; + break; + } + return size; + } + + void Animation::addFrame(String fName) //adds a frame to the animation + { + bool success=AssetManager::loadImage(fName); + switch(animType) + { + default: + if(success) + { + names.add(fName); + frames++; + } + else + { + Console::WriteLine((String)"Error: Attempt to add image " + fName + (String)" to animation failed!"); + } + break; + + case 1: + if(success) + { + if(names.size()>0) + { + names.clear(); + names.add(fName); + } + else + { + names.add(fName); + } + frames=rows*cols; + } + else + { + Console::WriteLine((String)"Error: Attempt to add image " + fName + (String)" to animation failed!"); + } + break; + + case 2: + if(success) + { + if(names.size()>0) + { + names.clear(); + names.add(fName); + } + else + { + names.add(fName); + } + } + else + { + Console::WriteLine((String)"Error: Attempt to add image " + fName + (String)" to animation failed!"); + } + break; + } + } + + BufferedImage*Animation::getCurrentImage() + { + switch(animType) + { + default: + return AssetManager::getImage(names[0]); + + case 0: + return AssetManager::getImage(names[recentFrame]); + } + } + + int Animation::getCols() + { + return cols; + } + + int Animation::getRows() + { + return rows; + } + + int Animation::getType() + { + return animType; + } + + + void Animation::drawFrame(Actor*a,Graphics2D& g, float x1, float y1, double scale) + { + drawFrame(a,g, 0, x1, y1, scale,true); + } + + void Animation::drawFrame(Actor*a, Graphics2D& g, int fNum, float x1, float y1, double scale) + { + drawFrame(a,g, fNum, x1, y1, scale,true); + } + + void Animation::drawFrame(Actor*a,Graphics2D& g,int fNum, float x1, float y1, double scale, bool relativeToScreen) + { + double rotation; + unsigned char alpha = 255; + Color color; + + bool isMirrored = this->isMirrored; + bool isMirroredVertical = this->isMirroredVertical; + + if(a!=NULL) + { + rotation = a->getRotation(); + alpha = (unsigned char)(255 - (a->getAlpha()*255)); + color = a->getColor(); + if(a->mirrored) + { + if(isMirrored) + { + isMirrored = false; + } + else + { + isMirrored = true; + } + } + if(a->mirroredVertical) + { + if(isMirroredVertical) + { + isMirroredVertical = false; + } + else + { + isMirroredVertical = true; + } + } + } + else + { + rotation = 0; + alpha = 255; + color = Color::WHITE; + } + + int frmPnt[2]; + BufferedImage*img; + if(rotation!=0 || alpha<255) + { + g.setAlpha(alpha); + if(relativeToScreen) + { + g.rotate((float)rotation,x1-View::x,y1-View::y); + } + else + { + g.rotate((float)rotation,x1,y1); + } + } + g.setImageMask(color); + + int frameNum; + + switch(animType) + { + default: + frameNum = 0; + break; + + case 0: + frameNum = fNum; + break; + } + + img = AssetManager::getImage(names[frameNum]); + + currentFrame=fNum; + + bool singleframe = false; + + switch(animType) + { + case 0: + singleframe = true; + width = img->getWidth(); + height = img->getHeight(); + break; + + case 1: + imageSize.x = img->getWidth(); + imageSize.y = img->getHeight(); + width=imageSize.x/cols; + height=imageSize.y/rows; + frmPnt[0]=(currentFrame%cols)*width; + frmPnt[1]=(currentFrame/cols)*height; + break; + + case 2: + imageSize.x = img->getWidth(); + imageSize.y = img->getHeight(); + width=imageSize.x/cols; + height=imageSize.y/rows; + frmPnt[0]=(sequence[currentFrame]%cols)*width; + frmPnt[1]=(sequence[currentFrame]/cols)*height; + break; + } + + bool onScreen = true; + + if(a!=NULL) + { + //a->width = this->width; + //a->height = this->height; + + onScreen = a->isOnScreen(); + if(!relativeToScreen) + { + onScreen = true; + } + } + + x1=x1-(float)((width*scale)/2); + y1=y1-(float)((height*scale)/2); + + int drawX1,drawY1,drawX2,drawY2; + if(singleframe) + { + drawX1 = 0; + drawY1 = 0; + drawX2 = width; + drawY2 = height; + } + else + { + drawX1 = frmPnt[0]; + drawY1 = frmPnt[1]; + drawX2 = frmPnt[0]+width; + drawY2 = frmPnt[1]+height; + + } + + if(relativeToScreen && onScreen) + { + x1 -= View::x; + y1 -= View::y; + } + + if(a!=NULL) + { + if(!a->visible) + { + onScreen = false; + } + } + + if(onScreen) + { + if(isMirrored) + { + if(isMirroredVertical) + { + g.drawImage(img, (float)(x1+(width*scale)), (float)(y1+(height*scale)), (x1), (y1),drawX1,drawY1,drawX2,drawY2); + } + else + { + g.drawImage(img, (float)(x1+(width*scale)), (y1), (x1), (float)(y1+(height*scale)),drawX1,drawY1,drawX2,drawY2); + } + } + else + { + if(isMirroredVertical) + { + g.drawImage(img, (x1), (float)(y1+(height*scale)), (float)(x1+(width*scale)), (y1),drawX1,drawY1,drawX2,drawY2); + } + else + { + g.drawImage(img, (x1), (y1), (float)(x1+(width*scale)), (float)(y1+(height*scale)),drawX1,drawY1,drawX2,drawY2); + } + } + } + recentFrame = currentFrame; + + g.setRotation(0,0,0); + g.setAlpha(255); + g.setImageMask(Color::WHITE); + } + + void Animation::drawFrame(Actor*a,Graphics2D& g,int fNum, float x1, float y1, float x2, float y2) + { + double rotation; + unsigned char alpha = 255; + Color color; + + bool isMirrored = this->isMirrored; + bool isMirroredVertical = this->isMirroredVertical; + + if(a!=NULL) + { + rotation = degtorad(a->getRotation()); + alpha = (unsigned char)(255 - a->getAlpha()*255); + color = a->getColor(); + if(a->mirrored) + { + if(isMirrored) + { + isMirrored = false; + } + else + { + isMirrored = true; + } + } + if(a->mirroredVertical) + { + if(isMirroredVertical) + { + isMirroredVertical = false; + } + else + { + isMirroredVertical = true; + } + } + } + else + { + rotation = 0; + alpha = 255; + color = Color::WHITE; + } + + int frmPnt[2]; + BufferedImage*img; + if(rotation!=0 || alpha!=255) + { + g.setAlpha(alpha); + g.rotate((float)rotation,x1,y1); + } + g.setImageMask(color); + + int frameNum; + + switch(animType) + { + default: + frameNum = 0; + break; + + case 0: + frameNum = fNum; + break; + } + + img = AssetManager::getImage(names[frameNum]); + + currentFrame=fNum; + + bool singleframe = false; + + switch(animType) + { + case 0: + singleframe = true; + width = img->getWidth(); + height = img->getHeight(); + break; + + case 1: + imageSize.x=img->getWidth(); + imageSize.y=img->getHeight(); + width=imageSize.x/cols; + height=imageSize.y/rows; + frmPnt[0]=(currentFrame%cols)*width; + frmPnt[1]=(currentFrame/cols)*height; + break; + + case 2: + imageSize.x=img->getWidth(); + imageSize.y=img->getHeight(); + width=imageSize.x/cols; + height=imageSize.y/rows; + frmPnt[0]=(sequence[currentFrame]%cols)*width; + frmPnt[1]=(sequence[currentFrame]/cols)*height; + break; + } + + bool onScreen = true; + + if(a!=NULL) + { + //a->width = width; + //a->height = height; + + onScreen = a->isOnScreen(); + } + + int drawX1,drawY1,drawX2,drawY2; + if(singleframe) + { + drawX1 = 0; + drawY1 = 0; + drawX2 = width; + drawY2 = height; + } + else + { + drawX1 = frmPnt[0]; + drawY1 = frmPnt[1]; + drawX2 = frmPnt[0]+width; + drawY2 = frmPnt[1]+height; + + } + + if(onScreen) + { + x1 -= View::x; + y1 -= View::y; + } + + if(a!=NULL) + { + if(!a->visible) + { + onScreen = false; + } + } + + if(onScreen) + { + if(isMirrored) + { + if(isMirroredVertical) + { + g.drawImage(img ,(x2), (y2), (x1), (y1), drawX1,drawY1,drawX2,drawY2); + } + else + { + g.drawImage(img ,(x2), (y1), (x1), (y2), drawX1,drawY1,drawX2,drawY2); + } + } + else + { + if(isMirroredVertical) + { + g.drawImage(img, (x1), (y2), (x2), (y1), drawX1,drawY1,drawX2,drawY2); + } + else + { + g.drawImage(img, (x1), (y1), (x2), (y2), drawX1,drawY1,drawX2,drawY2); + } + } + } + recentFrame = currentFrame; + + g.setRotation(0,0,0); + g.setAlpha(255); + g.setImageMask(Color::WHITE); + } + + void Animation::nextFrame(Actor*a,Graphics2D& g, float x1, float y1, double scale, bool relativeToScreen) + { + if(direction == FORWARD) + { + if(currentFrame>=(frames-1)) + { + currentFrame=0; + if(a!=NULL) + { + if(a->eventEnabled(Actor::EVENT_ANIMATIONFINISH)) + { + a->onAnimationFinish(name); //is called when Animation has finished the last frame. defined in Actor + if(!this->name.equals(a->anim->name)) + { + a->Draw(g, Application::getGameTime()); + return; + } + } + } + } + else + { + currentFrame++; + } + } + else if(direction == BACKWARD) + { + if(currentFrame<=0) + { + currentFrame=(frames-1); + if(a!=NULL) + { + if(a->eventEnabled(Actor::EVENT_ANIMATIONFINISH)) + { + a->onAnimationFinish(name); //is called when Animation has finished the last frame. defined in Actor + if(!this->name.equals(a->anim->name)) + { + a->Draw(g, Application::getGameTime()); + return; + } + } + } + } + else + { + currentFrame--; + } + } + else if(direction == STOPPED) + { + currentFrame=currentFrame+0; + } + drawFrame(a,g,currentFrame,x1,y1,scale,relativeToScreen); + } + + void Animation::setCurrentFrame(int fNum) //sets the current frame of the Animation + { + if((fNum=0)) + { + currentFrame=fNum; + } + else + { + currentFrame=0; + } + } + + int Animation::getLastFrame() + { + return recentFrame; + } + + int Animation::getCurrentFrame() //returns the current frame of the Animation + { + return currentFrame; + } + + unsigned char Animation::getDirection() + { + return direction; + } + + ArrayList Animation::getAllFilenames() + { + if(animType == 0) + { + ArrayList files = ArrayList(); + for(int i=0; i files = ArrayList(); + files.add(names[0]); + return files; + } + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Animation.h b/SmashBros/GameEngine/Animation.h new file mode 100755 index 0000000..5db9863 --- /dev/null +++ b/SmashBros/GameEngine/Animation.h @@ -0,0 +1,89 @@ + +#include "forwards.h" +#include "GlobalDefs.h" +#include "String.h" +#include "ArrayList.h" +#include "Graphics2D.h" + +#pragma once + +namespace GameEngine +{ + const unsigned char NO_CHANGE = 0; + const unsigned char FORWARD = 1; + const unsigned char BACKWARD = 2; + const unsigned char STOPPED = 3; + + class Animation + { + friend class Actor; + private: + int frames; + ArrayList names; + + int currentFrame; + int recentFrame; + + bool isMirrored; + bool isMirroredVertical; + int rows; + int cols; + + int*sequence; + + Vector2i imageSize; + + int animType; + + int width; + int height; + + unsigned char direction; + public: + static const int TYPE_MULTIFILE = 0; + static const int TYPE_SINGLEFILE = 1; + static const int TYPE_SPECFRAME_SINGLEFILE = 2; + + int fps; + String name; + + Animation(const Animation& anim); + Animation(String n,int speed); + Animation(String n,int speed,String frame); + Animation(String n,int speed,int xFrames,int yFrames); + Animation(String n,int speed,int xFrames,int yFrames,ArrayList seq); + virtual ~Animation(); + + void mirror(bool toggle); + void mirrorVertical(bool toggle); + bool mirrored(); + bool mirroredVertical(); + + int getWidth(); + int getHeight(); + Vector2i getSize(); + + void addFrame(String fName); + + BufferedImage*getCurrentImage(); + int getCols(); + int getRows(); + int getType(); + + + void drawFrame(Actor*a,Graphics2D& g, float x1, float y1, double scale); + void drawFrame(Actor*a, Graphics2D& g, int fNum, float x1, float y1, double scale); + void drawFrame(Actor*a,Graphics2D& g,int fNum, float x1, float y1, double scale, bool relativeToScreen); + void drawFrame(Actor*a,Graphics2D& g,int fNum, float x1, float y1, float x2, float y2); + void nextFrame(Actor*a,Graphics2D& g, float x1, float y1, double scale, bool relativeToScreen=true); + + void setCurrentFrame(int fNum); + int getLastFrame(); + int getCurrentFrame(); + unsigned char getDirection(); + + ArrayList getAllFilenames(); + + Animation& operator=(const Animation& anim); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/AnimationManager.cpp b/SmashBros/GameEngine/AnimationManager.cpp new file mode 100755 index 0000000..c4f1b81 --- /dev/null +++ b/SmashBros/GameEngine/AnimationManager.cpp @@ -0,0 +1,82 @@ +#include "AnimationManager.h" +#include "Console.h" + +namespace GameEngine +{ + AnimationManager::AnimationManager() + { + animations = ArrayList(); + totalAnimations=0; + } + + AnimationManager::AnimationManager(const AnimationManager&animMgr) + { + totalAnimations = animMgr.totalAnimations; + animations = ArrayList(); + for(int i=0; i=0; i--) + { + Animation*cAnim = animations.get(i); + if(aName.equals(cAnim->name)) + { + animations.remove(i); + return true; + } + } + Console::WriteLine((String)"Error: animation " + aName + (String)" could not be removed"); + return false; + } + + Animation*AnimationManager::get(String aName) + { + for(int i=0; iname)) + { + return cAnim; + } + } + Console::WriteLine((String)"Error: animation " + aName + (String)" does not exist!"); + return NULL; + } + + AnimationManager&AnimationManager::operator=(const AnimationManager& animMgr) + { + for(int i=0; i animations; //stores animations. all animations are identified by their String name + int totalAnimations; + + public: + AnimationManager(); + AnimationManager(const AnimationManager& animMgr); + virtual ~AnimationManager(); + + void add(Animation*a); + bool remove(String aName); + Animation*get(String aName); + AnimationManager& operator=(const AnimationManager& animMgr); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Application.cpp b/SmashBros/GameEngine/Application.cpp new file mode 100755 index 0000000..6655eb9 --- /dev/null +++ b/SmashBros/GameEngine/Application.cpp @@ -0,0 +1,935 @@ + +#include "Application.h" +#include "AssetManager.h" +#include "Console.h" +#include "View.h" +#include +#include "SDL_image.h" +#include "SDL_ttf.h" +#include "SDL_mixer.h" +#include "Keys.h" +#include "Sound.h" +#include "Music.h" +#include "ObjCBridge.h" + +namespace GameEngine +{ + int ApplicationEventHandler(void*userdata, SDL_Event*event) + { + switch(event->type) + { + case SDL_APP_WILLENTERBACKGROUND: + { + if(Application::appEventListener != NULL) + { + Application::appEventListener->onAppWillEnterBackground(); + } + } + break; + + case SDL_APP_DIDENTERBACKGROUND: + { + if(Application::appEventListener != NULL) + { + Application::appEventListener->onAppDidEnterBackground(); + } + Application::minimizing = true; + } + break; + + case SDL_APP_WILLENTERFOREGROUND: + { + if(Application::appEventListener != NULL) + { + Application::appEventListener->onAppWillEnterForeground(); + } + } + break; + + case SDL_APP_DIDENTERFOREGROUND: + { + if(Application::appEventListener != NULL) + { + Application::appEventListener->onAppDidEnterForeground(); + } + Application::minimizing = false; + Application::readyToMinimize = false; + } + break; + + case SDL_APP_TERMINATING: + { + if(Application::appEventListener != NULL) + { + Application::appEventListener->onAppTerminating(); + } + } + break; + + case SDL_APP_LOWMEMORY: + { + if(Application::appEventListener != NULL) + { + Application::appEventListener->onLowMemory(); + } + } + break; + } + + return 1; + } + + SDL_Window*Application::window = NULL; + SDL_Renderer*Application::renderer = NULL; + Application*Application::game = NULL; + ApplicationEventListener*Application::appEventListener = NULL; + LoadThread*Application::loadThread = NULL; + bool Application::loaded = false; + bool Application::exiting = false; + long Application::worldTime = 0; + long Application::frame = 0; + int Application::upf = 1; + int Application::sleepTime = 33; + bool Application::paused = false; + bool Application::closing = false; + Graphics2D*Application::graphics = NULL; + long Application::realFPS = 0; + bool Application::showfps = false; + long Application::lastFrame = 0; + long Application::firstFrame = 0; + long Application::lastFrameTime = 0; + bool Application::gameRunning = false; + bool Application::borderless = false; + bool Application::scalescreen = false; + unsigned char Application::orientation = Application::ORIENTATION_LANDSCAPE; + bool Application::updating = false; + + bool Application::bgVisible = false; + String Application::bgName = ""; + bool Application::showLoad = false; + float Application::loadbarDim[4]; + Color Application::loadbarColor = Color::BLACK; + BufferedImage*Application::loadImage = NULL; + float Application::loadTotal = 1; + float Application::loadCurrent = 0; + + Color Application::bgColor = Color::WHITE; + + int Application::lastKey = -1; + int Application::currentLastKey = -1; + ArrayList Application::touchPoints = ArrayList(); + ArrayList Application::currentTouchPoints = ArrayList(); + ArrayList Application::prevTouchPoints = ArrayList(); + bool Application::KeyState[526]; + bool Application::currentKeyState[526]; + bool Application::prevKeyState[526]; + + bool Application::minimizing = false; + bool Application::readyToMinimize = false; + + Application::Application() {} + Application::~Application() {} + + void Application::Initialize() {} + void Application::LoadContent() {} + void Application::UnloadContent() {} + void Application::Update(long gameTime) {} + void Application::Draw(Graphics2D&g, long gameTime) {} + + void Application::onSuspend() {} + void Application::onResume() {} + + bool Application::Run(unsigned char orient, bool statusbar) + { + if(!gameRunning) + { + gameRunning = true; + + srand((unsigned)time(NULL)); + + if(!SDL_WasInit(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER)) + { + if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER | SDL_INIT_JOYSTICK | SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER) < 0) + //if(SDL_Init(SDL_INIT_EVERYTHING) < 0) + { + Console::WriteLine("failed to initialize SDL"); + gameRunning = false; + return false; + } + } + + if(!TTF_WasInit()) + { + if(TTF_Init() < 0) + { + Console::WriteLine("failed to initalize SDL_ttf library"); + gameRunning = false; + return false; + } + } + + { + int flags = MIX_INIT_FLAC | MIX_INIT_MP3 | MIX_INIT_MOD | MIX_INIT_OGG; + int initted = Mix_Init(flags); + if(initted&flags != 0) + { + Console::WriteLine("failed to initalize SDL_mixer library"); + gameRunning = false; + return false; + } + } + + if(Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 4096)<0) + { + Console::WriteLine("failed to open SDL_mixer Audio"); + } + + Sound::init(); + Music::init(); + + GameEngine_init(); + + { + SDL_Rect displayRect; + + SDL_GetDisplayBounds(0, &displayRect); + + unsigned int bigger; + unsigned int smaller; + + if(displayRect.w > displayRect.h) + { + bigger = displayRect.w; + smaller = displayRect.h; + } + else + { + bigger = displayRect.h; + smaller = displayRect.w; + } + + if(orient == ORIENTATION_PORTRAIT) + { + View::windowWidth = smaller; + View::windowHeight = bigger; + View::scaleWidth = smaller; + View::scaleHeight = bigger; + } + else if(orient == ORIENTATION_LANDSCAPE) + { + View::windowWidth = bigger; + View::windowHeight = smaller; + View::scaleWidth = bigger; + View::scaleHeight = smaller; + } + + orientation = orient; + if(statusbar) + { + borderless = false; + } + else + { + borderless = true; + } + } + + if(borderless) + { + window = SDL_CreateWindow(NULL, 0, 0, View::windowWidth, View::windowHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_SHOWN); + } + else + { + window = SDL_CreateWindow(NULL, 0, 0, View::windowWidth, View::windowHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN); + } + + if(window == NULL) + { + Console::WriteLine("failed to create SDL_Window"); + gameRunning = false; + return false; + } + + renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + + if(renderer == NULL) + { + Console::WriteLine("failed to create SDL_Renderer from SDL_Window"); + gameRunning = false; + return false; + } + + if(orientation == ORIENTATION_PORTRAIT) + { + SDL_SetHintWithPriority("SDL_HINT_ORIENTATIONS", "Portrait PortraitUpsideDown", SDL_HINT_OVERRIDE); + } + else if(orientation == ORIENTATION_LANDSCAPE) + { + SDL_SetHintWithPriority("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight", SDL_HINT_OVERRIDE); + } + + SDL_SetEventFilter(ApplicationEventHandler, this); + + game = this; + + this->Initialize(); + + graphics = new Graphics2D(); + graphics->renderer = renderer; + + lastFrameTime = getUptimeMillis(); + + while(gameRunning && !closing) + { + lastFrame = getUptimeMillis(); + int timeDif = lastFrame-firstFrame; + if(timeDif==0) + { + realFPS = 0; + } + else + { + realFPS = (1000/timeDif); + } + firstFrame = getUptimeMillis(); + + if(loaded) + { + long startTime = getUptimeMillis(); + updateEvents(); + if(!closing) + { + updateKeys(currentKeyState, KeyState); + updateTouchPoints(currentTouchPoints, touchPoints); + currentLastKey = lastKey; + lastKey = -1; + + if(!paused) + { + if(upf>1) + { + for(int i=0; iUpdate(worldTime); + if(paused) + { + i = upf; + } + } + } + else + { + this->Update(worldTime); + } + } + + SDL_SetRenderDrawColor(renderer, bgColor.r, bgColor.g, bgColor.b, bgColor.a); + SDL_RenderClear(renderer); + SDL_SetRenderDrawColor(renderer, 0,0,0,255); + + graphics->reset(); + graphics->updateStringCache(); + View::Update(*graphics); + if(bgVisible) + { + BufferedImage*img = AssetManager::getImage(bgName); + graphics->drawImage(img,0,0,(float)View::ScaleWidth(),(float)View::ScaleHeight(),0,0,img->getWidth(),img->getHeight()); + } + this->Draw(*graphics,worldTime); + if(!paused) + { + updateKeys(prevKeyState,currentKeyState); + updateTouchPoints(prevTouchPoints, currentTouchPoints); + } + View::Draw(*graphics); + SDL_RenderPresent(renderer); + + long currentFrameTime = getUptimeMillis(); + if(!paused) + { + frame++; + //worldTime+=sleepTime; + worldTime += (currentFrameTime - lastFrameTime); + } + lastFrameTime = currentFrameTime; + + long endTime = getUptimeMillis(); + long newSleepTime = sleepTime - (endTime - startTime); + + //Console::WriteLine(endTime-startTime); + + if(newSleepTime>0) + { + bool firstSleep = true; + do + { + if(!firstSleep) + { + updateEvents(); + lastFrameTime = getUptimeMillis(); + } + firstSleep = false; + readyToMinimize = true; + SDL_Delay(newSleepTime); + } + while(minimizing); + readyToMinimize = false; + } + else + { + SDL_Delay(1); + } + } + } + else + { + updateEvents(); + View::Update(*graphics); + /*if(loadThread==NULL) + { + loadThread = new LoadThread(this); + loadThread->start(); + }*/ + + if(showLoad) + { + SDL_SetRenderDrawColor(renderer, 0,0,0,255); + SDL_RenderClear(renderer); + graphics->drawImage(loadImage,0,0,(float)View::ScaleWidth(),(float)View::ScaleHeight(),0,0,loadImage->getWidth(),loadImage->getHeight()); + graphics->setColor(loadbarColor); + graphics->fillRect(loadbarDim[0], loadbarDim[1], (float)((float)(loadCurrent/loadTotal)*loadbarDim[2]), loadbarDim[3]); + SDL_RenderPresent(renderer); + } + else + { + SDL_SetRenderDrawColor(renderer, bgColor.r,bgColor.g,bgColor.b,bgColor.a); + SDL_RenderClear(renderer); + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderPresent(renderer); + } + + /*if(!loadThread->isAlive()) + { + loaded = true; + delete loadThread; + loadThread = NULL; + }*/ + LoadContent(); + loaded = true; + lastFrameTime = getUptimeMillis(); + } + + if(exiting) + { + UnloadContent(); + closing = true; + } + } + + delete graphics; + if(renderer!=NULL) + { + SDL_DestroyRenderer(renderer); + renderer = NULL; + } + if(window!=NULL) + { + SDL_DestroyWindow(window); + window = NULL; + } + + gameRunning = false; + + SDL_Quit(); + + return true; + } + return false; + } + + void Application::updateEvents() + { + SDL_Event event; + while(SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_QUIT: + this->UnloadContent(); + graphics->renderer = NULL; + SDL_DestroyRenderer(renderer); + renderer = NULL; + SDL_DestroyWindow(window); + window = NULL; + closing = true; + break; + + case SDL_APP_WILLENTERBACKGROUND: + Mix_PauseMusic(); + break; + + case SDL_APP_DIDENTERFOREGROUND: + Mix_ResumeMusic(); + break; + + case SDL_KEYDOWN: + keyPressed(Keys::SDLK_to_KeyCode(event.key.keysym.sym)); + break; + + case SDL_KEYUP: + keyReleased(Keys::SDLK_to_KeyCode(event.key.keysym.sym)); + break; + + case SDL_FINGERDOWN: + addTouchPoint(event.tfinger.fingerId, (event.tfinger.x*View::windowWidth), (event.tfinger.y*View::windowHeight)); + break; + + case SDL_FINGERMOTION: + updateTouchPoint(event.tfinger.fingerId, (event.tfinger.x*View::windowWidth), (event.tfinger.y*View::windowHeight)); + break; + + case SDL_FINGERUP: + removeTouchPoint(event.tfinger.fingerId, (event.tfinger.x*View::windowWidth), (event.tfinger.y*View::windowHeight)); + break; + } + } + SDL_JoystickUpdate(); + } + + void Application::Exit() + { + exiting = true; + } + + void Application::showMessage(const String&message) + { + //SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "", message, window); + SDL_ShowSimpleMessageBoxFixed("", message); + } + + void Application::showMessage(const String&title, const String&message) + { + //SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, title, message, window); + SDL_ShowSimpleMessageBoxFixed("", message); + } + + int Application::showMessage(const String&title, const String&message, const ArrayList&options) + { + /*SDL_MessageBoxButtonData*buttons = new SDL_MessageBoxButtonData[options.size()]; + for(int i=0; ix/View::multScale) - View::letterBoxW*(1/View::multScale)); + } + else + { + return point->x; + } + } + + int Application::PrevTouchX(long touchID) + { + TouchPoint*point = getPrevTouchPoint(touchID); + if(point==NULL) + { + return 0; + } + else if(scalescreen) + { + return (int)((point->x/View::multScale) - View::letterBoxW*(1/View::multScale)); + } + else + { + return point->x; + } + } + + int Application::TouchY(long touchID) + { + TouchPoint*point = getTouchPoint(touchID); + if(point==NULL) + { + return 0; + } + else if(scalescreen) + { + return (int)((point->y/View::multScale) - View::letterBoxH*(1/View::multScale)); + } + else + { + return point->y; + } + } + + int Application::PrevTouchY(long touchID) + { + TouchPoint*point = getPrevTouchPoint(touchID); + if(point==NULL) + { + return 0; + } + else if(scalescreen) + { + return (int)((point->y/View::multScale) - View::letterBoxH*(1/View::multScale)); + } + else + { + return point->y; + } + } + + bool Application::checkTouchActive(long touchID) + { + for(int i=0; i Application::getTouchPoints() + { + if(scalescreen) + { + ArrayList points; + + for(int i=0; i Application::getPrevTouchPoints() + { + if(scalescreen) + { + ArrayList points; + + for(int i=0; iID == ID) + { + return point; + } + } + return NULL; + } + + TouchPoint*Application::getPrevTouchPoint(long ID) + { + for(int i=0; iID == ID) + { + return point; + } + } + return NULL; + } + + void Application::updateKeys(bool*keys1, bool*keys2) + { + for(int i=0; i&points1, ArrayList&points2) + { + points1.clear(); + for(int i=0; i=1) + { + upf = total; + } + } + + long Application::getFrame() + { + return frame; + } + + SDL_Window*Application::getWindow() + { + return window; + } + + void Application::setFPS(int fps) + { + sleepTime = 1000/fps; + } + + void Application::showRealFPS(bool toggle) + { + showfps = toggle; + } + + bool Application::colcompare(Color c1, Color c2) + { + if(c1.r==c2.r && c1.g==c2.g && c1.b==c2.b && c1.a==c1.a) + { + return true; + } + return false; + } + + long Application::getGameTime() + { + return worldTime; + } + + long Application::getSystemTime() + { + return getUptimeMillis(); + } + + void Application::setGameTime(long time) + { + worldTime = time; + } + + void Application::Suspend() + { + paused = true; + game->onSuspend(); + } + + void Application::Resume() + { + paused = false; + game->onResume(); + } + + bool Application::Suspended() + { + return paused; + } + + void Application::scaleToWindow(bool toggle) + { + scalescreen=toggle; + View::scaleWidth = View::windowWidth; + View::scaleHeight = View::windowHeight; + } + + void Application::scaleToWindow(bool toggle, int width, int height) + { + scalescreen=toggle; + View::scaleWidth = width; + View::scaleHeight = height; + } + + void Application::setLoadScreen(const String&imgName) + { + bool success = AssetManager::loadImage(imgName); + if(success) + { + showLoad = true; + loadImage = AssetManager::getImage(imgName); + } + } + + void Application::setLoadBar(float x1,float y1, float w1, float h1, Color color) + { + loadbarDim[0]=x1; + loadbarDim[1]=y1; + loadbarDim[2]=w1; + loadbarDim[3]=h1; + loadbarColor = color; + } + + void Application::setLoadTotal(float total) + { + loadTotal = total; + } + + void Application::incrementLoad(float incr) + { + game->updateEvents(); + loadCurrent+=incr; + //graphics->reset(); + /*window->clear(); + if(showLoad) + { + BufferedImage*img = AssetManager::getImage(loadScreen); + graphics->drawImage(img,0,0,(float)View::ScaleWidth(),(float)View::ScaleHeight(),0,0,img->getWidth(),img->getHeight()); + }*/ + graphics->setColor(loadbarColor); + graphics->fillRect(loadbarDim[0], loadbarDim[1], (float)((float)(loadCurrent/loadTotal)*loadbarDim[2]), loadbarDim[3]); + SDL_RenderPresent(renderer); + } + + void Application::showBackground(bool toggle) + { + bgVisible = toggle; + } + + void Application::setBackgroundImage(const String&imgName) + { + bool success=AssetManager::loadImage(imgName); + if(success) + { + bgName=imgName; + bgVisible = true; + } + } + + void Application::setBackgroundColor(Color color) + { + bgColor = color; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Application.h b/SmashBros/GameEngine/Application.h new file mode 100755 index 0000000..01c4724 --- /dev/null +++ b/SmashBros/GameEngine/Application.h @@ -0,0 +1,159 @@ + +#include "forwards.h" +#include "SDL.h" +#include "Graphics2D.h" +#include "ArrayList.h" +#include "String.h" +#include "ApplicationEventListener.h" +#include "TouchPoint.h" +#include "BatchLoader.h" + +#pragma once + +namespace GameEngine +{ + class Application + { + private: + friend class View; + friend class BufferedImage; + friend int ApplicationEventHandler(void*,SDL_Event*); + friend void private_updateAppEvents(void); + + static SDL_Window*window; + static SDL_Renderer*renderer; + static Application*game; + static Graphics2D*graphics; + static ApplicationEventListener*appEventListener; + static LoadThread*loadThread; + + static int upf; + static bool loaded; + static bool exiting; + static long worldTime; + static long frame; + static int sleepTime; + static bool paused; + static bool gameRunning; + static bool closing; + static bool borderless; + static bool scalescreen; + static unsigned char orientation; + static bool updating; + + static bool bgVisible; + static String bgName; + static bool showLoad; + static float loadbarDim[4]; + static Color loadbarColor; + static BufferedImage*loadImage; + static float loadTotal; + static float loadCurrent; + + static long realFPS; + static bool showfps; + + static long lastFrame; + static long firstFrame; + static long lastFrameTime; + + static Color bgColor; + + static const int totalKeys = 526; + static bool currentKeyState[526]; + static bool KeyState[526]; + static bool prevKeyState[526]; + static int currentLastKey; + static int lastKey; + static ArrayList currentTouchPoints; + static ArrayList touchPoints; + static ArrayList prevTouchPoints; + + static bool minimizing; + static bool readyToMinimize; + + void updateEvents(); + + static bool colcompare(Color c1, Color c2); + + static void keyPressed(int keycode); + static void keyReleased(int keycode); + static void mousePressed(int eventcode); + static void mouseReleased(int eventcode); + static void addTouchPoint(long ID, float x, float y); + static void updateTouchPoint(long ID, float x, float y); + static void removeTouchPoint(long ID, float x, float y); + static TouchPoint*getTouchPoint(long ID); + static TouchPoint*getPrevTouchPoint(long ID); + + static void updateKeys(bool*keys1, bool*keys2); + static void updateTouchPoints(ArrayList&points1, ArrayList&points2); + + public: + static const unsigned char ORIENTATION_PORTRAIT = 0; + static const unsigned char ORIENTATION_LANDSCAPE = 1; + + Application(); + virtual ~Application(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void onSuspend(); + virtual void onResume(); + + bool Run(unsigned char orient = ORIENTATION_PORTRAIT, bool statusbar = true); + + static void Exit(); + + static void showMessage(const String&message); + static void showMessage(const String&title, const String&message); + static int showMessage(const String&title, const String&message, const ArrayList&options); + + static int GetLastKey(); + static bool KeyPressed(int key); + static bool PrevKeyPressed(int key); + + static int TouchX(long touchID); + static int PrevTouchX(long touchID); + static int TouchY(long touchID); + static int PrevTouchY(long touchID); + static bool checkTouchActive(long touchID); + static bool checkPrevTouchActive(long touchID); + static ArrayList getTouchPoints(); + static ArrayList getPrevTouchPoints(); + + static void setUpdatesPerFrame(int total); + static long getFrame(); + static SDL_Window*getWindow(); + + static void setFPS(int fps); + static void showRealFPS(bool toggle); + + static long getGameTime(); + static long getSystemTime(); + static void setGameTime(long time); + + static void Suspend(); + static void Resume(); + + static bool Suspended(); + + static void scaleToWindow(bool toggle); + static void scaleToWindow(bool toggle, int width, int height); + + static void setLoadScreen(const String&imgName); + static void setLoadBar(float x1,float y1, float w1, float h1, Color color); + static void setLoadTotal(float total); + static void incrementLoad(float incr); + + static void showBackground(bool toggle); + static void setBackgroundImage(const String&imgName); + static void setBackgroundColor(Color color); + + static void setFullScreen(bool toggle); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/ApplicationEventListener.cpp b/SmashBros/GameEngine/ApplicationEventListener.cpp new file mode 100644 index 0000000..f72b17a --- /dev/null +++ b/SmashBros/GameEngine/ApplicationEventListener.cpp @@ -0,0 +1,35 @@ + +#include "ApplicationEventListener.h" + +namespace GameEngine +{ + void ApplicationEventListener::onAppWillEnterBackground() + { + // + } + + void ApplicationEventListener::onAppDidEnterBackground() + { + // + } + + void ApplicationEventListener::onAppWillEnterForeground() + { + // + } + + void ApplicationEventListener::onAppDidEnterForeground() + { + // + } + + void ApplicationEventListener::onAppTerminating() + { + // + } + + void ApplicationEventListener::onLowMemory() + { + // + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/ApplicationEventListener.h b/SmashBros/GameEngine/ApplicationEventListener.h new file mode 100644 index 0000000..c2604c2 --- /dev/null +++ b/SmashBros/GameEngine/ApplicationEventListener.h @@ -0,0 +1,16 @@ + +#pragma once + +namespace GameEngine +{ + class ApplicationEventListener + { + public: + virtual void onAppWillEnterBackground(); + virtual void onAppDidEnterBackground(); + virtual void onAppWillEnterForeground(); + virtual void onAppDidEnterForeground(); + virtual void onAppTerminating(); + virtual void onLowMemory(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/ArrayList.h b/SmashBros/GameEngine/ArrayList.h new file mode 100644 index 0000000..8d5ac2c --- /dev/null +++ b/SmashBros/GameEngine/ArrayList.h @@ -0,0 +1,138 @@ + +#include + +#pragma once + +namespace GameEngine +{ + template + class ArrayList + { + private: + std::vector objects; + int total; + + public: + ArrayList() + { + total = 0; + } + + ArrayList(const ArrayList& arr) + { + total = arr.total; + objects.resize(total); + for(int i=0; i=0) + { + total++; + objects.resize(total); + for(int i=(total-1); i>index; i--) + { + objects[i] = objects[i-1]; + } + objects[index] = obj; + } + } + + void remove(int index) + { + if(total==1 && index==0) + { + objects.resize(0); + total = 0; + } + else if(index=0) + { + for(int i=(index+1); i& arr) + { + total = arr.total; + objects.resize(total); + for(int i=0; i AssetManager::Images = ArrayList(); + ArrayList AssetManager::ImageNames = ArrayList(); + + ArrayList AssetManager::Fonts = ArrayList(); + ArrayList AssetManager::FontNames = ArrayList(); + + bool AssetManager::loadImage(const String&imgName) + { + if(!alreadyStoredImage(imgName)) + { + Console::WriteLine((String)"Loading image " + imgName); + BufferedImage*img = new BufferedImage(); + bool success = img->loadFromFile(imgName); + if(success) + { + Images.add(img); + ImageNames.add(imgName); + return true; + } + Console::WriteLine((String)"Error loading image " + imgName); + delete img; + return false; + } + return true; + } + + BufferedImage* AssetManager::getImage(const String&imgName) + { + int total = ImageNames.size(); + for(int i=0; igetTTF()!=NULL) + { + Fonts.add(font); + FontNames.add(fontName); + return true; + } + Console::WriteLine((String)"Error loading font " + fontName); + delete font; + return false; + } + return true; + } + + Font*AssetManager::getFont(const String&fontName) + { + int total = FontNames.size(); + for(int i=0; isetStyle(style); + font->setSize(size); + return font; + } + } + Console::WriteLine((String)"Error: font " + fontName + (String)" does not exist!"); + return NULL; + } + + void AssetManager::unloadFont(const String&fontName) + { + int total = FontNames.size(); + for(int i=0; i Images; + static ArrayList ImageNames; + + static ArrayList Fonts; + static ArrayList FontNames; + + static bool alreadyStoredImage(const String&imgName); + static bool alreadyStoredFont(const String&fontName); + public: + static bool loadImage(const String&imgName); + static BufferedImage* getImage(const String&imgName); + static void unloadImage(const String&imgName); + + static bool loadFont(const String&fontName, int style = Font::PLAIN, unsigned int size = 1); + static Font* getFont(const String&fontName); + static Font* getFont(const String&fontName, int style, unsigned int size); + static void unloadFont(const String&fontName); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/BatchLoader.cpp b/SmashBros/GameEngine/BatchLoader.cpp new file mode 100644 index 0000000..4cb0331 --- /dev/null +++ b/SmashBros/GameEngine/BatchLoader.cpp @@ -0,0 +1,56 @@ + +#include "BatchLoader.h" +#include "Application.h" +#include "AssetManager.h" + +namespace GameEngine +{ + ArrayList BatchLoader::Images = ArrayList(); + ArrayList BatchLoader::Fonts = ArrayList(); + + int BatchLoader::totalAmount = 0; + + void BatchLoader::addImage(String n) + { + Images.add(n); + totalAmount++; + } + + void BatchLoader::addFont(String n) + { + Fonts.add(n); + totalAmount++; + } + + void BatchLoader::loadAll() + { + Application::setLoadTotal((float)totalAmount); + for(int i=0; iapp = app; + } + + LoadThread::~LoadThread() + { + app = NULL; + } + + void LoadThread::run() + { + app->LoadContent(); + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/BatchLoader.h b/SmashBros/GameEngine/BatchLoader.h new file mode 100644 index 0000000..5adf132 --- /dev/null +++ b/SmashBros/GameEngine/BatchLoader.h @@ -0,0 +1,38 @@ + +#include "String.h" +#include "ArrayList.h" +#include "Thread.h" +#include "forwards.h" + +#pragma once + +namespace GameEngine +{ + class BatchLoader + { + private: + static ArrayList Images; + static ArrayList Fonts; + + static int totalAmount; + + public: + static void addImage(String n); + + static void addFont(String n); + + static void loadAll(); + }; + + class LoadThread : public Thread + { + private: + Application*app; + + public: + LoadThread(Application*app); + ~LoadThread(); + + virtual void run(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Bitset.cpp b/SmashBros/GameEngine/Bitset.cpp new file mode 100644 index 0000000..9e84cd3 --- /dev/null +++ b/SmashBros/GameEngine/Bitset.cpp @@ -0,0 +1,60 @@ + +#include "Bitset.h" + +namespace GameEngine +{ + Bitset::Bitset() + { + byte = 0; + } + + Bitset::Bitset(Byte byte) + { + this->byte = byte; + } + + Bitset::Bitset(char bits[8]) + { + byte = 0; + for(int i=0; i<8; i++) + { + if(bits[i]=='1') + { + set(i, true); + } + } + } + + Bitset::~Bitset() + { + // + } + + bool Bitset::get(unsigned int index) + { + return ((byte & (1 << index))!=0); + } + + void Bitset::set(unsigned int index, bool toggle) + { + if(toggle) + { + byte |= (1 << index); + } + else + { + byte &= ~(1 << index); + } + } + + Byte& Bitset::getByte() + { + return byte; + } + + Bitset& Bitset::operator=(const Bitset&bitset) + { + byte = bitset.byte; + return *this; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Bitset.h b/SmashBros/GameEngine/Bitset.h new file mode 100644 index 0000000..0c2f823 --- /dev/null +++ b/SmashBros/GameEngine/Bitset.h @@ -0,0 +1,34 @@ + +#pragma once + +namespace GameEngine +{ + typedef unsigned char Byte; + class Bitset + { + private: + Byte byte; + + public: + static const Byte BITMASK_ONE = 1; + static const Byte BITMASK_TWO = 2; + static const Byte BITMASK_THREE = 4; + static const Byte BITMASK_FOUR = 8; + static const Byte BITMASK_FIVE = 16; + static const Byte BITMASK_SIX = 32; + static const Byte BITMASK_SEVEN = 64; + static const Byte BITMASK_EIGHT = 128; + + Bitset(); + Bitset(Byte byte); + Bitset(char bits[8]); + ~Bitset(); + + bool get(unsigned int index); + void set(unsigned int index, bool toggle); + + Byte&getByte(); + + Bitset& operator=(const Bitset&bitset); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/BufferedImage.cpp b/SmashBros/GameEngine/BufferedImage.cpp new file mode 100755 index 0000000..0537d93 --- /dev/null +++ b/SmashBros/GameEngine/BufferedImage.cpp @@ -0,0 +1,142 @@ + +#include "BufferedImage.h" +#include "Image.h" +#include "Console.h" +#include "SDL_image.h" +#include "Application.h" + +namespace GameEngine +{ + BufferedImage::BufferedImage() + { + texture = NULL; + width = 0; + height = 0; + } + + BufferedImage::BufferedImage(const Image&img) + { + texture = SDL_CreateTexture(Application::renderer, SDL_PIXELFORMAT_BGRA8888, SDL_TEXTUREACCESS_STREAMING, (int)img.getWidth(), (int)img.getHeight()); + int pitch; + + unsigned int total = img.width*img.height; + + pixels.resize(total); + + void*pixsVoid = NULL; + if(SDL_LockTexture(texture, NULL, &pixsVoid, &pitch)<0) + { + Console::WriteLine(SDL_GetError()); + } + ValueRGBA*pixs = (ValueRGBA*)pixsVoid; + for(unsigned int i=0; i0) + { + pixels[i] = true; + } + else + { + pixels[i] = false; + } + pixs[i] = px; + } + + SDL_UnlockTexture(texture); + + width = img.width; + height = img.height; + } + + BufferedImage::~BufferedImage() + { + pixels.resize(0); + if(texture!=NULL) + { + SDL_DestroyTexture(texture); + } + width = 0; + height = 0; + } + + bool BufferedImage::loadFromFile(const String&fileName) + { + if(texture!=NULL) + { + SDL_DestroyTexture(texture); + texture = NULL; + width = 0; + height = 0; + } + SDL_Surface*img = IMG_Load(fileName); + if(img!=NULL) + { + texture = SDL_CreateTextureFromSurface(Application::renderer, img); + if(texture == NULL) + { + Console::WriteLine((String)"Error BufferedImage::loadFromFile(String) " + IMG_GetError()); + SDL_FreeSurface(img); + return false; + } + width = img->w; + height = img->h; + unsigned int total = width*height; + int bpp = img->format->BytesPerPixel; + if(bpp==4) + { + ValueRGBA*pixs = (ValueRGBA*)img->pixels; + pixels.resize(total); + for(unsigned int i=0; i + +#pragma once + +namespace GameEngine +{ + typedef struct + { + unsigned char r,g,b,a; + } ValueRGBA; + + class BufferedImage + { + private: + SDL_Texture*texture; + std::vector pixels; + unsigned int width,height; + BufferedImage(const SDL_Texture*texture); + + public: + BufferedImage(); + BufferedImage(const Image&img); + virtual ~BufferedImage(); + + bool loadFromFile(const String&fileName); + + unsigned int getWidth() const; + unsigned int getHeight() const; + + bool pixelAtPoint(unsigned int index) const; + bool pixelAtPoint(unsigned int x,unsigned int y) const; + + SDL_Texture*getTexture(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/CPPBridge.cpp b/SmashBros/GameEngine/CPPBridge.cpp new file mode 100644 index 0000000..bbf7bc9 --- /dev/null +++ b/SmashBros/GameEngine/CPPBridge.cpp @@ -0,0 +1,21 @@ + +#include "CPPBridge.h" +#include "Application.h" + +namespace GameEngine +{ + void private_updateAppEvents(void) + { + GameEngine::Application::game->updateEvents(); + } +} + +void updateAppEvents(void) +{ + GameEngine::private_updateAppEvents(); +} + +void showMessage(const char*title, const char*message) +{ + GameEngine::Application::showMessage(title,message); +} \ No newline at end of file diff --git a/SmashBros/GameEngine/CPPBridge.h b/SmashBros/GameEngine/CPPBridge.h new file mode 100644 index 0000000..8805ce6 --- /dev/null +++ b/SmashBros/GameEngine/CPPBridge.h @@ -0,0 +1,5 @@ + +#pragma once + +extern void updateAppEvents(void); +extern void showMessage(const char*title, const char*message); \ No newline at end of file diff --git a/SmashBros/GameEngine/Color.cpp b/SmashBros/GameEngine/Color.cpp new file mode 100644 index 0000000..6aea70c --- /dev/null +++ b/SmashBros/GameEngine/Color.cpp @@ -0,0 +1,172 @@ + +#include "Color.h" + +namespace GameEngine +{ + const Color Color::BLACK = Color(0,0,0); + const Color Color::BLUE = Color(0,0,255); + const Color Color::CYAN = Color(0,255,255); + const Color Color::DARKGRAY = Color(64,64,64); + const Color Color::GRAY = Color(128,128,128); + const Color Color::GREEN = Color(0,255,0); + const Color Color::LIGHTGRAY = Color(192,192,192); + const Color Color::MAGENTA = Color(255,0,255); + const Color Color::ORANGE = Color(255,200,0); + const Color Color::PINK = Color(255,175,175); + const Color Color::RED = Color(255,0,0); + const Color Color::WHITE = Color(255,255,255); + const Color Color::YELLOW = Color(255,255,0); + const Color Color::TRANSPARENT = Color(0,0,0,0); + + Color::Color() + { + r = 255; + g = 255; + b = 255; + a = 255; + } + + Color::Color(unsigned char R, unsigned char G, unsigned char B, unsigned char A) + { + r = R; + g = G; + b = B; + a = A; + } + + Color::Color(int rgb, bool alpha) + { + unsigned char*rgbArray = (unsigned char*)(&rgb); + r = rgbArray[0]; + g = rgbArray[1]; + b = rgbArray[2]; + if(alpha) + { + a = rgbArray[3]; + } + } + + Color::Color(const Color&color) + { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + } + + Color::Color(const SDL_Color&color) + { + r = color.r; + g = color.g; + b = color.b; + a = 255; + } + + Color::Color(const ValueRGBA&color) + { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + } + + Color::~Color() + { + // + } + + Color&Color::operator=(const Color&color) + { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + return *this; + } + + Color&Color::operator=(const SDL_Color&color) + { + r = color.r; + g = color.g; + b = color.b; + a = 255; + return *this; + } + + Color&Color::operator=(const ValueRGBA&color) + { + r = color.r; + g = color.g; + b = color.b; + a = color.a; + return *this; + } + + bool Color::operator==(const Color&color) const + { + return equals(color); + } + + bool Color::operator==(const SDL_Color&color) const + { + return equals(color); + } + + bool Color::operator==(const ValueRGBA&color) const + { + return equals(color); + } + + Color::operator ValueRGBA() const + { + ValueRGBA color = {r,g,b,a}; + return color; + } + + Color::operator SDL_Color() const + { + SDL_Color color; + color.r = r; + color.g = g; + color.b = b; + return color; + } + + int Color::getRGBA() + { + int rgba = 0; + unsigned char*arr = (unsigned char*)(&rgba); + arr[0] = r; + arr[1] = g; + arr[2] = b; + arr[3] = a; + return rgba; + } + + bool Color::equals(const Color&color) const + { + if(r==color.r && g==color.g && b==color.b && a==color.a) + { + return true; + } + return false; + } + + bool Color::equals(const SDL_Color&color) const + { + if(r==color.r && g==color.g && b==color.b && a==255) + { + return true; + } + return false; + } + + bool Color::equals(const ValueRGBA&color) const + { + if(r==color.r && g==color.g && b==color.b && a==color.a) + { + return true; + } + return false; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Color.h b/SmashBros/GameEngine/Color.h new file mode 100644 index 0000000..4e5a948 --- /dev/null +++ b/SmashBros/GameEngine/Color.h @@ -0,0 +1,53 @@ + +#include "forwards.h" +#include "BufferedImage.h" +#include "SDL_pixels.h" + +#pragma once + +namespace GameEngine +{ + class Color + { + public: + static const Color BLACK; + static const Color BLUE; + static const Color CYAN; + static const Color DARKGRAY; + static const Color GRAY; + static const Color GREEN; + static const Color LIGHTGRAY; + static const Color MAGENTA; + static const Color ORANGE; + static const Color PINK; + static const Color RED; + static const Color WHITE; + static const Color YELLOW; + static const Color TRANSPARENT; + + unsigned char r,g,b,a; + + Color(); + Color(const Color&color); + Color(const ValueRGBA&color); + Color(const SDL_Color&color); + Color(int rgb, bool alpha = false); + Color(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255); + ~Color(); + + Color&operator=(const ValueRGBA&color); + Color&operator=(const SDL_Color&color); + Color&operator=(const Color&color); + bool operator==(const ValueRGBA&color) const; + bool operator==(const SDL_Color&color) const; + bool operator==(const Color&color) const; + operator ValueRGBA() const; + operator SDL_Color() const; + + int getRGBA(); + + bool equals(const ValueRGBA&color) const; + bool equals(const SDL_Color&color) const; + bool equals(const Color&color) const; + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Console.cpp b/SmashBros/GameEngine/Console.cpp new file mode 100644 index 0000000..cda6260 --- /dev/null +++ b/SmashBros/GameEngine/Console.cpp @@ -0,0 +1,42 @@ +#include "Console.h" +#include +#include "SDL_rwops.h" +#include "ObjCBridge.h" + +namespace GameEngine +{ + String Console::outputFile = ""; + bool Console::tofile = false; + + void Console::Write(const String&text) + { + //std::cout << text; + GameEngine_Log(text); + if(tofile) + { + SDL_RWops*file = SDL_RWFromFile(outputFile, "a+"); + SDL_RWseek(file,0,RW_SEEK_END); + SDL_RWwrite(file,(char*)text,1,text.length()); + SDL_RWclose(file); + } + } + + void Console::WriteLine(const String&text) + { + //std::cout << text << std::endl; + GameEngine_Log(text + '\n'); + if(tofile) + { + SDL_RWops*file = SDL_RWFromFile(outputFile, "a+"); + SDL_RWseek(file,0,RW_SEEK_END); + SDL_RWwrite(file,(char*)(text + '\n'),1,text.length()+1); + SDL_RWclose(file); + } + } + + void Console::OutputToFile(bool toggle, const String&filePath) + { + tofile = toggle; + outputFile = (String)getenv("HOME") + "/Documents/" + filePath; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Console.h b/SmashBros/GameEngine/Console.h new file mode 100644 index 0000000..d4ccafb --- /dev/null +++ b/SmashBros/GameEngine/Console.h @@ -0,0 +1,17 @@ +#include "String.h" + +#pragma once + +namespace GameEngine +{ + class Console + { + private: + static bool tofile; + static String outputFile; + public: + static void Write(const String&text); + static void WriteLine(const String&text); + static void OutputToFile(bool toggle, const String&filePath); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Font.cpp b/SmashBros/GameEngine/Font.cpp new file mode 100644 index 0000000..f3e8202 --- /dev/null +++ b/SmashBros/GameEngine/Font.cpp @@ -0,0 +1,184 @@ + +#include "Font.h" +#include "Console.h" + +namespace GameEngine +{ + Font::Font(const String&fileName, int style, unsigned int size) + { + font = TTF_OpenFont(fileName, (int)size); + + if(font==NULL) + { + Console::WriteLine((String)"error loading font " + fileName); + } + + if(style==BOLD) + { + TTF_SetFontStyle(font, TTF_STYLE_BOLD); + } + else if(style==ITALIC) + { + TTF_SetFontStyle(font, TTF_STYLE_ITALIC); + } + else if(style==UNDERLINE) + { + TTF_SetFontStyle(font, TTF_STYLE_UNDERLINE); + } + else if(style==STRIKETHROUGH) + { + TTF_SetFontStyle(font, TTF_STYLE_STRIKETHROUGH); + } + + this->style = style; + this->size = size; + fontPath = fileName; + } + + Font::~Font() + { + TTF_CloseFont(font); + + for(int i=0; istyle!=style) + { + if(style==PLAIN) + { + TTF_SetFontStyle(font, TTF_STYLE_NORMAL); + } + else if(style==BOLD) + { + TTF_SetFontStyle(font, TTF_STYLE_BOLD); + } + else if(style==ITALIC) + { + TTF_SetFontStyle(font, TTF_STYLE_ITALIC); + } + else if(style==UNDERLINE) + { + TTF_SetFontStyle(font, TTF_STYLE_UNDERLINE); + } + else if(style==STRIKETHROUGH) + { + TTF_SetFontStyle(font, TTF_STYLE_STRIKETHROUGH); + } + + this->style = style; + } + } + + unsigned int Font::getSize() + { + return size; + } + + void Font::setSize(unsigned int size) + { + if(size != this->size) + { + for(int i=0; ifont; + fontSize.size = this->size; + sizes.set(i, fontSize); + this->font = font; + this->size = size; + + if(style==PLAIN) + { + TTF_SetFontStyle(this->font, TTF_STYLE_NORMAL); + } + else if(style==BOLD) + { + TTF_SetFontStyle(this->font, TTF_STYLE_BOLD); + } + else if(style==ITALIC) + { + TTF_SetFontStyle(this->font, TTF_STYLE_ITALIC); + } + else if(style==UNDERLINE) + { + TTF_SetFontStyle(this->font, TTF_STYLE_UNDERLINE); + } + else if(style==STRIKETHROUGH) + { + TTF_SetFontStyle(this->font, TTF_STYLE_STRIKETHROUGH); + } + return; + } + } + + FontSize fontSize = {this->size, this->font}; + sizes.add(fontSize); + this->font = TTF_OpenFont(fontPath, size); + this->size = size; + + if(style==PLAIN) + { + TTF_SetFontStyle(this->font, TTF_STYLE_NORMAL); + } + else if(style==BOLD) + { + TTF_SetFontStyle(this->font, TTF_STYLE_BOLD); + } + else if(style==ITALIC) + { + TTF_SetFontStyle(this->font, TTF_STYLE_ITALIC); + } + else if(style==UNDERLINE) + { + TTF_SetFontStyle(this->font, TTF_STYLE_UNDERLINE); + } + else if(style==STRIKETHROUGH) + { + TTF_SetFontStyle(this->font, TTF_STYLE_STRIKETHROUGH); + } + } + } + + TTF_Font*Font::getTTF() + { + return font; + } + + StringTexture::StringTexture(SDL_Texture*texture, Font*font, const String&text, unsigned int size, int style) + { + this->texture = texture; + this->font = font; + this->text = text; + this->size = size; + this->style = style; + } + + StringTexture::~StringTexture() + { + SDL_DestroyTexture(texture); + } + + bool StringTexture::equals(const StringTexture&strTxtr) + { + if(font==strTxtr.font && text.equals(strTxtr.text) && size==strTxtr.size && style==strTxtr.style) + { + return true; + } + return false; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Font.h b/SmashBros/GameEngine/Font.h new file mode 100644 index 0000000..6d09c2b --- /dev/null +++ b/SmashBros/GameEngine/Font.h @@ -0,0 +1,62 @@ + +#include "SDL_ttf.h" +#include "ArrayList.h" +#include "String.h" + +#pragma once + +namespace GameEngine +{ + class Font + { + private: + typedef struct + { + unsigned int size; + TTF_Font*font; + } FontSize; + + ArrayList sizes; + TTF_Font*font; + + unsigned int size; + int style; + + String fontPath; + + public: + static const int PLAIN = 0; + static const int BOLD = 1; + static const int ITALIC = 2; + static const int UNDERLINE = 3; + static const int STRIKETHROUGH = 4; + + Font(const String&fileName, int style = PLAIN, unsigned int size = 1); + virtual ~Font(); + + int getStyle(); + void setStyle(int style); + + unsigned int getSize(); + void setSize(unsigned int size); + + TTF_Font*getTTF(); + }; + + class StringTexture + { + friend class Graphics2D; + private: + Font*font; + String text; + unsigned int size; + int style; + SDL_Texture*texture; + + public: + StringTexture(SDL_Texture*texture, Font*font, const String&text, unsigned int size, int style); + ~StringTexture(); + + bool equals(const StringTexture&strTxtr); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/GameEngine.h b/SmashBros/GameEngine/GameEngine.h new file mode 100755 index 0000000..6ff9bf7 --- /dev/null +++ b/SmashBros/GameEngine/GameEngine.h @@ -0,0 +1,49 @@ +#include "Actor.h" +#include "Animation.h" +#include "Application.h" +#include "ApplicationEventListener.h" +#include "ArrayList.h" +#include "AssetManager.h" +#include "BatchLoader.h" +#include "Bitset.h" +#include "BufferedImage.h" +#include "Color.h" +#include "Console.h" +#include "Font.h" +#include "GlobalDefs.h" +#include "Graphics2D.h" +#include "Image.h" +#include "Keys.h" +#include "MenuScreen.h" +#include "Music.h" +#include "P2PManager.h" +#include "PixelIterator.h" +#include "PrefManager.h" +#include "PrimitiveActor.h" +#include "Screen.h" +#include "ScreenManager.h" +#include "Sound.h" +#include "String.h" +#include "TextActor.h" +#include "Thread.h" +#include "TouchPoint.h" +#include "Vector2.h" +#include "View.h" +#include "WireframeActor.h" + +#include "ObjCBridge.h" + +#pragma once + +namespace GameEngine +{ + static double random() + { + return (double)rand()/RAND_MAX; + } +} + +using namespace GameEngine; + +typedef unsigned char byte; +typedef bool boolean; \ No newline at end of file diff --git a/SmashBros/GameEngine/GlobalDefs.h b/SmashBros/GameEngine/GlobalDefs.h new file mode 100644 index 0000000..1d2ec58 --- /dev/null +++ b/SmashBros/GameEngine/GlobalDefs.h @@ -0,0 +1,81 @@ + +#pragma once + +#define null 0 + +namespace GameEngine +{ + const double PI = 3.1415926535897931; + + const int INTEGER_MAX = 2147483647; + + static double radtodeg(double rad) + { + return rad * 180 / PI; + } + + static double degtorad(double degrees) + { + return degrees * PI / 180; + } + + typedef struct + { + int left,top,right,bottom; + } Rect; + + typedef struct + { + float left,top,right,bottom; + } RectF; + + class Rectangle + { + public: + int x,y,width,height; + + Rectangle() + { + x=0; + y=0; + width=0; + height=0; + } + Rectangle(int x,int y,int width,int height) + { + this->x = x; + this->y = y; + this->width = width; + this->height = height; + } + ~Rectangle() + { + // + } + }; + + class RectangleF + { + public: + float x,y,width,height; + + RectangleF() + { + x=0; + y=0; + width=0; + height=0; + } + RectangleF(float x,float y,float width,float height) + { + this->x = x; + this->y = y; + this->width = width; + this->height = height; + } + ~RectangleF() + { + // + } + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Graphics2D.cpp b/SmashBros/GameEngine/Graphics2D.cpp new file mode 100644 index 0000000..ecd60c1 --- /dev/null +++ b/SmashBros/GameEngine/Graphics2D.cpp @@ -0,0 +1,635 @@ + +#include "Graphics2D.h" +#include "GlobalDefs.h" +#include "Console.h" +#include "Application.h" +#include "View.h" + +namespace GameEngine +{ + void Graphics2D::reset() + { + setRotation(0,0,0); + setScale(1,1); + setTranslation(0,0); + setAlpha(255); + setColor(Color::BLACK); + setImageMask(Color::WHITE); + font = defaultFont; + SDL_Rect rect; + rect.x = 0; + rect.y = 0; + rect.w = View::Width(); + rect.h = View::Height(); + SDL_RenderSetViewport(renderer, &rect); + } + + void Graphics2D::updateStringCache() + { + for(int i=0; iequals(*oldStrTxtr)) + { + stored = true; + } + } + if(!stored) + { + delete oldStrTxtr; + } + } + stringCache.clear(); + stringCache = nextStringCache; + nextStringCache.clear(); + } + + void Graphics2D::setClippedDrawRect(RectF&srcrect, RectF&dstrect) + { + float srcW = srcrect.right - srcrect.left; + float srcH = srcrect.bottom - srcrect.top; + float dstW = dstrect.right - dstrect.left; + float dstH = dstrect.bottom - dstrect.top; + + if(dstrect.left < 0) + { + float dif = 0 - dstrect.left; + float lev = (float)((int)((dif/dstW)*srcW)); + srcrect.left += lev; + dstrect.left += (float)((lev/srcW)*dstW); + } + if(dstrect.top < 0) + { + float dif = 0 - dstrect.top; + float lev = (float)((int)((dif/dstH)*srcH)); + srcrect.top += lev; + dstrect.top += (float)((lev/srcH)*dstH); + } + if(dstrect.right > View::Width()) + { + float dif = dstrect.right - View::Width(); + float lev = (float)((int)((dif/dstW)*srcW)); + srcrect.right -= lev; + dstrect.right -= (float)((lev/srcW)*dstW); + } + if(dstrect.bottom > View::Height()) + { + float dif = dstrect.bottom - View::Height(); + float lev = (float)((int)((dif/dstH)*srcH)); + srcrect.bottom -= lev; + dstrect.bottom -= (float)((lev/srcH)*dstH); + } + } + + Vector2f Graphics2D::getRotationCoords(float x1, float y1) + { + if(Rotation == 0) + { + return Vector2f(x1,y1); + } + else + { + float s = sinRad; + float c = cosRad; + + // translate point back to origin: + x1 -= (rotX*ScaleX); + y1 -= (rotY*ScaleY); + + // rotate point + float xnew = x1 * c - y1 * s; + float ynew = x1 * s + y1 * c; + + return Vector2f(xnew + (rotX*ScaleX), ynew + (rotY*ScaleY)); + } + } + + Color Graphics2D::getColorWithAlpha(const Color&color) + { + return Color(color.r,color.g,color.b,(unsigned char)alpha); + } + + SDL_Texture*Graphics2D::getTextureFromString(const String&text) + { + for(int i=0; ifont==font && strTxtr->text.equals(text) && strTxtr->size==font->getSize() && strTxtr->style==font->getStyle()) + { + bool stored = false; + for(int j=0; (jequals(*nxtStrTxtr)) + { + stored = true; + } + } + if(!stored) + { + nextStringCache.add(strTxtr); + } + return strTxtr->texture; + } + } + for(int i=0; ifont==font && strTxtr->text.equals(text) && strTxtr->size==font->getSize() && strTxtr->style==font->getStyle()) + { + return strTxtr->texture; + } + } + + SDL_Surface*surface = TTF_RenderText_Solid(font->getTTF(), text, Color::WHITE); + SDL_Texture*texture = SDL_CreateTextureFromSurface(renderer, surface); + SDL_FreeSurface(surface); + + StringTexture*strTxtr = new StringTexture(texture, font, text, font->getSize(), font->getStyle()); + nextStringCache.add(strTxtr); + return texture; + } + + Graphics2D::Graphics2D(void) + { + color = Color::BLACK; + imageColor = Color::WHITE; + overlayColor = Color::TRANSPARENT; + defaultFont = new Font("Fonts/arial.ttf", Font::PLAIN, 12); + font = defaultFont; + alpha=255; + Rotation = 0; + ScaleX = 1; + ScaleY = 1; + rotX = 0; + rotY = 0; + tx = 0; + ty = 0; + } + + Graphics2D::~Graphics2D(void) + { + delete defaultFont; + } + + SDL_Renderer*Graphics2D::getRenderer() + { + return renderer; + } + + void Graphics2D::setRotation(float rotation) + { + this->Rotation = rotation; + if(Rotation==0) + { + sinRad = 0; + cosRad = 1; + } + else + { + float radians = degtorad(Rotation); + sinRad = sin(radians); + cosRad = cos(radians); + } + } + + void Graphics2D::setRotation(float rotation, float x1, float y1) + { + this->Rotation = rotation; + if(Rotation==0) + { + sinRad = 0; + cosRad = 1; + } + else + { + float radians = degtorad(Rotation); + sinRad = sin(radians); + cosRad = cos(radians); + } + } + + float Graphics2D::getRotation() + { + return Rotation; + } + + void Graphics2D::rotate(float rotation) + { + this->Rotation += rotation; + if(Rotation==0) + { + sinRad = 0; + cosRad = 1; + } + else + { + float radians = degtorad(Rotation); + sinRad = sin(radians); + cosRad = cos(radians); + } + } + + void Graphics2D::rotate(float rotation, float x1, float y1) + { + this->Rotation += rotation; + rotX = x1; + rotY = y1; + if(Rotation==0) + { + sinRad = 0; + cosRad = 1; + } + else + { + float radians = degtorad(Rotation); + sinRad = sin(radians); + cosRad = cos(radians); + } + } + + void Graphics2D::setScale(float scalex, float scaley) + { + ScaleX = scalex; + ScaleY = scaley; + } + + void Graphics2D::scale(float scalex, float scaley) + { + ScaleX*=scalex; + ScaleY*=scaley; + } + + Vector2f Graphics2D::getScale() + { + return Vector2f(ScaleX,ScaleY); + } + + void Graphics2D::setTranslation(float x1, float y1) + { + tx = x1; + ty = y1; + } + + void Graphics2D::translate(float x1, float y1) + { + tx+=x1; + ty+=y1; + } + + void Graphics2D::setColor(const Color&color) + { + this->color = color; + } + + Color Graphics2D::getColor() + { + return color; + } + + void Graphics2D::setImageMask(const Color&color) + { + this->imageColor = color; + } + + Color Graphics2D::getImageMask() + { + return imageColor; + } + + void Graphics2D::setAlpha(unsigned char alpha) + { + this->alpha = alpha; + } + + unsigned char Graphics2D::getAlpha() + { + return alpha; + } + + void Graphics2D::setFont(Font*font) + { + this->font = font; + } + + Font*Graphics2D::getDefaultFont() + { + return defaultFont; + } + + void Graphics2D::drawString(const String&text, float x1, float y1) + { + if(!text.equals("")) + { + SDL_Texture*texture = getTextureFromString(text); + + int w,h; + int access; + unsigned int format; + + SDL_QueryTexture(texture, &format, &access, &w, &h); + + Vector2f vect = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + y1 -= ((float)font->getSize()*ScaleY); + + SDL_Rect srcrect; + srcrect.x = 0; + srcrect.y = 0; + srcrect.w = w; + srcrect.h = h; + + SDL_Rect dstrect; + dstrect.x = (int)x1; + dstrect.y = (int)(y1 + ((float)font->getSize()/20) - 1); + dstrect.w = (int)(w*ScaleX); + dstrect.h = (int)(h*ScaleY); + + SDL_Point center; + center.x = 0; + center.y = 0; + + SDL_SetTextureAlphaMod(texture, alpha); + SDL_SetTextureColorMod(texture, color.r, color.g, color.b); + + if(renderer!=NULL) + { + SDL_RenderCopyEx(renderer, texture, &srcrect, &dstrect, (double)Rotation, ¢er, SDL_FLIP_NONE); + } + } + } + + void Graphics2D::drawLine(float x1,float y1,float x2,float y2) + { + Vector2f v1 = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + Vector2f v2 = getRotationCoords((x2+tx)*ScaleX,(y2+ty)*ScaleY); + + if(renderer!=NULL) + { + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, alpha); + SDL_RenderDrawLine(renderer, (int)v1.x, (int)v1.y, (int)v2.x, (int)v2.y); + } + } + + void Graphics2D::drawRect(float x1,float y1,float w,float h) + { + SDL_Rect rect; + + Vector2f vect = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + rect.x = (int)x1; + rect.y = (int)y1; + rect.w = (int)(w*ScaleX); + rect.h = (int)(h*ScaleX); + + if(renderer!=NULL) + { + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, alpha); + SDL_RenderDrawRect(renderer, &rect); + } + } + + void Graphics2D::fillRect(float x1,float y1,float w,float h) + { + SDL_Rect rect; + + Vector2f vect = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + rect.x = (int)x1; + rect.y = (int)y1; + rect.w = (int)(w*ScaleX); + rect.h = (int)(h*ScaleX); + + if(renderer!=NULL) + { + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, alpha); + SDL_RenderFillRect(renderer, &rect); + } + } + + /*void Graphics2D::drawOval(float x1,float y1,float w,float h) + { + sf::CircleShape oval; + if(w>h) + { + float scale = w/h; + oval = sf::CircleShape(h/2); + oval.setScale(scale*ScaleX,1*ScaleY); + } + else if(h>w) + { + float scale = h/w; + oval = sf::CircleShape(w/2); + oval.setScale(1*ScaleX,scale*ScaleY); + } + else + { + oval = sf::CircleShape(w/2); + oval.setScale(ScaleX,ScaleY); + } + + sf::Vector2f vect = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + oval.setPosition(x1,y1); + oval.setRotation(Rotation); + + oval.setOutlineColor(getColorWithAlpha(color)); + oval.setOutlineThickness(1); + oval.setFillColor(sf::Color::Transparent); + window->draw(oval); + }*/ + + /*void Graphics2D::fillOval(float x1,float y1,float w,float h) + { + sf::CircleShape oval; + if(w>h) + { + float scale = w/h; + oval = sf::CircleShape(h/2); + oval.setScale(scale*ScaleX,1*ScaleY); + } + else if(h>w) + { + float scale = h/w; + oval = sf::CircleShape(w/2); + oval.setScale(1*ScaleX,scale*ScaleY); + } + else + { + oval = sf::CircleShape(w/2); + oval.setScale(ScaleX,ScaleY); + } + + sf::Vector2f vect = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + oval.setPosition(x1,y1); + oval.setRotation(Rotation); + + oval.setFillColor(getColorWithAlpha(color)); + window->draw(oval); + }*/ + + void Graphics2D::drawImage(BufferedImage*img, float x1, float y1) + { + SDL_Texture*texture = img->getTexture(); + unsigned int width = img->getWidth(); + unsigned int height = img->getHeight(); + + SDL_Rect srcrect; + srcrect.x = 0; + srcrect.y = 0; + srcrect.w = width; + srcrect.h = height; + + Vector2f vect = getRotationCoords((x1+tx)*ScaleX, (y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + + SDL_Rect dstrect; + dstrect.x = (int)x1; + dstrect.y = (int)y1; + dstrect.w = (int)(width*ScaleX); + dstrect.h = (int)(height*ScaleY); + + SDL_Point center; + center.x = 0; + center.y = 0; + + SDL_SetTextureColorMod(texture, imageColor.r, imageColor.g, imageColor.b); + SDL_SetTextureAlphaMod(texture, alpha); + + if(renderer!=NULL) + { + SDL_RenderCopyEx(renderer, texture, &srcrect, &dstrect, (double)Rotation, ¢er, SDL_FLIP_NONE); + } + } + + void Graphics2D::drawImage(BufferedImage*img, float x1, float y1, float w, float h) + { + SDL_Texture*texture = img->getTexture(); + unsigned int width = img->getWidth(); + unsigned int height = img->getHeight(); + + SDL_Rect srcrect; + srcrect.x = 0; + srcrect.y = 0; + srcrect.w = (int)width; + srcrect.h = (int)height; + + Vector2f vect = getRotationCoords((x1+tx)*ScaleX,(y1+ty)*ScaleY); + x1 = vect.x; + y1 = vect.y; + + SDL_Rect dstrect; + dstrect.x = (int)x1; + dstrect.y = (int)y1; + dstrect.w = (int)(w*ScaleX); + dstrect.h = (int)(h*ScaleY); + + SDL_Point center; + center.x = 0; + center.y = 0; + + SDL_SetTextureColorMod(texture, imageColor.r, imageColor.g, imageColor.b); + SDL_SetTextureAlphaMod(texture, alpha); + + if(renderer!=NULL) + { + SDL_RenderCopyEx(renderer, texture, &srcrect, &dstrect, (double)Rotation, ¢er, SDL_FLIP_NONE); + } + } + + void Graphics2D::drawImage(BufferedImage*img, float dx1, float dy1, float dx2, float dy2, int sx1, int sy1, int sx2, int sy2) + { + SDL_Texture*texture = img->getTexture(); + + /*if(Rotation == 0) + { + RectF srcrectF; + srcrectF.left = (float)sx1; + srcrectF.top = (float)sy1; + srcrectF.right = (float)sx2; + srcrectF.bottom = (float)sy2; + + float w = ((dx2 - dx1)*ScaleX); + float h = ((dy2 - dy1)*ScaleY); + + dx1 = (dx1+tx)*ScaleX; + dy1 = (dy1+ty)*ScaleY; + + RectF dstrectF; + dstrectF.left = (float)dx1; + dstrectF.top = (float)dy1; + dstrectF.right = dx1 + (float)w; + dstrectF.bottom = dy1 + (float)h; + + setClippedDrawRect(srcrectF, dstrectF); + + SDL_Rect srcrect; + srcrect.x = (int)srcrectF.left; + srcrect.y = (int)srcrectF.top; + srcrect.w = (int)(srcrectF.right - srcrectF.left); + srcrect.h = (int)(srcrectF.bottom - srcrectF.top); + + SDL_Rect dstrect; + dstrect.x = (int)dstrectF.left; + dstrect.y = (int)dstrectF.top; + dstrect.w = (int)(dstrectF.right - dstrectF.left); + dstrect.h = (int)(dstrectF.bottom - dstrectF.top); + + SDL_Point center; + center.x = 0; + center.y = 0; + + SDL_SetTextureColorMod(texture, imageColor.r, imageColor.g, imageColor.b); + SDL_SetTextureAlphaMod(texture, alpha); + + if(renderer!=NULL) + { + SDL_RenderCopyEx(renderer, texture, &srcrect, &dstrect, (double)Rotation, ¢er, SDL_FLIP_NONE); + } + } + else + {*/ + SDL_Rect srcrect; + srcrect.x = (int)sx1; + srcrect.y = (int)sy1; + srcrect.w = (int)(sx2 - sx1); + srcrect.h = (int)(sy2 - sy1); + + float w = ((dx2 - dx1)*ScaleX); + float h = ((dy2 - dy1)*ScaleY); + + Vector2f vect = getRotationCoords((dx1+tx)*ScaleX, (dy1+ty)*ScaleY); + dx1 = vect.x; + dy1 = vect.y; + + SDL_Rect dstrect; + dstrect.x = (int)dx1; + dstrect.y = (int)dy1; + dstrect.w = (int)w; + dstrect.h = (int)h; + + SDL_Point center; + center.x = 0; + center.y = 0; + + SDL_SetTextureColorMod(texture, imageColor.r, imageColor.g, imageColor.b); + SDL_SetTextureAlphaMod(texture, alpha); + + if(renderer!=NULL) + { + SDL_RenderCopyEx(renderer, texture, &srcrect, &dstrect, (double)Rotation, ¢er, SDL_FLIP_NONE); + } + //} + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Graphics2D.h b/SmashBros/GameEngine/Graphics2D.h new file mode 100644 index 0000000..dddd557 --- /dev/null +++ b/SmashBros/GameEngine/Graphics2D.h @@ -0,0 +1,90 @@ + +#include "forwards.h" +#include "BufferedImage.h" +#include "Color.h" +#include "Vector2.h" +#include "Font.h" +#include "GlobalDefs.h" + +#pragma once + +namespace GameEngine +{ + class Graphics2D + { + friend class Application; + friend class View; + friend int ApplicationEventHandler(void*,SDL_Event*); + + private: + ArrayList stringCache; + ArrayList nextStringCache; + + Color color; + Color imageColor; + + Font*defaultFont; + Font*font; + SDL_Renderer*renderer; + + float Rotation; + float cosRad; + float sinRad; + float ScaleX,ScaleY; + float rotX,rotY; + float tx,ty; + Color overlayColor; + unsigned char alpha; + + void reset(); + void updateStringCache(); + + void setClippedDrawRect(RectF&srcrect, RectF&dstrect); + + Vector2f getRotationCoords(float x1, float y1); + Color getColorWithAlpha(const Color&color); + + SDL_Texture*getTextureFromString(const String&text); + + public: + Graphics2D(void); + virtual ~Graphics2D(void); + + SDL_Renderer*getRenderer(); + + void setRotation(float rotation); + void setRotation(float rotation, float x1, float y1); + float getRotation(); + void rotate(float rotation); + void rotate(float rotation, float x1, float y1); + + void setScale(float scalex, float scaley); + void scale(float scalex, float scaley); + Vector2f getScale(); + + void setTranslation(float x1, float y1); + void translate(float x1, float y1); + + void setColor(const Color&color); + Color getColor(); + + void setImageMask(const Color&color); + Color getImageMask(); + + void setAlpha(unsigned char alpha); + unsigned char getAlpha(); + + void setFont(Font*font); + Font*getDefaultFont(); + + void drawString(const String&text, float x1, float y1); + void drawLine(float x1,float y1,float x2,float y2); + void drawRect(float x1,float y1,float w,float h); + void fillRect(float x1,float y1,float w,float h); + //void drawOval(float x1,float y1,float w,float h); + //void fillOval(float x1,float y1,float w,float h); + void drawImage(BufferedImage*img, float x1, float y1); + void drawImage(BufferedImage*img, float x1, float y1, float width, float height); + void drawImage(BufferedImage*img, float dx1, float dy1, float dx2, float dy2, int sx1, int sy1, int sx2, int sy2); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Image.cpp b/SmashBros/GameEngine/Image.cpp new file mode 100755 index 0000000..ad9d296 --- /dev/null +++ b/SmashBros/GameEngine/Image.cpp @@ -0,0 +1,143 @@ + +#include "Image.h" +#include "BufferedImage.h" +#include "SDL_image.h" + +namespace GameEngine +{ + Image::Image() + { + pixels = NULL; + width = 0; + height = 0; + } + + Image::~Image() + { + if(pixels!=NULL) + { + delete pixels; + pixels = NULL; + } + width = 0; + height = 0; + } + + void Image::create(unsigned int w, unsigned int h, const ValueRGBA&color) + { + unsigned int total = w*h; + if(pixels!=NULL) + { + delete pixels; + pixels = NULL; + } + + pixels = new ValueRGBA[total]; + + for(unsigned int i=0; iformat->BytesPerPixel; + + width = img->w; + height = img->h; + unsigned int total = width*height; + + unsigned int counter = 0; + + unsigned char*imgPx = (unsigned char*)img->pixels; + + for(unsigned int i=0; i +#import + +#pragma once + +@interface MailViewController : UIViewController +- (IBAction)openMail:(id)sender viewCtrl:(UIViewController*)viewCtrl person:(NSString*)person subject:(NSString*)subject body:(NSString*)body; +- (bool)isOpened; +@end \ No newline at end of file diff --git a/SmashBros/GameEngine/MailViewController.mm b/SmashBros/GameEngine/MailViewController.mm new file mode 100644 index 0000000..9bbd91a --- /dev/null +++ b/SmashBros/GameEngine/MailViewController.mm @@ -0,0 +1,71 @@ + +#import "MailViewController.h" + +static bool mailOpened = false; +static UIViewController*currentView = nil; + +@implementation MailViewController + +- (bool)isOpened +{ + return mailOpened; +} + +- (IBAction)openMail:(id)sender viewCtrl:(UIViewController*)viewCtrl person:(NSString*)person subject:(NSString*)subject body:(NSString*)body +{ + if ([MFMailComposeViewController canSendMail] && !mailOpened) + { + MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; + mailer.mailComposeDelegate = self; + [mailer setSubject:subject]; + NSArray *toRecipients = [NSArray arrayWithObjects:person, nil]; + [mailer setToRecipients:toRecipients]; + [mailer setMessageBody:body isHTML:NO]; + [viewCtrl presentModalViewController:mailer animated:YES]; + [mailer release]; + currentView = viewCtrl; + mailOpened = true; + } + else + { + NSLog(@"Error: your device doesn't support the composer sheet"); + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure" + message:@"Your device doesn't support the composer sheet" + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alert show]; + [alert release]; + } +} + +- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error +{ + switch (result) + { + case MFMailComposeResultCancelled: + NSLog(@"Mail cancelled: you cancelled the operation and no email message was queued."); + break; + + case MFMailComposeResultSaved: + NSLog(@"Mail saved: you saved the email message in the drafts folder."); + break; + + case MFMailComposeResultSent: + NSLog(@"Mail send: the email message is queued in the outbox. It is ready to send."); + break; + + case MFMailComposeResultFailed: + NSLog(@"Mail failed: the email message was not saved or queued, possibly due to an error."); + break; + + default: + NSLog(@"Mail not sent."); + break; + } + // Remove the mail view + [currentView dismissModalViewControllerAnimated:YES]; + mailOpened = false; +} + +@end \ No newline at end of file diff --git a/SmashBros/GameEngine/MenuScreen.cpp b/SmashBros/GameEngine/MenuScreen.cpp new file mode 100755 index 0000000..b20c474 --- /dev/null +++ b/SmashBros/GameEngine/MenuScreen.cpp @@ -0,0 +1,540 @@ +#include "MenuScreen.h" +#include "Application.h" +#include "ScreenManager.h" + +namespace GameEngine +{ + MenuScreen::MenuScreen(String n) : Screen(n) + { + selectedIndex = -1; + Items = ArrayList(); + soundEnabled = true; + } + + MenuScreen::~MenuScreen() + { + int total = Items.size(); + for(int i=0; i-1) + { + prevTouchId = Items.get(selectedIndex)->getTouchId(); + } + Screen::Update(gameTime); + ArrayList touchPoints = Application::getTouchPoints(); + ArrayList prevTouchPoints = Application::getPrevTouchPoints(); + if(touchPoints.size()>0) + { + selecting = true; + } + else + { + selecting = false; + } + + bool canBeSelected = true; + int prevSelectedIndex = selectedIndex; + selectedIndex = -1; + for(int i=(Items.size()-1); i>=0; i--) + { + MenuItem*currentItem = Items.get(i); + currentItem->Update(gameTime); + if(canBeSelected) + { + if(currentItem->MouseOver()) + { + currentItem->setSelected(true); + selectedIndex = i; + canBeSelected = false; + } + else + { + currentItem->setSelected(false); + } + } + else + { + currentItem->setSelected(false); + } + } + + if(prevSelectedIndex>=0 && !Application::checkTouchActive(prevTouchId)) + { + Items.get(prevSelectedIndex)->OnRelease(); + Items.get(prevSelectedIndex)->setSelected(false); + prevSelectedIndex = -1; + } + } + + void MenuScreen::Draw(Graphics2D& g, long gameTime) + { + Screen::Draw(g,gameTime); + for(int i=0; iDraw(g, gameTime); + } + } + + //ImageMenuItem + + void MenuScreen::addItem(float x1, float y1,Animation*normAnim, Animation*hoverAnim, String target) + { + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,normAnim,hoverAnim,target))); + } + + void MenuScreen::addItem(float x1, float y1,Animation*normAnim, Animation*hoverAnim, Animation*clickAnim, String target) + { + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,normAnim,hoverAnim,clickAnim,target))); + } + + void MenuScreen::addItem(float x1, float y1,Animation*anim, const Color&hoverColor, String target) + { + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,anim,hoverColor,target))); + } + + void MenuScreen::addItem(float x1, float y1,Animation*anim, const Color&hoverColor, const Color&clickColor, String target) + { + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,anim,hoverColor,clickColor,target))); + } + + void MenuScreen::addItem(float x1, float y1,String normAnim, String hoverAnim, String target) + { + Animation*norm = new Animation("normal",1); + norm->addFrame(normAnim); + Animation*hover = new Animation("hover",1); + hover->addFrame(hoverAnim); + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,norm,hover,target))); + } + + void MenuScreen::addItem(float x1, float y1,String normAnim, String hoverAnim, String clickAnim, String target) + { + Animation*norm = new Animation("normal",1); + norm->addFrame(normAnim); + Animation*hover = new Animation("hover",1); + hover->addFrame(hoverAnim); + Animation*click = new Animation("click",1); + click->addFrame(clickAnim); + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,norm,hover,click,target))); + } + + void MenuScreen::addItem(float x1, float y1,String anim, const Color&hoverColor, String target) + { + Animation*norm = new Animation("normal",1); + norm->addFrame(anim); + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,norm,hoverColor,target))); + } + + void MenuScreen::addItem(float x1, float y1,String anim, const Color&hoverColor, const Color&clickColor, String target) + { + Animation*norm = new Animation("normal",1); + norm->addFrame(anim); + Items.add(new MenuItem(this, new ImageMenuItem(this, x1,y1,norm,hoverColor,clickColor,target))); + } + + //TextMenuItem + + void MenuScreen::addItem(float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, String target) + { + Items.add(new MenuItem(this, new TextMenuItem(this, x1, y1, s,f,normC,hoverC,target))); + } + + void MenuScreen::addItem(float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, const Color&clickC, String target) + { + Items.add(new MenuItem(this, new TextMenuItem(this, x1, y1, s,f,normC,hoverC,clickC,target))); + } + + void MenuScreen::setItemScale(int index, float scale) + { + Items.get(index)->setScale(scale); + } + + void MenuScreen::setItemRotation(int index, float degrees) + { + Items.get(index)->setRotation(degrees); + } + + void MenuScreen::setItemColor(int index, const Color&c) + { + Items.get(index)->setColor(c); + } + + void MenuScreen::setItemSound(int index, Sound*sound) + { + Items.get(index)->sound = sound; + } + + void MenuScreen::enableSound(bool toggle) + { + soundEnabled = toggle; + } + + MenuScreen::TextMenuItem::TextMenuItem(MenuScreen*menu, float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, String target) : TextActor(x1,y1,s,f,normC) + { + type = 0; + this->normColor = normC; + this->hoverColor = hoverC; + this->target = target; + this->setAlignment(ALIGN_CENTER); + this->menu = menu; + } + + MenuScreen::TextMenuItem::TextMenuItem(MenuScreen*menu, float x1, float y1,String s, Font*f, const Color&normC, const Color&hoverC, const Color&clickC, String target) : TextActor(x1,y1,s,f,normC) + { + type = 1; + this->normColor = normC; + this->hoverColor = hoverC; + this->clickColor = clickC; + this->target = target; + this->setAlignment(ALIGN_CENTER); + this->menu = menu; + } + + MenuScreen::TextMenuItem::~TextMenuItem() + { + // + } + + void MenuScreen::TextMenuItem::OnRelease() + { + ScreenManager::GoToScreen(target); + } + + void MenuScreen::TextMenuItem::Draw(Graphics2D& g, long gameTime) + { + switch(type) + { + case 0: + if(selected) + { + setColor(hoverColor); + } + else + { + setColor(normColor); + } + break; + + case 1: + if(selected) + { + if(menu->selecting) + { + setColor(clickColor); + } + else + { + setColor(hoverColor); + } + } + else + { + setColor(normColor); + } + break; + } + TextActor::Draw(g,gameTime); + } + + MenuScreen::ImageMenuItem::ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*normAnim, Animation*hoverAnim, String target) : Actor(x1,y1) + { + type = 0; + normAnim->name = "normal"; + hoverAnim->name = "hover"; + addAnimation(normAnim); + addAnimation(hoverAnim); + changeAnimation("normal", FORWARD); + this->target = target; + this->menu = menu; + } + + MenuScreen::ImageMenuItem::ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*normAnim, Animation*hoverAnim, Animation*clickAnim, String target) : Actor(x1,y1) + { + type = 1; + normAnim->name = "normal"; + hoverAnim->name = "hover"; + clickAnim->name = "click"; + addAnimation(normAnim); + addAnimation(hoverAnim); + addAnimation(clickAnim); + changeAnimation("normal", FORWARD); + this->target = target; + this->menu = menu; + } + + MenuScreen::ImageMenuItem::ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*anim, const Color&hoverColor, String target) : Actor(x1,y1) + { + type = 2; + anim->name = "normal"; + addAnimation(anim); + this->hover = hoverColor; + changeAnimation("normal", FORWARD); + this->target = target; + this->menu = menu; + } + + MenuScreen::ImageMenuItem::ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*anim, const Color&hoverColor, const Color&clickColor, String target) : Actor(x1,y1) + { + type = 3; + hover = hoverColor; + click = clickColor; + anim->name = "normal"; + addAnimation(anim); + changeAnimation("normal", FORWARD); + this->target = target; + this->menu = menu; + } + + MenuScreen::ImageMenuItem::~ImageMenuItem() + { + // + } + + void MenuScreen::ImageMenuItem::OnRelease() + { + ScreenManager::GoToScreen(target); + } + + void MenuScreen::ImageMenuItem::Draw(Graphics2D& g, long gameTime) + { + switch(type) + { + case 0: + if(selected) + { + changeAnimation("hover",NO_CHANGE); + } + else + { + changeAnimation("normal", NO_CHANGE); + } + break; + + case 1: + if(selected) + { + if(menu->selecting) + { + changeAnimation("click",NO_CHANGE); + } + else + { + changeAnimation("hover",NO_CHANGE); + } + } + else + { + changeAnimation("normal", NO_CHANGE); + } + break; + + case 2: + if(selected) + { + this->setColor(hover); + } + else + { + this->setColor(normal); + } + break; + + case 3: + if(selected) + { + if(menu->selecting) + { + this->setColor(click); + } + else + { + this->setColor(hover); + } + } + else + { + this->setColor(normal); + } + break; + } + Actor::Draw(g, gameTime); + } + + MenuScreen::MenuItem::MenuItem(MenuScreen*menuScreen, TextMenuItem*textItem) + { + this->itemType = TEXT; + this->textItem = textItem; + sound = NULL; + this->menuScreen = menuScreen; + } + + MenuScreen::MenuItem::MenuItem(MenuScreen*menuScreen, ImageMenuItem*imageItem) + { + this->itemType = IMAGE; + this->imageItem = imageItem; + sound = NULL; + this->menuScreen = menuScreen; + } + + MenuScreen::MenuItem::~MenuItem() + { + switch(itemType) + { + case TEXT: + delete textItem; + break; + + case IMAGE: + delete imageItem; + break; + } + } + + void MenuScreen::MenuItem::Update(long gameTime) + { + switch(itemType) + { + case TEXT: + textItem->Update(gameTime); + break; + + case IMAGE: + imageItem->Update(gameTime); + break; + } + } + + void MenuScreen::MenuItem::Draw(Graphics2D& g, long gameTime) + { + switch(itemType) + { + case TEXT: + textItem->Draw(g,gameTime); + break; + + case IMAGE: + imageItem->Draw(g,gameTime); + break; + } + } + + long MenuScreen::MenuItem::getTouchId() + { + switch(itemType) + { + case TEXT: + return textItem->getTouchId(); + + case IMAGE: + return imageItem->getTouchId(); + } + return 0; + } + + bool MenuScreen::MenuItem::MouseOver() + { + switch(itemType) + { + case TEXT: + return textItem->mouseOver(); + + case IMAGE: + return imageItem->mouseOver(); + } + return false; + } + + void MenuScreen::MenuItem::OnRelease() + { + if(sound!=NULL && menuScreen->soundEnabled) + { + sound->play(); + } + switch(itemType) + { + case TEXT: + textItem->OnRelease(); + break; + + case IMAGE: + imageItem->OnRelease(); + break; + } + } + + void MenuScreen::MenuItem::setSelected(bool toggle) + { + switch(itemType) + { + case TEXT: + textItem->selected = toggle; + break; + + case IMAGE: + imageItem->selected = toggle; + break; + } + } + + bool MenuScreen::MenuItem::selected() + { + switch(itemType) + { + case TEXT: + return textItem->selected; + + case IMAGE: + return imageItem->selected; + } + return false; + } + + void MenuScreen::MenuItem::setScale(float scale) + { + switch(itemType) + { + case TEXT: + textItem->getFont()->setSize((int)scale); + break; + + case IMAGE: + imageItem->Scale = scale; + break; + } + } + + void MenuScreen::MenuItem::setRotation(float degrees) + { + switch(itemType) + { + case TEXT: + textItem->setRotation(degrees); + break; + + case IMAGE: + imageItem->setRotation(degrees); + break; + } + } + + void MenuScreen::MenuItem::setColor(const Color&color) + { + switch(itemType) + { + case TEXT: + textItem->normColor = color; + break; + + case IMAGE: + imageItem->normal = color; + break; + } + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/MenuScreen.h b/SmashBros/GameEngine/MenuScreen.h new file mode 100755 index 0000000..a3459af --- /dev/null +++ b/SmashBros/GameEngine/MenuScreen.h @@ -0,0 +1,133 @@ + +#include "forwards.h" +#include "Actor.h" +#include "TextActor.h" +#include "Screen.h" +#include "Sound.h" + +#pragma once + +namespace GameEngine +{ + class MenuScreen : public Screen + { + private: + + static const unsigned char TEXT = 0; + static const unsigned char IMAGE = 1; + + class TextMenuItem : TextActor + { + friend class MenuScreen; + private: + MenuScreen*menu; + + unsigned char type; + + Color normColor; + Color hoverColor; + Color clickColor; + + String target; + + bool selected; + public: + TextMenuItem(MenuScreen*menu, float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, String target); + TextMenuItem(MenuScreen*menu, float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, const Color&clickC, String target); + virtual ~TextMenuItem(); + + void OnRelease(); + virtual void Draw(Graphics2D& g, long gameTime); + + }; + + class ImageMenuItem : Actor + { + friend class MenuScreen; + private: + MenuScreen*menu; + + unsigned char type; + + String target; + Color hover,click,normal; + bool selected; + + public: + ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*normAnim, Animation*hoverAnim, String target); + ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*normAnim, Animation*hoverAnim, Animation*clickAnim, String target); + ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*anim, const Color&hoverColor, String target); + ImageMenuItem(MenuScreen*menu, float x1, float y1,Animation*anim, const Color&hoverColor, const Color&clickColor, String target); + virtual ~ImageMenuItem(); + + void OnRelease(); + virtual void Draw(Graphics2D& g, long gameTime); + }; + + class MenuItem + { + friend class MenuScreen; + private: + TextMenuItem*textItem; + ImageMenuItem*imageItem; + + unsigned char itemType; + + Sound*sound; + + MenuScreen*menuScreen; + + public: + MenuItem(MenuScreen*menuScreen, TextMenuItem*textItem); + MenuItem(MenuScreen*menuScreen, ImageMenuItem*imageItem); + virtual ~MenuItem(); + + void Update(long gameTime); + void Draw(Graphics2D& g, long gameTime); + + bool MouseOver(); + void OnRelease(); + void setSelected(bool toggle); + long getTouchId(); + bool selected(); + void setScale(float scale); + void setRotation(float rotation); + void setColor(const Color&color); + }; + + ArrayList Items; + + protected: + int selectedIndex; + bool selecting; + bool soundEnabled; + + public: + MenuScreen(String n); + virtual ~MenuScreen(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D& g, long gameTime); + + //ImageMenuItem + void addItem(float x1, float y1,Animation*normAnim, Animation*hoverAnim, String target); + void addItem(float x1, float y1,Animation*normAnim, Animation*hoverAnim, Animation*clickAnim, String target); + void addItem(float x1, float y1,Animation*anim, const Color&hoverColor, String target); + void addItem(float x1, float y1,Animation*anim, const Color&hoverColor, const Color&clickColor, String target); + void addItem(float x1, float y1,String normAnim, String hoverAnim, String target); + void addItem(float x1, float y1,String normAnim, String hoverAnim, String clickAnim, String target); + void addItem(float x1, float y1,String anim, const Color&hoverColor, String target); + void addItem(float x1, float y1,String anim, const Color&hoverColor, const Color&clickColor, String target); + + //TextMenuItem + void addItem(float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, String target); + void addItem(float x1, float y1, String s, Font*f, const Color&normC, const Color&hoverC, const Color&clickC, String target); + + void setItemScale(int index, float scale); + void setItemRotation(int index, float degrees); + void setItemColor(int index, const Color&c); + void setItemSound(int index, Sound*sound); + + void enableSound(bool toggle); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/MessageBoxDelegate.h b/SmashBros/GameEngine/MessageBoxDelegate.h new file mode 100644 index 0000000..64af946 --- /dev/null +++ b/SmashBros/GameEngine/MessageBoxDelegate.h @@ -0,0 +1,15 @@ + +#import + +@interface MessageBoxDelegate : UIViewController +{ +@public + BOOL closed; + int result; +} + +- (void)prepare; +- (BOOL)isClosed; +- (int)getResult; + +@end diff --git a/SmashBros/GameEngine/MessageBoxDelegate.mm b/SmashBros/GameEngine/MessageBoxDelegate.mm new file mode 100644 index 0000000..517f7a5 --- /dev/null +++ b/SmashBros/GameEngine/MessageBoxDelegate.mm @@ -0,0 +1,29 @@ + +#import "MessageBoxDelegate.h" + + +@implementation MessageBoxDelegate + +- (void)prepare +{ + result = 0; + closed = NO; +} + +- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + result = buttonIndex; + closed = YES; +} + +- (BOOL)isClosed +{ + return closed; +} + +- (int)getResult +{ + return result; +} + +@end diff --git a/SmashBros/GameEngine/Music.cpp b/SmashBros/GameEngine/Music.cpp new file mode 100644 index 0000000..8a48e22 --- /dev/null +++ b/SmashBros/GameEngine/Music.cpp @@ -0,0 +1,252 @@ + +#include "Music.h" +#include "Console.h" + +namespace GameEngine +{ + Music*Music::musicPlaying = NULL; + bool Music::lockMusicPlaying = false; + + void MusicFinishHandler() + { + while(Music::lockMusicPlaying); + Music::lockMusicPlaying = true; + if(Music::musicPlaying!=NULL) + { + if(Music::musicPlaying->finishing) + { + Music::musicPlaying->onFinish(); + Music::musicPlaying->stopped = true; + Music::musicPlaying->paused = false; + } + else + { + Music::musicPlaying->stopped = true; + Music::musicPlaying->paused = false; + Music::musicPlaying->finishing = true; + } + } + Music::lockMusicPlaying = false; + } + + void Music::init() + { + Mix_HookMusicFinished(MusicFinishHandler); + } + + Music::Music() + { + loaded = false; + paused = false; + stopped = true; + music = NULL; + } + + Music::~Music() + { + if(loaded) + { + Mix_FreeMusic(music); + music = NULL; + paused = false; + stopped = true; + loaded = false; + } + } + + bool Music::loadFromFile(const String&filePath) + { + if(loaded) + { + Mix_FreeMusic(music); + music = NULL; + paused = false; + stopped = true; + finishing = true; + loaded = false; + } + + music = Mix_LoadMUS(filePath); + if(music!=NULL) + { + paused = false; + stopped = true; + loaded = true; + finishing = true; + return true; + } + Console::WriteLine((String)"Error: " + Mix_GetError()); + return false; + } + + void Music::play() + { + if(loaded) + { + Music*storeMusicPlaying = musicPlaying; + if(musicPlaying!=NULL) + { + musicPlaying->finishing = false; + Mix_HaltMusic(); + musicPlaying->stopped = true; + musicPlaying->paused = false; + while(!musicPlaying->finishing); + musicPlaying = NULL; + } + + Mix_PlayMusic(music, 1); + paused = false; + stopped = false; + musicPlaying = this; + + if(storeMusicPlaying!=NULL) + { + storeMusicPlaying->onStop(); + } + onPlay(); + } + } + + void Music::loop() + { + if(loaded) + { + Music*storeMusicPlaying = musicPlaying; + if(musicPlaying!=NULL) + { + musicPlaying->finishing = false; + Mix_HaltMusic(); + musicPlaying->stopped = true; + musicPlaying->paused = false; + while(!musicPlaying->finishing); + musicPlaying = NULL; + } + + Mix_PlayMusic(music, -1); + paused = false; + stopped = false; + musicPlaying = this; + + if(storeMusicPlaying!=NULL) + { + storeMusicPlaying->onStop(); + } + onPlay(); + } + } + + void Music::loop(unsigned int numLoops) + { + if(loaded && numLoops!=0) + { + Music*storeMusicPlaying = musicPlaying; + if(musicPlaying!=NULL) + { + musicPlaying->finishing = false; + Mix_HaltMusic(); + musicPlaying->stopped = true; + musicPlaying->paused = false; + while(!musicPlaying->finishing); + musicPlaying = NULL; + } + + Mix_PlayMusic(music, numLoops); + paused = false; + stopped = false; + musicPlaying = this; + + if(storeMusicPlaying!=NULL) + { + storeMusicPlaying->onStop(); + } + onPlay(); + } + } + + void Music::stop() + { + if(loaded) + { + if(!stopped) + { + finishing = false; + Mix_HaltMusic(); + stopped = true; + paused = false; + while(!finishing); + musicPlaying = NULL; + onStop(); + } + } + } + + void Music::pause() + { + if(loaded) + { + if(!paused && !stopped) + { + Mix_PauseMusic(); + paused = true; + stopped = false; + musicPlaying = this; + onPause(); + } + } + } + + void Music::resume() + { + if(loaded) + { + if(paused) + { + Mix_ResumeMusic(); + paused = false; + stopped = false; + musicPlaying = this; + onResume(); + } + } + } + + bool Music::isLoaded() + { + return loaded; + } + + bool Music::isPaused() + { + return paused; + } + + bool Music::isStopped() + { + return stopped; + } + + void Music::onPlay() + { + //Open for implementation + } + + void Music::onPause() + { + //Open for implementation + } + + void Music::onResume() + { + //Open for implementation + } + + void Music::onStop() + { + //Open for implementation + } + + void Music::onFinish() + { + //Open for implementation + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Music.h b/SmashBros/GameEngine/Music.h new file mode 100644 index 0000000..1b5d467 --- /dev/null +++ b/SmashBros/GameEngine/Music.h @@ -0,0 +1,44 @@ + +#include "SDL_mixer.h" +#include "String.h" + +#pragma once + +namespace GameEngine +{ + class Music + { + friend class Application; + friend void MusicFinishHandler(); + private: + static Music*musicPlaying; + static bool lockMusicPlaying; + static void init(); + + bool loaded, paused, stopped, finishing; + Mix_Music*music; + + public: + Music(); + virtual ~Music(); + + bool loadFromFile(const String&filePath); + + void play(); + void loop(); + void loop(unsigned int numLoops); + void stop(); + void pause(); + void resume(); + + bool isLoaded(); + bool isPaused(); + bool isStopped(); + + virtual void onPlay(); + virtual void onPause(); + virtual void onResume(); + virtual void onStop(); + virtual void onFinish(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/ObjCBridge.h b/SmashBros/GameEngine/ObjCBridge.h new file mode 100644 index 0000000..f9c4b75 --- /dev/null +++ b/SmashBros/GameEngine/ObjCBridge.h @@ -0,0 +1,19 @@ + +#include "SDL.h" + +#pragma once + +extern void GameEngine_init(); + +extern void openURL(const char*url); +extern void writeEmail(SDL_Window*window, const char*recipient, const char*subject, const char*body); + +extern void getDeviceModel(char*deviceString); +extern void getDeviceName(char*nameString); + +extern void SDL_ShowSimpleMessageBoxFixed(const char*title, const char*message); +extern int SDL_ShowMessageBoxFixed(const char*title, const char*message, const char**options, int numOptions); + +extern void GameEngine_Log(char*text); + +extern long getUptimeMillis(void); \ No newline at end of file diff --git a/SmashBros/GameEngine/ObjCBridge.mm b/SmashBros/GameEngine/ObjCBridge.mm new file mode 100644 index 0000000..fe5c8b1 --- /dev/null +++ b/SmashBros/GameEngine/ObjCBridge.mm @@ -0,0 +1,132 @@ + +#import "ObjCBridge.h" +#import +#import "MailViewController.h" +#import "MessageBoxDelegate.h" +#import "SDL.h" +#import "SDL_syswm.h" +#import "CPPBridge.h" +#include +#include + +//static NSDate*startDate = nil; + +void GameEngine_init() +{ + /*if(startDate==nil) + { + startDate = [[NSDate alloc] initWithTimeInterval:0 sinceDate:[NSDate date]]; + }*/ +} + +UIViewController*getSDLViewController(SDL_Window*window) +{ + SDL_SysWMinfo systemWindowInfo; + SDL_VERSION(&systemWindowInfo.version); + if ( ! SDL_GetWindowWMInfo(window, &systemWindowInfo)) + { + // consider doing some kind of error handling here + return nil; + } + UIWindow * appWindow = systemWindowInfo.info.uikit.window; + UIViewController * rootViewController = appWindow.rootViewController; + return rootViewController; +} + +void openURL(const char*url) +{ + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithUTF8String:url]]]; +} + +void writeEmail(SDL_Window*window, const char*recipient, const char*subject, const char*body) +{ + MailViewController *mailer = [[MailViewController alloc] init]; + //SDL_HideWindow(window); + UIViewController*viewCtrl = getSDLViewController(window); + if(viewCtrl==nil) + { + //NSLogfile://localhost/Users/luis/Documents/Xcode/GameEngine/GameEngine/Image.cpp(@"Error getting SDL ViewController"); + return; + } + [mailer openMail:nil viewCtrl:viewCtrl person:[NSString stringWithUTF8String:recipient] subject:[NSString stringWithUTF8String:subject] body:[NSString stringWithUTF8String:body]]; + while([mailer isOpened]) + { + updateAppEvents(); + SDL_Delay(30); + } + [mailer release]; +} + +void getDeviceModel(char*deviceString) +{ + if(deviceString!=NULL) + { + UIDevice*device = [UIDevice currentDevice]; + strcpy(deviceString, [[device model] UTF8String]); + } +} + +void getDeviceName(char*nameString) +{ + if(nameString!=NULL) + { + UIDevice*device = [UIDevice currentDevice]; + strcpy(nameString, [[device name] UTF8String]); + } +} + +void SDL_ShowSimpleMessageBoxFixed(const char*title, const char*message) +{ + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:title] + message:[NSString stringWithUTF8String:message] + delegate:nil + cancelButtonTitle:@"OK" + otherButtonTitles:nil]; + [alert show]; + while(alert.visible==YES) + { + updateAppEvents(); + SDL_Delay(30); + } + [alert release]; +} + +int SDL_ShowMessageBoxFixed(const char*title, const char*message, const char**options, int numOptions) +{ + int i; + MessageBoxDelegate*messageDelegate = [[MessageBoxDelegate alloc] init]; + [messageDelegate prepare]; + UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:title] + message:[NSString stringWithUTF8String:message] + delegate:messageDelegate + cancelButtonTitle:nil + otherButtonTitles:nil]; + for(i=0; i0) + { + dataBytes = (Byte*)malloc(size); + Byte*copyBytes = (Byte*)data; + for(unsigned int i=0; i 0) + { + if(dataBytes==NULL) + { + dataBytes = (Byte*)malloc(size); + for(unsigned int i=0; itotal) + { + for(unsigned int i=total; iByteIndex; i--) + { + dataBytes[i] = dataBytes[i-1]; + } + counter = ByteIndex; + for(unsigned int i=0; iByteIndex; i--) + { + dataBytes[i] = dataBytes[i-1]; + } + counter = ByteIndex; + for(unsigned int i=0; iByteIndex; i--) + { + dataBytes[i] = dataBytes[i-1]; + } + dataBytes[ByteIndex] = dataByte; + total = total2; + } + else + { + //error + throw ((char*)((String)"ByteIndex " + ByteIndex + " out of bounds. DataVoid length is " + total)); + } + } + + void DataVoid::remove(unsigned int ByteIndex, unsigned int size) + { + if(dataBytes==NULL) + { + throw ((char*)((String)"ByteIndex " + ByteIndex + " and size " + size + " out of bounds. DataVoid length is 0")); + } + else if(ByteIndex peers; + Byte mode; + } GameEngine_DataPacket; + + int P2P_SendDataHandler(void*data) + { + GameEngine_DataPacket*packet = (GameEngine_DataPacket*)data; + + if(packet->peers.size()>0) //specific peers + { + char**peerList = new char*[packet->peers.size()]; + for(unsigned int i=0; ipeers.size(); i++) + { + peerList[i] = (char*)packet->peers.get(i); + } + if(packet->mode == P2PManager::SENDDATA_RELIABLE) + { + SDL_P2P_sendDataToPeers(Application::getWindow(), peerList, packet->peers.size(), packet->data.getData(), packet->data.length(), SDL_P2P_SENDDATA_RELIABLE); + } + else if(packet->mode == P2PManager::SENDDATA_UNRELIABLE) + { + SDL_P2P_sendDataToPeers(Application::getWindow(), peerList, packet->peers.size(), packet->data.getData(), packet->data.length(), SDL_P2P_SENDDATA_UNRELIABLE); + } + delete[] peerList; + } + else //all peers + { + if(packet->mode == P2PManager::SENDDATA_RELIABLE) + { + SDL_P2P_sendData(Application::getWindow(), packet->data.getData(), packet->data.length(), SDL_P2P_SENDDATA_RELIABLE); + } + else if(packet->mode == P2PManager::SENDDATA_UNRELIABLE) + { + SDL_P2P_sendData(Application::getWindow(), packet->data.getData(), packet->data.length(), SDL_P2P_SENDDATA_UNRELIABLE); + } + P2PManager::sendingData = false; + } + delete packet; + return 0; + } + + void P2P_EventHandler(SDL_P2P_Event*event) + { + if(P2PManager::eventListener != NULL) + { + switch(event->type) + { + case SDL_P2P_PEERCONNECTED: + { + char buffer[40]; + SDL_P2P_getSelfID(Application::getWindow(), buffer); + P2PManager::selfInfo.id = buffer; + SDL_P2P_getSelfDisplayName(Application::getWindow(), buffer); + P2PManager::selfInfo.name = buffer; + P2PManager::Peer peer = {event->peer.peerID, event->peer.peerDisplayName}; + while(P2PManager::lockPeerList); + P2PManager::lockPeerList = true; + P2PManager::peers.add(peer); + P2PManager::lockPeerList = false; + P2PManager::eventListener->peerDidConnect(event->peer.peerID); + P2PManager::pickerIsOpen = false; + } + break; + + case SDL_P2P_PEERDISCONNECTED: + { + String peerID = event->peer.peerID; + while(P2PManager::lockPeerList); + P2PManager::lockPeerList = true; + for(int i=0; ipeerDidDisconnect(peerID); + } + break; + + case SDL_P2P_PEERREQUESTEDCONNECTION: + { + P2PRequest*request = new P2PRequest(event->peer.peerID); + P2PManager::eventListener->peerDidRequestConnection(request); + delete request; + } + break; + + case SDL_P2P_PICKERDIDCANCEL: + { + P2PManager::eventListener->pickerDidCancel(); + P2PManager::pickerIsOpen = false; + } + break; + + case SDL_P2P_RECIEVEDDATA: + { + P2PManager::eventListener->didRecieveData(event->peer.peerID, event->data.data, event->data.size); + } + break; + } + } + } + + P2PRequest::P2PRequest(const String&peerID) + { + this->peerID = peerID; + handled = false; + connected = false; + } + + P2PRequest::~P2PRequest() + { + // + } + + String P2PRequest::getPeerID() + { + return peerID; + } + + bool P2PRequest::accept() + { + if(!handled) + { + SDL_bool success = SDL_P2P_acceptConnectionRequest(Application::getWindow(), peerID); + if(success) + { + handled = true; + connected = true; + return true; + } + connected = false; + return false; + } + return connected; + } + + void P2PRequest::deny() + { + if(!handled) + { + SDL_P2P_denyConnectionRequest(Application::getWindow(), peerID); + handled = true; + connected = false; + } + } + + P2PEventListener::P2PEventListener() + { + //Open for implementation + } + + P2PEventListener::~P2PEventListener() + { + //Open for implementation + } + + void P2PEventListener::peerDidConnect(String peerID) + { + //Open for implementation + } + + void P2PEventListener::peerDidDisconnect(String peerID) + { + //Open for implementation + } + + void P2PEventListener::peerDidRequestConnection(P2PRequest*request) + { + //Open for implementation + } + + void P2PEventListener::pickerDidCancel() + { + //Open for implementation + } + + void P2PEventListener::didRecieveData(String peerID, void*data, unsigned int size) + { + //Open for implementation + } + + bool P2PManager::lockPeerList = false; + P2PManager::Peer P2PManager::selfInfo = {"",""}; + ArrayList P2PManager::peers = ArrayList(); + P2PEventListener*P2PManager::eventListener = NULL; + String P2PManager::sessionID = "com.yourcompany.gameengine"; + bool P2PManager::pickerIsOpen = false; + bool P2PManager::copyingPacket = false; + bool P2PManager::sendingData = false; + + void P2PManager::Update(long gameTime) + { + if(SDL_P2P_isConnected(Application::getWindow())) + { + updateAppEvents(); + } + } + + void P2PManager::Draw(Graphics2D&g, long gameTime) + { + //possibly draw bluetooth symbol + } + + void P2PManager::setSessionID(const String&sessionID) + { + P2PManager::sessionID = sessionID; + } + + String P2PManager::getSessionID() + { + return sessionID; + } + + bool P2PManager::searchForPeers() + { + SDL_P2P_setEventHandler(P2P_EventHandler); + if(!SDL_P2P_isConnected(Application::getWindow()) && !pickerIsOpen) + { + pickerIsOpen = true; + SDL_P2P_searchForPeersBluetooth(Application::getWindow(), sessionID); + while(pickerIsOpen) + { + SDL_Delay(30); + updateAppEvents(); + } + if(SDL_P2P_isConnected(Application::getWindow())) + { + return true; + } + } + return false; + } + + bool P2PManager::isConnected() + { + if(SDL_P2P_isConnected(Application::getWindow())) + { + return true; + } + return false; + } + + bool P2PManager::isConnectedToPeer(const String&peerID) + { + if(SDL_P2P_isConnectedToPeer(Application::getWindow(), peerID)) + { + return true; + } + return false; + } + + void P2PManager::disconnectPeer(const String&peerID) + { + if(SDL_P2P_isConnectedToPeer(Application::getWindow(), peerID)) + { + SDL_P2P_disconnectPeer(Application::getWindow(), peerID); + } + } + + void P2PManager::endSession() + { + SDL_P2P_endSession(Application::getWindow()); + } + + ArrayList P2PManager::getPeers() + { + while(lockPeerList); + lockPeerList = true; + ArrayList peerList; + for(int i=0; idata.setData(data,size); + packet->mode = sendDataMode; + + SDL_CreateThread(&P2P_SendDataHandler, "SendData", (void*)packet); + } + } + + void P2PManager::sendDataToPeers(const ArrayList&peers, void*data, unsigned int size, Byte sendDataMode) + { + /*char** peerList = new char*[peers.size()]; + for(unsigned int i=0; idata.setData(data,size); + packet->peers = peers; + packet->mode = sendDataMode; + + SDL_CreateThread(&P2P_SendDataHandler, "SendData", (void*)(packet)); + } + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/P2PManager.h b/SmashBros/GameEngine/P2PManager.h new file mode 100644 index 0000000..c455656 --- /dev/null +++ b/SmashBros/GameEngine/P2PManager.h @@ -0,0 +1,131 @@ + +#include "String.h" +#include "ArrayList.h" +#include "Graphics2D.h" +#include "Bitset.h" +#include "SDL_p2p.h" + +#pragma once + +namespace GameEngine +{ + class DataVoid + { + Byte*dataBytes; + unsigned int total; + public: + DataVoid(); + DataVoid(unsigned int size); + DataVoid(void*data, unsigned int size); + DataVoid(const DataVoid&data); + virtual ~DataVoid(); + + void*getData(); + unsigned int length(); + + void resize(unsigned int size); + void clear(); + DataVoid copy(unsigned int byteIndex, unsigned int size); + void setData(void*data, unsigned int size); + + void add(void*data, unsigned int size); + void add(unsigned int byteIndex, void*data, unsigned int size); + void remove(unsigned int byteIndex, unsigned int size); + void set(unsigned int byteIndex, void*data, unsigned int size); + void*get(unsigned int byteIndex); + + void add(const DataVoid&data); + void add(unsigned int byteIndex, const DataVoid&data); + void set(unsigned int byteIndex, const DataVoid&data); + + void addByte(Byte dataByte); + void addByte(unsigned int byteIndex, Byte dataByte); + void removeByte(unsigned int byteIndex); + void setByte(unsigned int byteIndex, Byte dataByte); + Byte getByte(unsigned int byteIndex); + + static int toInt(void*data); + static long toLong(void*data); + static float toFloat(void*data); + static double toDouble(void*data); + }; + + class P2PRequest + { + friend void P2P_EventHandler(SDL_P2P_Event*event); + private: + String peerID; + bool handled; + bool connected; + + P2PRequest(const String&peerID); + ~P2PRequest(); + + public: + String getPeerID(); + bool accept(); + void deny(); + }; + + class P2PEventListener + { + public: + P2PEventListener(); + virtual ~P2PEventListener(); + virtual void peerDidConnect(String peerID); + virtual void peerDidDisconnect(String peerID); + virtual void peerDidRequestConnection(P2PRequest*request); + virtual void pickerDidCancel(); + virtual void didRecieveData(String peerID, void*data, unsigned int size); + }; + + class P2PManager + { + friend void P2P_EventHandler(SDL_P2P_Event*event); + friend int P2P_SendDataHandler(void*data); + private: + typedef struct + { + String id; + String name; + } Peer; + + static bool lockPeerList; + static Peer selfInfo; + static ArrayList peers; + static String sessionID; + static P2PEventListener*eventListener; + + static bool pickerIsOpen; + + static bool copyingPacket; + static bool sendingData; + + public: + static const unsigned char SENDDATA_RELIABLE = 0; + static const unsigned char SENDDATA_UNRELIABLE = 1; + + static void Update(long gameTime); + static void Draw(Graphics2D&g, long gameTime); + + static void setSessionID(const String&sessionID); + static String getSessionID(); + static bool searchForPeers(); + + static bool isConnected(); + static bool isConnectedToPeer(const String&peerID); + + static void disconnectPeer(const String&peerID); + static void endSession(); + + static ArrayList getPeers(); + static String getID(); + static String getDisplayName(); + static String getPeerDisplayName(const String&peerID); + + static void setEventListener(P2PEventListener*listener); + + static void sendData(void*data, unsigned int size, unsigned char sendDataMode = SENDDATA_RELIABLE); + static void sendDataToPeers(const ArrayList&peers, void*data, unsigned int size, unsigned char sendDataMode = SENDDATA_RELIABLE); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/PixelIterator.cpp b/SmashBros/GameEngine/PixelIterator.cpp new file mode 100644 index 0000000..e76365b --- /dev/null +++ b/SmashBros/GameEngine/PixelIterator.cpp @@ -0,0 +1,107 @@ + +#include "PixelIterator.h" +#include "Actor.h" + +namespace GameEngine +{ + PixelIterator::PixelIterator(Actor*actor) + { + this->actor = actor; + currentPoint = 0; + lastRowStart = 0; + yPnt = 0; + xIncr = 0; + yIncr = 0; + oldYPnt = 0; + rowMax = 0; + xCnt = 0; + nextRow = 0; + } + + PixelIterator::~PixelIterator() + { + // + } + + void PixelIterator::reset(float x1, float y1, float incrX, float incrY, int w, int h) + { + Animation*lastAnim = actor->getLastAnimation(); + img = lastAnim->getCurrentImage(); + + bool mirror = false; + bool mirrorVertical = false; + + if((lastAnim->mirrored() && !actor->mirrored) || (!lastAnim->mirrored() && actor->mirrored)) + { + mirror = true; + } + if((lastAnim->mirroredVertical() && !actor->mirroredVertical) || (!lastAnim->mirroredVertical() && actor->mirroredVertical)) + { + mirrorVertical = true; + } + + nextRow = img->getWidth(); + rowMax = w; + xCnt = 0; + + if(mirror) + { + x1 = actor->currentImageX + ((actor->currentImageW-1) - x1); + incrX*=-1; + } + else + { + x1 = actor->currentImageX + x1; + } + + if(mirrorVertical) + { + y1 = actor->currentImageY + ((actor->currentImageH-1) - y1); + incrY*=-1; + nextRow*=-1; + } + else + { + y1 = actor->currentImageY + y1; + } + + currentPoint = (img->getWidth()*floor(y1))+x1; + lastRowStart = currentPoint; + xIncr = incrX; + yIncr = incrY; + yPnt = y1; + oldYPnt = y1; + } + + bool PixelIterator::checkNextPixel() + { + if(xCnt>=rowMax) + { + xCnt = 0; + yPnt +=yIncr; + int dif = (int)(yPnt - oldYPnt); + if(dif>0) + { + currentPoint = lastRowStart + (float)(nextRow*dif); + lastRowStart = currentPoint; + oldYPnt = (float)((int)yPnt); + } + else + { + currentPoint = lastRowStart; + } + } + + bool point = img->pixelAtPoint((unsigned int)currentPoint); + + currentPoint+=xIncr; + xCnt++; + + return point; + } + + int PixelIterator::getCurrentPoint() + { + return (int)currentPoint; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/PixelIterator.h b/SmashBros/GameEngine/PixelIterator.h new file mode 100644 index 0000000..3966ea5 --- /dev/null +++ b/SmashBros/GameEngine/PixelIterator.h @@ -0,0 +1,26 @@ + +#include "forwards.h" + +#pragma once + +namespace GameEngine +{ + class PixelIterator + { + private: + Actor*actor; + BufferedImage*img; + float currentPoint, lastRowStart, yPnt, xIncr, yIncr, oldYPnt; + int rowMax, xCnt; + int nextRow; + + public: + PixelIterator(Actor*actor); + virtual ~PixelIterator(); + + void reset(float x1,float y1,float incrX,float incrY,int w,int h); + bool checkNextPixel(); + + int getCurrentPoint(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/PrefManager.cpp b/SmashBros/GameEngine/PrefManager.cpp new file mode 100644 index 0000000..cbc3dd4 --- /dev/null +++ b/SmashBros/GameEngine/PrefManager.cpp @@ -0,0 +1,213 @@ + +#include "PrefManager.h" +#include "GlobalDefs.h" +#include "SDL_rwops.h" +#include "Console.h" + +namespace GameEngine +{ + PrefManager::PrefManager() + { + char*path = getenv("HOME"); + if(path==NULL) + { + Console::WriteLine("Error getting home directory"); + } + else + { + prefPath = path; + prefPath += "/Library/Preferences/"; + } + + } + + PrefManager::~PrefManager() + { + prefs.clear(); + } + + void PrefManager::load(const String&fileName) + { + ArrayList lines; + + SDL_RWops*file = SDL_RWFromFile(prefPath + fileName, "rb"); + if(file==NULL) + { + Console::WriteLine((String)"error opening file " + prefPath + fileName); + return; + } + else + { + SDL_RWseek(file,0,RW_SEEK_END); + int total = SDL_RWtell(file); + SDL_RWseek(file,0,RW_SEEK_SET); + char*fileText = new char[total+1]; + fileText[total] = '\0'; + SDL_RWread(file,fileText,1,total+1); + String currentLine = ""; + for(int i=0; i=0) + { + currentLine+=c; + } + if(c=='\n' || c=='\r' || c=='\0' || ((int)c)<0 || i==(total-1)) + { + if(currentLine.length()>1) + { + lines.add(currentLine); + } + currentLine.clear(); + } + } + delete[] fileText; + } + + for(int i=0; i prefs; + + public: + PrefManager(); + ~PrefManager(); + + void load(const String&fileName); + void save(const String&fileName); + + void addValue(const String&name, const String&value); + void setValue(const String&name, const String&value); + + bool getBooleanValue(const String&name) const; + int getIntValue(const String&name) const; + float getFloatValue(const String&name) const; + long getLongValue(const String&name) const; + double getDoubleValue(const String&name) const; + String getStringValue(const String&name) const; + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/PrimitiveActor.cpp b/SmashBros/GameEngine/PrimitiveActor.cpp new file mode 100755 index 0000000..69621cd --- /dev/null +++ b/SmashBros/GameEngine/PrimitiveActor.cpp @@ -0,0 +1,453 @@ +#include "PrimitiveActor.h" +#include "TextActor.h" +#include "Console.h" + +namespace GameEngine +{ + unsigned char PrimitiveActor::getDir(float x1,float y1,float x2,float y2) //returns the direction of the second set of xy coords based on the first set + { + x2-=x1; + y2-=y1; + + if(y2<0)//second set is above first set + { + if(x2 == 0) + { + return DIR_UP; + } + else + { + double ratLowLeft = .4142135624; + double ratHighLeft = 2.4142135624; + double ratLowRight = -ratLowLeft; + double ratHighRight = -ratHighLeft; + + double difRat = y2/x2; + + if((difRatratHighRight)) + { + return DIR_UPRIGHT; + } + else if((difRat>=ratLowRight) && (difRat<=0)) + { + return DIR_RIGHT; + } + else if((difRat<=ratLowLeft)&&(difRat>=0)) + { + return DIR_LEFT; + } + else if((difRatratLowLeft)) + { + return DIR_UPLEFT; + } + else + { + return DIR_UP; + } + } + } + else if(y2>0) + { + if(x2==0) + { + return DIR_DOWN; + } + else + { + double ratLowRight = .4142135624; + double ratHighRight = 2.4142135624; + double ratLowLeft = -ratLowRight; + double ratHighLeft = -ratHighRight; + + double difRat = y2/x2; + + if((difRat>ratHighLeft)&&(difRat=ratLowLeft)&&(difRat<=0)) + { + return DIR_LEFT; + } + else if((difRat<=ratLowRight)&&(difRat>=0)) + { + return DIR_RIGHT; + } + else if((difRat>ratLowRight)&&(difRat0) + { + return DIR_RIGHT; + } + else + { + return DIR_UP; + } + } + } + + unsigned char PrimitiveActor::getActorType() + { + return actorType; + } + + unsigned char PrimitiveActor::getDir2(float x1,float y1,float x2,float y2) //returns the direction of the second set of xy coords based on the first set + { + double dir=correctDegrees(direction(x1,y1,x2,y2)); + if((dir<=45)||(dir>=315)) + { + return DIR_RIGHT; + } + else if((dir>=45)&&(dir<=135)) + { + return DIR_UP; + } + else if((dir>=135)&&(dir<=225)) + { + return DIR_LEFT; + } + else if((dir>=225)&&(dir<=315)) + { + return DIR_DOWN; + } + Console::WriteLine("Error getDir2(float,float,float,float): invalid arguments for function. Returning 0"); + return 0; + } + + unsigned char PrimitiveActor::getDir(RectangleF& r1, RectangleF& r2) //returns the direction of the second set of xy coords based on the first set + { //directions in this method are based on the corners of the bounding box + float rx2 = (float)((float)r2.x + (float)r2.width/2) - (float)((float)r1.x + (float)r1.width/2); + float ry2 = (float)((float)r2.y + (float)r2.height/2) - (float)((float)r1.y + (float)r1.height/2); + + if(ry2<0) //r2 is above r1 + { + if(rx2 == 0) + { + return DIR_UP; + } + else + { + float ratLeft = (float)(-((float)r1.height/2))/(float)(-((float)r1.width/2)); + float ratRight = (float)(-((float)r1.height/2))/(float)(((float)r1.width/2)); + + float difRat = ry2/rx2; + + if(difRat==ratRight) + { + return DIR_UPRIGHT; + } + else if(difRat==ratLeft) + { + return DIR_UPLEFT; + } + else if((difRat>ratRight)&&(difRat<0)) + { + return DIR_RIGHT; + } + else if((difRat0)) + { + return DIR_LEFT; + } + else + { + return DIR_UP; + } + } + } + else if(ry2>0)//r2 is below r1 + { + if(rx2 == 0) + { + return DIR_DOWN; + } + else + { + float ratLeft = (float)(((float)r1.height/2))/(float)(-((float)r1.width/2)); + float ratRight = (float)(((float)r1.height/2))/(float)(((float)r1.width/2)); + + float difRat = ry2/rx2; + + if(difRat==ratRight) + { + return DIR_DOWNRIGHT; + } + else if(difRat==ratLeft) + { + return DIR_DOWNLEFT; + } + else if((difRat0)) + { + return DIR_RIGHT; + } + else if((difRat>ratLeft)&&(difRat<0)) + { + return DIR_LEFT; + } + else + { + return DIR_DOWN; + } + } + } + else + { + if(rx2<0) + { + return DIR_LEFT; + } + else if(rx2>0) + { + return DIR_RIGHT; + } + else + { + return DIR_UP; + } + } + } + + unsigned char PrimitiveActor::getDir(Rectangle& r1, Rectangle& r2) //returns the direction of the second set of xy coords based on the first set + { //directions in this method are based on the corners of the bounding box + float rx2 = (float)((float)r2.x + (float)r2.width/2) - (float)((float)r1.x + (float)r1.width/2); + float ry2 = (float)((float)r2.y + (float)r2.height/2) - (float)((float)r1.y + (float)r1.height/2); + + if(ry2<0) //r2 is above r1 + { + if(rx2 == 0) + { + return DIR_UP; + } + else + { + float ratLeft = (float)(-((float)r1.height/2))/(float)(-((float)r1.width/2)); + float ratRight = (float)(-((float)r1.height/2))/(float)(((float)r1.width/2)); + + float difRat = ry2/rx2; + + if(difRat==ratRight) + { + return DIR_UPRIGHT; + } + else if(difRat==ratLeft) + { + return DIR_UPLEFT; + } + else if((difRat>ratRight)&&(difRat<0)) + { + return DIR_RIGHT; + } + else if((difRat0)) + { + return DIR_LEFT; + } + else + { + return DIR_UP; + } + } + } + else if(ry2>0)//r2 is below r1 + { + if(rx2 == 0) + { + return DIR_DOWN; + } + else + { + float ratLeft = (float)(((float)r1.height/2))/(float)(-((float)r1.width/2)); + float ratRight = (float)(((float)r1.height/2))/(float)(((float)r1.width/2)); + + float difRat = ry2/rx2; + + if(difRat==ratRight) + { + return DIR_DOWNRIGHT; + } + else if(difRat==ratLeft) + { + return DIR_DOWNLEFT; + } + else if((difRat0)) + { + return DIR_RIGHT; + } + else if((difRat>ratLeft)&&(difRat<0)) + { + return DIR_LEFT; + } + else + { + return DIR_DOWN; + } + } + } + else + { + if(rx2<0) + { + return DIR_LEFT; + } + else if(rx2>0) + { + return DIR_RIGHT; + } + else + { + return DIR_UP; + } + } + } + + unsigned char PrimitiveActor::getDir(PrimitiveActor*a1, PrimitiveActor*a2) //returns the direction of the second set of xy coords based on the first set + { //directions in this method are based on the corners of the bounding box + RectangleF r1; + RectangleF r2; + + if(a1==NULL || a2==NULL) + { + return 0; + } + + PrimitiveActor&actor1 = *a1; + PrimitiveActor&actor2 = *a2; + + switch(actor1.actorType) + { + default: + Console::WriteLine("Error getDir2(): function cannot be run on PrimitiveActor types, returning 0"); + return 0; + + case ACTORTYPE_ACTOR: + r1 = RectangleF(actor1.x - (float)actor1.width/2, actor1.y - (float)actor1.height/2, (float)actor1.width, (float)actor1.height); + break; + + case ACTORTYPE_WIREFRAME: + r1 = RectangleF(actor1.x, actor1.y, (float)actor1.width, (float)actor1.height); + break; + + case ACTORTYPE_TEXT: + { + Rectangle rect = ((TextActor*)a1)->getRect(); + r1 = RectangleF((float)rect.x, (float)rect.y, (float)rect.width, (float)rect.height); + } + break; + } + + switch(actor2.actorType) + { + default: + Console::WriteLine("Error getDir2(): function cannot be run on PrimitiveActor types, returning 0"); + return 0; + + case ACTORTYPE_ACTOR: + r2 = RectangleF(actor2.x - (float)actor2.width/2, actor2.y - (float)actor2.height/2, (float)actor2.width, (float)actor2.height); + break; + + case ACTORTYPE_WIREFRAME: + r2 = RectangleF(actor2.x, actor2.y, (float)actor2.width, (float)actor2.height); + break; + + case ACTORTYPE_TEXT: + { + Rectangle rect = ((TextActor*)a2)->getRect(); + r2 = RectangleF((float)rect.x, (float)rect.y, (float)rect.width, (float)rect.height); + } + break; + } + + return getDir(r1,r2); + } + + double PrimitiveActor::distance(float x1,float y1,float x2,float y2) //returns distance between 2 sets of xy coordinates + { + float x3=x2; + float y3=y1; + float L1=abs(x3-x1); + float L2=abs(y3-y2); + return (double)(sqrt((L1*L1)+(L2*L2))); + } + + double PrimitiveActor::distanceUnSqr(float x1,float y1,float x2,float y2) //does same thing as distance (see above) without square root. + { //returns should be used relative to other returns of this method + float x3=x2; + float y3=y1; + float L1=abs(x3-x1); + float L2=abs(y3-y2); + return (double)((L1*L1)+(L2*L2)); + } + + double PrimitiveActor::direction(double x1, double y1, double x2, double y2) //returns the direction (in degrees) of 1 set of xy coordinates to another + { + double angle = 0.0; + if(x1 != x2 || y1 != y2) + { + if(y1 == y2) + { + if(x2 < x1) + { + angle = 180.0; + } + else + { + angle = 0.0; + } + } + else if(x1 == x2) + { + if(y2 > y1) + { + angle = 270.0; + } + else + { + angle = 90.0; + } + } + else + { + angle = radtodeg(atan2(y1 - y2, x2 - x1)); + if(angle < 0.0) + { + angle = 360.0 + angle; + } + } + } + return angle; + } + + double PrimitiveActor::correctDegrees(double degrees) + { + double newDegrees = degrees; + if(degrees<0) + { + do + { + newDegrees = 360 - abs(newDegrees); + } + while(newDegrees<0); + } + else if(degrees>360) + { + do + { + newDegrees = newDegrees - 360; + } + while(newDegrees>360); + } + return newDegrees; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/PrimitiveActor.h b/SmashBros/GameEngine/PrimitiveActor.h new file mode 100755 index 0000000..3fb3e5d --- /dev/null +++ b/SmashBros/GameEngine/PrimitiveActor.h @@ -0,0 +1,51 @@ + +#include "forwards.h" +#include "GlobalDefs.h" + +#pragma once + +namespace GameEngine +{ + class PrimitiveActor //just made this so that I didn't have to reference a class everytime i wanted to call these methods and variables + { + private: + unsigned char actorType; + friend class Actor; + friend class WireframeActor; + friend class TextActor; + public: + static const unsigned char ACTORTYPE_PRIMITIVE = 0; + static const unsigned char ACTORTYPE_ACTOR = 1; + static const unsigned char ACTORTYPE_WIREFRAME = 2; + static const unsigned char ACTORTYPE_TEXT = 3; + + static const char DIR_UP = 1; + static const char DIR_UPRIGHT = 2; + static const char DIR_RIGHT = 3; + static const char DIR_DOWNRIGHT = 4; + static const char DIR_DOWN = 5; + static const char DIR_DOWNLEFT = 6; + static const char DIR_LEFT = 7; + static const char DIR_UPLEFT = 8; + + float x; + float y; + + int width; + int height; + + unsigned char getActorType(); + + static unsigned char getDir(float x1,float y1,float x2,float y2); + static unsigned char getDir2(float x1,float y1,float x2,float y2); + static unsigned char getDir(Rectangle& r1, Rectangle& r2); + static unsigned char getDir(RectangleF& r1, RectangleF& r2); + static unsigned char getDir(PrimitiveActor*a1, PrimitiveActor*a2); + + static double distance(float x1,float y1,float x2,float y2); + static double distanceUnSqr(float x1,float y1,float x2,float y2); + + static double direction(double x1, double y1, double x2, double y2); + static double correctDegrees(double degrees); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Screen.cpp b/SmashBros/GameEngine/Screen.cpp new file mode 100755 index 0000000..1cd761a --- /dev/null +++ b/SmashBros/GameEngine/Screen.cpp @@ -0,0 +1,39 @@ +#include "Screen.h" + +namespace GameEngine +{ + Screen::Screen(const String&name) + { + this->name = name; + } + + Screen::~Screen() + { + // + } + + void Screen::Initialize() + { + // + } + + void Screen::LoadContent() + { + // + } + + void Screen::UnloadContent() + { + // + } + + void Screen::Update(long gameTime) + { + // + } + + void Screen::Draw(Graphics2D&g, long gameTime) + { + // + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Screen.h b/SmashBros/GameEngine/Screen.h new file mode 100755 index 0000000..0bb1a55 --- /dev/null +++ b/SmashBros/GameEngine/Screen.h @@ -0,0 +1,23 @@ + +#include "String.h" +#include "Graphics2D.h" + +#pragma once + +namespace GameEngine +{ + class Screen + { + private: + String name; + friend class ScreenManager; + public: + Screen(const String&name); + virtual ~Screen(); + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D& g,long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/ScreenManager.cpp b/SmashBros/GameEngine/ScreenManager.cpp new file mode 100755 index 0000000..ff2088b --- /dev/null +++ b/SmashBros/GameEngine/ScreenManager.cpp @@ -0,0 +1,79 @@ +#include "ScreenManager.h" +#include "Console.h" +#include "View.h" + +namespace GameEngine +{ + ArrayList ScreenManager::screens = ArrayList(); + int ScreenManager::totalScreens = 0; + int ScreenManager::currentScreen = -1; + + void ScreenManager::Add(Screen*s) + { + s->Initialize(); + screens.add(s); + totalScreens++; + } + + bool ScreenManager::Remove(String s) + { + for(int i=(totalScreens-1); i>=0; i--) + { + String scr = (screens.get(i))->name; + if(scr.equals(s)) + { + screens.remove(i); + totalScreens--; + if(currentScreen>=i) + { + currentScreen--; + if(totalScreens==0) + { + currentScreen=-1; + } + } + return true; + } + } + Console::WriteLine((String)"Error ScreenManager::Remove(): screen " + s + (String)"does not exist!"); + return false; + } + + bool ScreenManager::GoToScreen(String s) + { + for(int i=0; iname; + if(scr.equals(s)) + { + if(currentScreen!=-1) + { + screens.get(currentScreen)->UnloadContent(); + } + currentScreen = i; + View::x = 0; + View::y = 0; + screens.get(i)->LoadContent(); + return true; + } + } + Console::WriteLine((String)"Error ScreenManager::GoToScreen(): screen " + s + (String)" does not exist!"); + return false; + } + + void ScreenManager::Update(long gameTime) + { + if(currentScreen!=-1) + { + screens.get(currentScreen)->Update(gameTime); + } + } + + void ScreenManager::Draw(Graphics2D& g,long gameTime) + { + if(currentScreen!=-1) + { + screens.get(currentScreen)->Draw(g,gameTime); + } + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/ScreenManager.h b/SmashBros/GameEngine/ScreenManager.h new file mode 100755 index 0000000..c7022d3 --- /dev/null +++ b/SmashBros/GameEngine/ScreenManager.h @@ -0,0 +1,24 @@ + +#include "forwards.h" +#include "Screen.h" +#include "ArrayList.h" + +#pragma once + +namespace GameEngine +{ + class ScreenManager + { + private: + static ArrayList screens; + static int totalScreens; + static int currentScreen; + + public: + static void Add(Screen*scr); + static bool Remove(String s); + static bool GoToScreen(String s); + static void Update(long gameTime); + static void Draw(Graphics2D& g,long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Sound.cpp b/SmashBros/GameEngine/Sound.cpp new file mode 100644 index 0000000..3e6cc78 --- /dev/null +++ b/SmashBros/GameEngine/Sound.cpp @@ -0,0 +1,297 @@ + +#include "Sound.h" +#include "SDL_timer.h" +#include "Console.h" + +namespace GameEngine +{ + Sound::SoundInfo*Sound::sounds = NULL; + int Sound::totalChannels = 0; + + void ChannelFinishHandler(int channel) + { + Sound::SoundInfo info = Sound::sounds[channel]; + if(info.finishing) + { + info.sound->channels[channel] = false; + info.sound->onFinish(channel); + } + else + { + info.sound->channels[channel] = false; + info.finishing = true; + } + } + + void Sound::init() + { + Mix_ChannelFinished(ChannelFinishHandler); + totalChannels = Mix_AllocateChannels(-1); + sounds = new SoundInfo[totalChannels]; + } + + Sound::Sound() + { + sound = NULL; + loaded = false; + channels = new bool[totalChannels]; + for(int i=0; i +#include +#include +#include +#include "Console.h" +#include "stdio.h" +#include + +namespace GameEngine +{ + bool String::asBool(const String&str) + { + bool onlyNums = true; + bool hasNum = false; + bool hasDecimal = false; + + for(int i=0; i='0' && c<='9')) + { + if(c=='.') + { + if(onlyNums && hasDecimal) + { + Console::WriteLine((String)"Error: invalid String in function String::asBool(\"" + str + "\")"); + return false; + } + else if(onlyNums) + { + hasDecimal = true; + } + } + else if(hasNum) + { + Console::WriteLine((String)"Error: invalid String in function String::asBool(\"" + str + "\")"); + return false; + } + else + { + onlyNums = false; + } + } + else + { + hasNum = true; + } + } + + if(onlyNums) + { + if(hasDecimal) + { + double d = asDouble(str); + if(d>=1) + { + return true; + } + else + { + return false; + } + } + else + { + long l = asLong(str); + if(l>=1) + { + return true; + } + else + { + return false; + } + } + } + else if(hasNum) + { + Console::WriteLine((String)"Error: invalid String in function String::asBool(\"" + str + "\")"); + return false; + } + else + { + if(str.equals("true") || str.equals("TRUE") || str.equals("on") || str.equals("ON") || str.equals("yes") || str.equals("YES")) + { + return true; + } + else if(str.equals("false") || str.equals("FALSE") || str.equals("off") || str.equals("OFF") || str.equals("no") || str.equals("NO")) + { + return false; + } + else + { + Console::WriteLine((String)"Error: invalid String in function String::asBool(\"" + str + "\")"); + return false; + } + } + } + + int String::asInt(const String&str) + { + for(int i=0; i='0' && c<='9') || (c=='-' && i==0))) + { + Console::WriteLine((String)"Error: invalid String in function String::asInt(\"" + str + "\")"); + return 0; + } + } + + int mult = 1; + int startIndex = 0; + if(str.charAt(0)=='-') + { + mult = -1; + startIndex = 1; + } + + int counter = 0; + int totalVal = 0; + + for(int i=(str.length()-1); i>=startIndex; i--) + { + char c = str.charAt(i); + int value = (int)(c - '0'); + if(counter==0) + { + totalVal += value; + } + else + { + totalVal += (value*(int)pow((float)10,counter)); + } + counter++; + } + + return totalVal*mult; + } + + long String::asLong(const String&str) + { + for(int i=0; i='0' && c<='9') || (c=='-' && i==0))) + { + Console::WriteLine((String)"Error: invalid String in function String::asLong(\"" + str + "\")"); + return 0; + } + } + + int mult = 1; + int startIndex = 0; + if(str.charAt(0)=='-') + { + mult = -1; + startIndex = 1; + } + + int counter = 0; + long totalVal = 0; + + for(int i=(str.length()-1); i>=startIndex; i--) + { + char c = str.charAt(i); + int value = (int)(c - '0'); + if(counter==0) + { + totalVal += value; + } + else + { + totalVal += ((long)value*(long)pow((long double)10,(int)counter)); + } + counter++; + } + + return totalVal*mult; + } + + float String::asFloat(const String&str) + { + bool hasDecimal = false; + int decimalIndex = str.length(); + + for(int i=0; i='0' && c<='9') || (c=='-' && i==0))) + { + if(c=='.') + { + if(hasDecimal) + { + Console::WriteLine((String)"Error: invalid String in function String::asFloat(\"" + str + "\")"); + return 0; + } + else + { + hasDecimal = true; + decimalIndex = i; + } + } + Console::WriteLine((String)"Error: invalid String in function String::asFloat(\"" + str + "\")"); + return 0; + } + } + + int mult = 1; + int startIndex = 0; + if(str.charAt(0)=='-') + { + mult = -1; + startIndex = 1; + } + + int counter = -1; + float totalVal = 0; + + for(int i=(decimalIndex+1); i=startIndex; i--) + { + char c = str.charAt(i); + int value = (int)(c - '0'); + if(counter==0) + { + totalVal += value; + } + else + { + totalVal += (float)(value*(int)pow((float)10,counter)); + } + counter++; + } + + return totalVal*mult; + } + + double String::asDouble(const String&str) + { + bool hasDecimal = false; + int decimalIndex = str.length(); + + for(int i=0; i='0' && c<='9') || (c=='-' && i==0))) + { + if(c=='.') + { + if(hasDecimal) + { + Console::WriteLine((String)"Error: invalid String in function String::asDouble(\"" + str + "\")"); + return 0; + } + else + { + hasDecimal = true; + decimalIndex = i; + } + } + else + { + Console::WriteLine((String)"Error: invalid String in function String::asDouble(\"" + str + "\")"); + return 0; + } + } + } + + int mult = 1; + int startIndex = 0; + if(str.charAt(0)=='-') + { + mult = -1; + startIndex = 1; + } + + int counter = -1; + double totalVal = 0; + + for(int i=(decimalIndex+1); i=startIndex; i--) + { + char c = str.charAt(i); + int value = (int)(c - '0'); + if(counter==0) + { + totalVal += value; + } + else + { + totalVal += (value*(double)pow((double)10,counter)); + } + counter++; + } + + return totalVal*mult; + } + + std::string String::intToString(const int num) const + { + std::stringstream ss; + ss << num; + std::string s(ss.str()); + return s; + } + + std::string String::uintToString(const unsigned int num) const + { + std::stringstream ss; + ss << num; + std::string s(ss.str()); + return s; + } + + std::string String::floatToString(const float num) const + { + /*std::stringstream ss; + ss.precision(20); + ss << num; + std::string s(ss.str()); + return s;*/ + char buffer[20]; + sprintf(buffer, "%g", (double)num); + return std::string(buffer); + } + + std::string String::doubleToString(const double num) const + { + /*std::stringstream ss; + ss.precision(20); + ss << num; + std::string s(ss.str()); + return s;*/ + char buffer[20]; + sprintf(buffer, "%g", (double)num); + return std::string(buffer); + } + + std::string String::longToString(const long num) const + { + std::stringstream ss; + ss << num; + std::string s(ss.str()); + return s; + } + + String::String() + { + total = 0; + characters = (char*)calloc(1,1); + characters[0] = '\0'; + } + + String::String(const String& str) + { + total = str.length(); + characters = (char*)calloc(total+1,1); + for(int i=0; i=0; i--) + { + if((int)characters[i] != (int)cmp.characters[i]) + { + return false; + } + } + return true; + } + return false; + } + + bool String::equals(const char*cmp) const + { + if(cmp!=NULL) + { + int cmpLength = strlen(cmp); + if(cmpLength==length()) + { + for(int i=0; i=0) + { + char c = charAt(i); + + if(c!=' ') + { + endIndex = i+1; + hitLetter = true; + } + + i--; + } + + return substring(startIndex, endIndex); + } + + int String::indexOf(String str) const + { + int length = str.length(); + if(str.length()>0 && total >= length) + { + std::vector indexes = std::vector(); + int indexTotal = 0; + + char c = str.charAt(0); + + for(int i=0; i0) + { + int endOfThis = total - 1; + for(int i=0; iendOfThis) + { + return -1; + } + else + { + bool correct = true; + int counter = 0; + for(int j=indexes[i]; j + +#pragma once + +namespace GameEngine +{ + class String + { + private: + char*characters; + int total; + + std::string intToString(const int num) const; + std::string uintToString(const unsigned int num) const; + std::string floatToString(const float num) const; + std::string doubleToString(const double num) const; + std::string longToString(const long num) const; + + public: + static bool asBool(const String&str); + static int asInt(const String&str); + static long asLong(const String&str); + static float asFloat(const String&str); + static double asDouble(const String&str); + + String(); + String(const String& str); + String(const std::string&str); + String(const char*str); + String(const wchar_t*str); + String(const std::wstring&str); + String(const char c); + String(const unsigned char num); + String(const bool b); + String(const int num); + String(const unsigned int num); + String(const float num); + String(const double num); + String(const long num); + virtual ~String(); + + operator char*(); + operator const char*(); + operator std::string(); + operator std::wstring(); + operator char*() const; + operator const char*() const; + operator std::string() const; + operator std::wstring() const; + + String operator+(const String& str) const; + String operator+(const std::string& str) const; + String operator+(const char*str) const; + String operator+(const wchar_t*str) const; + String operator+(const std::wstring& str) const; + String operator+(const bool b) const; + String operator+(const char c) const; + String operator+(const unsigned char num) const; + String operator+(const int num) const; + String operator+(const unsigned int num) const; + String operator+(const long num) const; + String operator+(const float num) const; + String operator+(const double num) const; + + String& operator+=(const String& str); + String& operator+=(const std::string& str); + String& operator+=(const char*str); + String& operator+=(const wchar_t*str); + String& operator+=(const std::wstring str); + String& operator+=(const bool b); + String& operator+=(const char c); + String& operator+=(const unsigned char num); + String& operator+=(const int num); + String& operator+=(const unsigned int num); + String& operator+=(const long num); + String& operator+=(const float num); + String& operator+=(const double num); + + String& operator=(const String& str); + String& operator=(const std::string& str); + String& operator=(const char*str); + String& operator=(const wchar_t*str); + String& operator=(const std::wstring& str); + String& operator=(const bool b); + String& operator=(const char c); + String& operator=(const unsigned char num); + String& operator=(const int num); + String& operator=(const unsigned int num); + String& operator=(const long num); + String& operator=(const float num); + String& operator=(const double num); + + bool operator==(String& cmp); + bool operator==(const char*cmp); + + friend std::ostream& operator<<(std::ostream& stream, const String& str); + + bool equals(const String& cmp) const; + bool equals(const char*cmp) const; + + void clear(); + int length() const; + char charAt(int index) const; + String substring(int beginIndex) const; + String substring(int beginIndex, int endIndex) const; + String trim() const; + int indexOf(String str) const; + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/TextActor.cpp b/SmashBros/GameEngine/TextActor.cpp new file mode 100755 index 0000000..73be39c --- /dev/null +++ b/SmashBros/GameEngine/TextActor.cpp @@ -0,0 +1,794 @@ +#include "TextActor.h" +#include "View.h" +#include "Application.h" +#include "Console.h" +#include "ArrayList.h" + +namespace GameEngine +{ + void TextActor::drawString(Graphics2D& g, String text, float x1, float y1) + { + String currentLine = ""; + ArrayList lines = ArrayList(); + + for(int i=0; i=0; i--) + { + String line = lines.get(i); + + int w = 0; + int h = 0; + + this->font->setSize(fontSize); + this->font->setStyle(fontStyle); + TTF_SizeText(this->font->getTTF(), line, &w, &h); + int lineWidth = w; + int offset = 0; + switch(alignment) + { + case ALIGN_BOTTOMLEFT: + case ALIGN_TOPLEFT: + offset = 0; + break; + + case ALIGN_CENTER: + offset = (width - lineWidth)/2; + break; + + case ALIGN_BOTTOMRIGHT: + case ALIGN_TOPRIGHT: + offset = width - lineWidth; + break; + } + g.drawString(line, x1 + offset, currentY); + currentY-=charHeight; + } + + lines.clear(); + } + + void TextActor::updateSize() + { + int tempheight = fontSize; + + int lines = 1; + for( int pos = 0; pos < text.length(); pos++) + { + char c = text.charAt(pos); + if( c == '\r' || c== '\n' ) + { + lines++; + } + } + + charHeight = tempheight; + + height = tempheight*lines; //got the height! + + ArrayList length = ArrayList(); + ArrayList line = ArrayList(); + line.add(""); + length.add(0); + + for( int pos = 0; pos < text.length(); pos++) + { + char c = text.charAt(pos); + if( c == '\r' || c== '\n' ) + { + length.add(0); + line.add(""); + } + else + { + String newS = line.get(line.size()-1); + newS+=c; + line.set(line.size()-1, newS); + int i = length.get(length.size()-1); + i++; + length.set(length.size()-1, i); + } + } + int longest = 0; + if(length.size()>1) + { + for(int i=1; iintlongest) + { + longest = i; + } + } + } + + int w = 0; + int h = 0; + this->font->setSize(fontSize); + this->font->setStyle(fontStyle); + TTF_SizeText(this->font->getTTF(), line.get(longest), &w, &h); + + width = w; + if(line.size()>0 && line.get(longest).length()>0) + { + charWidth = width/line.get(longest).length(); + } + else + { + charWidth = 0; + } + + + line.clear(); + length.clear(); + } + + bool TextActor::checkHover(float x1, float y1) + { + int mousex = 0; + int mousey = 0; + if(relative) + { + mousex = (int)(x1 + View::x); + mousey = (int)(y1 + View::y); + } + else + { + mousex = (int)x1; + mousey = (int)y1; + } + switch(alignment) + { + case ALIGN_BOTTOMLEFT: + if (mousex<(x+width) && mousex>x && mousey(y-height)) + { + return true; + } + break; + + case ALIGN_BOTTOMRIGHT: + if (mousex<(x-width) && mousex>x && mousey(y-height)) + { + return true; + } + break; + + case ALIGN_CENTER: + if (mousex<(x+(width/2)) && mousex>(x-(width/2)) && mousey<(y+(height/2)) && mousey>(y-(height/2))) + { + return true; + } + break; + + case ALIGN_TOPLEFT: + if (mousex<(x+width) && mousex>x && mousey(y+height)) + { + return true; + } + break; + + case ALIGN_TOPRIGHT: + if (mousex<(x-width) && mousex>x && mousey(y+height)) + { + return true; + } + break; + } + return false; + } + + float TextActor::getCenterX() + { + switch(alignment) + { + default: + case ALIGN_BOTTOMLEFT: + return this->x + this->width/2; + + case ALIGN_BOTTOMRIGHT: + return this->x - this->width/2; + + case ALIGN_CENTER: + return this->x; + + case ALIGN_TOPLEFT: + return this->x + this->width/2; + + case ALIGN_TOPRIGHT: + return this->x - this->width/2; + } + } + + float TextActor::getCenterY() + { + switch(alignment) + { + default: + case ALIGN_BOTTOMLEFT: + return this->y - this->height/2; + + case ALIGN_BOTTOMRIGHT: + return this->y - this->height/2; + + case ALIGN_CENTER: + return this->y; + + case ALIGN_TOPLEFT: + return this->y + this->height/2; + + case ALIGN_TOPRIGHT: + return this->y + this->height/2; + } + } + + Rectangle TextActor::getRect() + { + return Rectangle((int)(getCenterX() - width/2), (int)(getCenterY() - height/2), width, height); + } + + void TextActor::drawActor(Graphics2D& g, long gameTime, bool relativeToScreen) + { + unsigned int originalSize = font->getSize(); + int originalStyle = font->getStyle(); + this->font->setSize(fontSize); + this->font->setStyle(fontStyle); + + //g.setComposite((AlphaComposite.getInstance(AlphaComposite.SRC_OVER, Alpha))); + + if(antialiasing) + { + //graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + } + + updateSize(); + + g.setColor(color); + g.setAlpha((unsigned char)(255 - (Alpha*255))); + g.setFont(this->font); + + float x1; + float y1; + if(relativeToScreen) + { + x1 = x - View::x; + y1 = y - View::y; + } + else + { + x1 = x; + y1 = y; + } + + bool onscreen = isOnScreen(); + + if((onscreen && relativeToScreen)||(!relativeToScreen)) + { + switch(alignment) + { + default: + alignment = ALIGN_BOTTOMLEFT; + + case ALIGN_BOTTOMLEFT: + g.rotate((float)Rotation,x1,y1); + drawString(g, text, x1, y1); + break; + + case ALIGN_BOTTOMRIGHT: + g.rotate((float)Rotation,x1-width,y1); + drawString(g, text, x1-width, y1); + break; + + case ALIGN_CENTER: + g.rotate((float)Rotation,x1-(width/2),y1+(height/2)); + drawString(g, text, x1-(width/2), y1+(height/2)); + break; + + case ALIGN_TOPLEFT: + g.rotate((float)Rotation,x1,y1+height); + drawString(g, text, x1, y1+height); + break; + + case ALIGN_TOPRIGHT: + g.rotate((float)Rotation,x1-width,y1+height); + drawString(g, text, x1-width, y1+height); + break; + } + } + + if(showwire && ((onscreen && relativeToScreen)||(!relativeToScreen))) + { + g.setColor(wireframeColor); + switch(alignment) + { + default: + alignment = ALIGN_BOTTOMLEFT; + + case ALIGN_BOTTOMLEFT: + g.drawRect(x1, y1-height, (float)width, (float)height); + break; + + case ALIGN_BOTTOMRIGHT: + g.drawRect(x1-width, y1-height, (float)width, (float)height); + break; + + case ALIGN_CENTER: + g.drawRect(x1-(width/2), y1-(height/2), (float)width, (float)height); + break; + + case ALIGN_TOPLEFT: + g.drawRect(x1, y1, (float)width, (float)height); + break; + + case ALIGN_TOPRIGHT: + g.drawRect(x1-width, y1, (float)width, (float)height); + break; + } + } + + font->setSize(originalSize); + font->setStyle(originalStyle); + + g.setRotation(0,0,0); + g.setAlpha(255); + } + + TextActor::TextActor(String s, Font*f, const Color&c) + { + alignment = ALIGN_BOTTOMLEFT; + text = s; + font = f; + color = c; + x=0; + y=0; + + fontSize = font->getSize(); + fontStyle = font->getStyle(); + + updateSize(); + originalText = text; + actorType = 3; + + wireframeColor = Color::GREEN; + Rotation = 0; + Alpha = 0; + touchId = 0; + currentTouchId = 0; + charWidth = 0; + charHeight = 0; + mouseover = false; + prevMouseover = false; + showwire=false; + clicked = false; + antialiasing = false; + relative = true; + } + + TextActor::TextActor(float x1, float y1,String s, Font*f, const Color&c) + { + alignment = ALIGN_BOTTOMLEFT; + text = s; + font = f; + color = c; + x=x1; + y=y1; + + fontSize = font->getSize(); + fontStyle = font->getStyle(); + + updateSize(); + originalText = text; + actorType = 3; + + wireframeColor = Color::GREEN; + Rotation = 0; + Alpha = 0; + charWidth = 0; + charHeight = 0; + touchId = 0; + currentTouchId = 0; + mouseover = false; + prevMouseover = false; + showwire=false; + clicked = false; + antialiasing = false; + relative = true; + } + + TextActor::~TextActor() + { + // + } + + String TextActor::toString() + { + return originalText; + } + + void TextActor::formatToBox(int width, int height) + { + String newText = ""; + + int currentWidth = 0; + float currentHeight = 0; + + bool spaceInLine = false; + + String currentWord = ""; + + for(int i=0; ifont->setSize(fontSize); + this->font->setStyle(fontStyle); + TTF_SizeText(this->font->getTTF(), newText, &w, &h); + currentWidth = 0; + currentHeight += h; + currentWord = ""; + spaceInLine = false; + if(currentHeight>((float)height)) + { + i = originalText.length(); + } + + } + else + { + if(c==' ') + { + newText+=currentWord + ' '; + currentWidth+=charWidth; + currentWord = ""; + spaceInLine = true; + + if(currentWidth>=width) + { + newText+='\n'; + int w = 0; + int h = 0; + this->font->setSize(fontSize); + this->font->setStyle(fontStyle); + TTF_SizeText(this->font->getTTF(), newText, &w, &h); + currentWidth = 0; + currentHeight += h; + spaceInLine = false; + if(currentHeight>height) + { + i = originalText.length(); + } + + } + } + else + { + currentWord+=c; + currentWidth+=charWidth; + + if(currentWidth>=width) + { + if(spaceInLine) + { + newText+='\n'; + int w = 0; + int h = 0; + this->font->setSize(fontSize); + this->font->setStyle(fontStyle); + TTF_SizeText(this->font->getTTF(), newText, &w, &h); + currentHeight += h; + TTF_SizeText(this->font->getTTF(), currentWord, &w, &h); + currentWidth = w; + spaceInLine = false; + + if(currentHeight>height) + { + i = originalText.length(); + } + } + } + } + } + } + + newText+=currentWord; + + text = newText; + updateSize(); + } + + void TextActor::Update(long gameTime) + { + prevclicked = clicked; + + long prevTouchId = currentTouchId; + + bool onmouseenter = false; + bool onmouseleave = false; + bool onclick = false; + bool onrelease = false; + + if(mouseOver()) + { + bool prevMouseOver = mouseover; + if(!mouseover) + { + mouseover=true; + onmouseenter = true; + } + if(!prevMouseOver && !Application::checkPrevTouchActive(touchId)) + { + clicked = true; + onclick = true; + } + } + else if(mouseover) + { + mouseover=false; + onmouseleave = true; + } + if(clicked && prevMouseover && !Application::checkTouchActive(prevTouchId)) + { + clicked = false; + onrelease = true; + } + + if(prevclicked && !Application::checkTouchActive(currentTouchId)) + { + clicked = false; + } + + prevMouseover = mouseover; + currentTouchId = touchId; + + if(onmouseenter) + { + onMouseEnter(); + } + if(onclick) + { + onClick(); + } + if(onmouseleave) + { + onMouseLeave(); + } + if(onrelease) + { + onRelease(); + } + } + + void TextActor::Draw(Graphics2D& g, long gameTime) + { + drawActor(g,gameTime,relative); + } + + bool TextActor::isOnScreen() + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + Rectangle rect = getRect(); + + left1 = (int)rect.x; + left2 = (int)View::x; + right1 = (int)rect.x+rect.width; + right2 = (int)View::x+(View::ScaleWidth()); + top1 = (int)rect.y; + top2 = (int)View::y; + bottom1 = (int)rect.y+rect.height; + bottom2 = (int)View::y+(View::ScaleHeight()); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + void TextActor::showWireframe(bool toggle) + { + showwire = toggle; + } + + void TextActor::setWireframeColor(const Color&c) + { + wireframeColor = c; + } + + void TextActor::setText(String s) + { + text = s; + originalText = text; + updateSize(); + } + + String TextActor::getText() + { + return text; + } + + void TextActor::setFont(Font*f) + { + font = f; + updateSize(); + } + + Font*TextActor::getFont() + { + return font; + } + + void TextActor::setSize(unsigned int size) + { + fontSize = size; + updateSize(); + } + + int TextActor::getSize() + { + return fontSize; + } + + void TextActor::setStyle(int style) + { + fontStyle = style; + } + + void TextActor::setColor(const Color&c) + { + color = c; + } + + Color TextActor::getColor() + { + return color; + } + + void TextActor::setAlignment(unsigned char align) + { + if(align<=4) + { + alignment = align; + } + else + { + Console::WriteLine((String)"Error: Invalid argument " + align + (String)" for method setAlignment(unsigned char)"); + } + } + + unsigned char TextActor::getAlignment() + { + return alignment; + } + + void TextActor::relativeToView(bool toggle) + { + relative = toggle; + } + + void TextActor::onMouseEnter() //When mouse enters Actor + { + //Open for implementation + } + + void TextActor::onMouseLeave() //When mouse enters Actor + { + //Open for implementation + } + + void TextActor::onClick() //When Actor is clicked + { + //Open for implementation + } + + void TextActor::onRelease() //When Actor's click is released + { + //Open for implementation + } + + bool TextActor::mouseOver() + { + if(mouseover) + { + if(Application::checkTouchActive(currentTouchId)) + { + if(checkHover(Application::TouchX(currentTouchId), Application::TouchY(currentTouchId))) + { + return true; + } + } + } + ArrayList points = Application::getTouchPoints(); + for(int i=0; irun(); + thread->alive = false; + return 0; + } + + Thread::Thread() + { + alive = false; + thread = NULL; + } + + Thread::~Thread() + { + if(thread!=NULL) + { + SDL_WaitThread(thread, NULL); + thread = NULL; + } + } + + void Thread::run() + { + //Open for implementation + } + + void Thread::start() + { + if(!alive) + { + if(thread!=NULL) + { + SDL_WaitThread(thread, NULL); + thread = NULL; + } + + alive = true; + + thread = SDL_CreateThread(ThreadHandler, "GameEngine::Thread", this); + } + } + + void Thread::join() + { + if(alive) + { + SDL_WaitThread(thread, NULL); + thread = NULL; + } + } + + void Thread::sleep(long millis) + { + SDL_Delay(millis); + } + + bool Thread::isAlive() + { + return alive; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Thread.h b/SmashBros/GameEngine/Thread.h new file mode 100644 index 0000000..eca3cc1 --- /dev/null +++ b/SmashBros/GameEngine/Thread.h @@ -0,0 +1,28 @@ + +#include "SDL_thread.h" + +#pragma once + +namespace GameEngine +{ + class Thread + { + friend int ThreadHandler(void*); + private: + SDL_Thread*thread; + bool alive; + + public: + Thread(); + virtual ~Thread(); + + virtual void run(); + + void start(); + void join(); + + bool isAlive(); + + static void sleep(long millis); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/TouchPoint.h b/SmashBros/GameEngine/TouchPoint.h new file mode 100644 index 0000000..0c035f6 --- /dev/null +++ b/SmashBros/GameEngine/TouchPoint.h @@ -0,0 +1,20 @@ + +#pragma once + +namespace GameEngine +{ + typedef struct + { + float x,y; + long ID; + } TouchPoint; + + static TouchPoint createTouchPoint(long ID, float x, float y) + { + TouchPoint point; + point.ID = ID; + point.x = x; + point.y = y; + return point; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/Vector2.h b/SmashBros/GameEngine/Vector2.h new file mode 100644 index 0000000..057d940 --- /dev/null +++ b/SmashBros/GameEngine/Vector2.h @@ -0,0 +1,66 @@ + +#include "forwards.h" + +#pragma once + +namespace GameEngine +{ + template + class Vector2 + { + public: + T x,y; + + Vector2() : x(), y() + { + // + } + + Vector2(T X, T Y) + { + x = X; + y = Y; + } + + Vector2(const Vector2&vect) + { + x = vect.x; + y = vect.y; + } + + void operator=(const Vector2&vect) + { + x = vect.x; + y = vect.y; + } + + Vector2 operator+(const Vector2&vect) + { + return Vector2(x+vect.x, y+vect.y); + } + + Vector2 operator-(const Vector2&vect) + { + return Vector2(x-vect.x, y-vect.y); + } + + Vector2&operator+=(const Vector2&vect) + { + x += vect.x; + y += vect.y; + return *this; + } + + Vector2&operator-=(const Vector2&vect) + { + x -= vect.x; + y -= vect.y; + return *this; + } + }; + + typedef Vector2 Vector2i; + typedef Vector2 Vector2f; + typedef Vector2 Vector2d; + typedef Vector2 Vector2u; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/View.cpp b/SmashBros/GameEngine/View.cpp new file mode 100644 index 0000000..b0cf2cc --- /dev/null +++ b/SmashBros/GameEngine/View.cpp @@ -0,0 +1,120 @@ + +#include "View.h" +#include "Application.h" +#include "Console.h" +#include + +namespace GameEngine +{ + float View::x = 0; + float View::y = 0; + + float View::Zoom = 1.0; + + int View::windowWidth = 480; + int View::windowHeight = 320; + + int View::scaleWidth = 480; + int View::scaleHeight = 320; + + float View::multScale = 1; + float View::letterBoxW = 0; + float View::letterBoxH = 0; + + void View::setScaleSize(int w, int h) + { + scaleWidth=w; + scaleHeight=h; + } + + int View::Width() + { + return windowWidth; + } + + int View::Height() + { + return windowHeight; + } + + int View::ScaleWidth() + { + return scaleWidth; + } + + int View::ScaleHeight() + { + return scaleHeight; + } + + void View::Update(Graphics2D&g) + { + multScale = 1; + if(Application::scalescreen) + { + float ratX = (float)windowWidth/(float)scaleWidth; + float ratY = (float)windowHeight/(float)scaleHeight; + if(ratX0) + { + g.fillRect(0,0,letterBoxW,(float)windowHeight); + g.fillRect((((float)windowWidth)-letterBoxW),0,letterBoxW,(float)windowHeight); + } + if(letterBoxH>0) + { + g.fillRect(0,0,(float)windowWidth,letterBoxH); + g.fillRect(0,((float)windowHeight-letterBoxH),(float)windowWidth,letterBoxH); + } + + if(Application::showfps) + { + g.setColor(Color::BLACK); + g.drawString((String)Application::realFPS + (String)" fps", (letterBoxW+(30*multScale)), (letterBoxH+(50*multScale))); + } + } + else + { + if(Application::showfps) + { + g.setColor(Color::BLACK); + g.drawString((String)Application::realFPS + (String)" fps", 30, 50); + } + } + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/View.h b/SmashBros/GameEngine/View.h new file mode 100644 index 0000000..db7d6b6 --- /dev/null +++ b/SmashBros/GameEngine/View.h @@ -0,0 +1,40 @@ + +#include "forwards.h" +#include "Graphics2D.h" + +#pragma once + +namespace GameEngine +{ + class View + { + private: + friend class Application; + + static int windowWidth; + static int windowHeight; + + static int scaleWidth; + static int scaleHeight; + + static float multScale; + static float letterBoxW; + static float letterBoxH; + + public: + static float x; + static float y; + + static float Zoom; + + static void setScaleSize(int w, int h); + + static int Width(); + static int Height(); + static int ScaleWidth(); + static int ScaleHeight(); + + static void Update(Graphics2D& g); + static void Draw(Graphics2D& g); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/WireframeActor.cpp b/SmashBros/GameEngine/WireframeActor.cpp new file mode 100755 index 0000000..e987608 --- /dev/null +++ b/SmashBros/GameEngine/WireframeActor.cpp @@ -0,0 +1,599 @@ +#include "WireframeActor.h" +#include "Actor.h" +#include "Application.h" +#include "View.h" +#include "Console.h" + +namespace GameEngine +{ + bool WireframeActor::checkHover(float x1, float y1) + { + float mousex = 0; + float mousey = 0; + if(relative) + { + mousex = ((float)x1 + View::x); + mousey = ((float)y1 + View::y); + } + else + { + mousex = x1; + mousey = y1; + } + if(mousex>x && mousex<(x+width) && mousey>y && mouseyx - ((float)a2->width/2)); + r1.y = (int)(a2->y - ((float)a2->height/2)); + r1.width = a2->width; + r1.height = a2->height; + Rectangle r2; + r2.x = (int)x; + r2.y = (int)y; + r2.width = width; + r2.height = height; + + Rect overlap; + + if(rectsColliding(a2)) + { + if(r1.x <= r2.x) + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.left = r2.x - r1.x; + overlap.right = r1.width; + } + else + { + overlap.left = r2.x - r1.x; + overlap.right = overlap.left + r2.width; + } + } + else + { + if((r1.x + r1.width) <= (r2.x + r2.width)) + { + overlap.left = 0; + overlap.right = r1.width; + } + else + { + overlap.left = 0; + overlap.right = (r2.x + r2.width) - r1.x; + } + } + + if(r1.y <= r2.y) + { + if((r1.y + r1.height) <= (r2.y + r2.height)) + { + overlap.top = r2.y - r1.y; + overlap.bottom = r1.height; + } + else + { + overlap.top = r2.y - r1.y; + overlap.bottom = overlap.top + r2.height; + } + } + else + { + if((r1.y + r1.height)<= (r2.y + r2.height)) + { + overlap.top = 0; + overlap.bottom = r1.height; + } + else + { + overlap.top = 0; + overlap.bottom = (r2.y + r2.height) - r1.y; + } + } + } + else + { + overlap.left = -1; + overlap.top = -1; + overlap.right = -1; + overlap.bottom = -1; + } + return overlap; + } + + bool WireframeActor::isColliding(Actor*collide) + { + Rect collideOverlap = getCollideOverlapArea(collide); + + if(collideOverlap.left != -1) + { + + int w = collideOverlap.right - collideOverlap.left; + int h = collideOverlap.bottom - collideOverlap.top; + + float x1 = ((float)collideOverlap.left/collide->Scale); + float y1 = ((float)collideOverlap.top/collide->Scale); + + float incr1 = (float)(1/collide->Scale); + + float pntX1 = x1; + float pntY1 = y1; + + for(int cntY = 0; cntYpixelAtPoint((int)(pntX1),(int)(pntY1))) + { + return true; + } + pntX1+=incr1; + } + pntY1+=incr1; + } + return false; + } + return false; + } + + bool WireframeActor::rectsColliding(WireframeActor*collide) //checks if bounding boxes are colliding + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + left1 = (int)x; + left2 = (int)collide->x; + right1 = (int)x+width; + right2 = (int)collide->x + collide->width; + top1 = (int)y; + top2 = (int)collide->y; + bottom1 = (int)y+height; + bottom2 = (int)collide->y + collide->height; + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + bool WireframeActor::rectsColliding(Actor*collide) //checks if bounding boxes are colliding + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + left1 = (int)x; + left2 = (int)collide->x-(collide->width/2); + right1 = (int)x+width; + right2 = (int)collide->x+(collide->width/2); + top1 = (int)y; + top2 = (int)collide->y-(collide->height/2); + bottom1 = (int)y+height; + bottom2 = (int)collide->y+(collide->height/2); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + bool WireframeActor::circlesColliding(WireframeActor*collide) //checks if "bounding circles" are colliding + { + double r1 = distanceUnSqr(x,y,x+(width/2),y+(height/2)); + double r2 = distanceUnSqr(collide->x,collide->y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + double dist = r1+r2; + double realDist = distanceUnSqr(x+(width/2),y+(height/2),collide->x+(collide->width/2),collide->y+(collide->height/2)); + if(realDistx,collide->y,collide->x-(collide->width/2),collide->y-(collide->height/2)); + double dist = r1+r2; + double realDist = distanceUnSqr(x+(width/2),y+(height/2),collide->x,collide->y); + if(realDistx,collide->y,collide->x+(collide->width/2),collide->y+(collide->height/2)); + double dist = (r1+r2)*mult; + double realDist = mult*distanceUnSqr(x+(width/2),y+(height/2),collide->x+(collide->width/2),collide->y+(collide->height/2)); + if(realDistx,collide->y,collide->x-(collide->width/2),collide->y-(collide->height/2)); + double dist = (r1+r2)*mult; + double realDist = mult*distanceUnSqr(x+(width/2),y+(height/2),collide->x,collide->y); + if(realDisttotalEvents) + { + Console::WriteLine((String)"Error: EventEnabled(unsigned char). Invalid argument " + eventCode + (String)". Event does not exist"); + return false; + } + else + { + return enabledEvents[eventCode]; + } + } + + void WireframeActor::eventEnable(unsigned char eventCode) + { + if(eventCode>totalEvents) + { + Console::WriteLine((String)"Error: EventEnable(unsigned char). Invalid argument " + eventCode + (String)". Event does not exist"); + } + else + { + enabledEvents[eventCode]=true; + } + } + + void WireframeActor::eventDisable(unsigned char eventCode) + { + if(eventCode>totalEvents) + { + Console::WriteLine((String)"Error: EventDisable(unsigned char). Invalid argument " + eventCode + (String)". Event does not exist"); + } + else + { + enabledEvents[eventCode]=false; + } + } + + void WireframeActor::onMouseEnter() //When mouse enters Actor + { + //Open for implementation + } + + void WireframeActor::onMouseLeave() //When mouse enters Actor + { + //Open for implementation + } + + void WireframeActor::onClick() //when Actor is clicked + { + //Open for implementation + } + + void WireframeActor::onRelease() //When Actor's click is released + { + //Open for implementation + } + + bool WireframeActor::mouseOver() + { + if(mouseover) + { + if(Application::checkTouchActive(currentTouchId)) + { + if(checkHover(Application::TouchX(currentTouchId), Application::TouchY(currentTouchId))) + { + return true; + } + } + } + ArrayList points = Application::getTouchPoints(); + for(int i=0; i bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + float WireframeActor::getXSpeed() + { + return xSpeed; + } + + float WireframeActor::getYSpeed() + { + return ySpeed; + } +} \ No newline at end of file diff --git a/SmashBros/GameEngine/WireframeActor.h b/SmashBros/GameEngine/WireframeActor.h new file mode 100755 index 0000000..8d493b1 --- /dev/null +++ b/SmashBros/GameEngine/WireframeActor.h @@ -0,0 +1,83 @@ + +#include "forwards.h" +#include "PrimitiveActor.h" +#include "Graphics2D.h" + +#pragma once + +namespace GameEngine +{ + class WireframeActor : public PrimitiveActor + { + private: + static const int totalEvents = 8; + bool enabledEvents[8]; + bool clicked,prevclicked; + bool visible; + bool filled; + Color color; + bool mouseover; + bool relative; + bool prevMouseover; + long touchId; + long currentTouchId; + float xSpeed,ySpeed; + Rect getCollideOverlapArea(Actor*a2); + + bool checkHover(float x1, float y1); + + protected: + void drawActor(Graphics2D& g,long gameTime,float x1, float y1,double scale); + + public: + static const unsigned char EVENT_MOUSECLICK = 0; + static const unsigned char EVENT_MOUSERELEASE = 1; + static const unsigned char EVENT_MOUSEENTER = 2; + static const unsigned char EVENT_MOUSELEAVE = 3; + + float xprev, yprev; + float xvelocity,yvelocity; + + virtual ~WireframeActor(); + WireframeActor(float x1=0, float y1=0, int w=1, int h=1); + + void setVisible(bool toggle); + void setFilled(bool toggle); + + void setColor(const Color&c); + Color getColor(); + + bool isColliding(Actor*collide); + bool rectsColliding(WireframeActor*collide); + bool rectsColliding(Actor*collide); + bool circlesColliding(WireframeActor*collide); + bool circlesColliding(Actor*collide); + bool circlesColliding(WireframeActor*collide, double mult); + bool circlesColliding(Actor*collide, double mult); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D& g,long gameTime); + + bool eventEnabled(unsigned char eventCode); + void eventEnable(unsigned char eventCode); + void eventDisable(unsigned char eventCode); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onClick(); + virtual void onRelease(); + + void relativeToView(bool toggle); + bool mouseOver(); + + bool isClicked(); + bool wasClicked(); + + long getTouchId(); + + bool isOnScreen(); + + float getXSpeed(); + float getYSpeed(); + }; +} \ No newline at end of file diff --git a/SmashBros/GameEngine/forwards.h b/SmashBros/GameEngine/forwards.h new file mode 100755 index 0000000..0be9582 --- /dev/null +++ b/SmashBros/GameEngine/forwards.h @@ -0,0 +1,22 @@ + +#pragma once + +namespace GameEngine +{ + class Actor; + class Animation; + class AnimationManager; + class Application; + class BufferedImage; + class Font; + class Graphics2D; + class Image; + class LoadThread; + class PixelIterator; + class PrimitiveActor; + class Screen; + class MenuScreen; + class TextActor; + class View; + class WireframeActor; +} \ No newline at end of file diff --git a/SmashBros/GameScreen.cpp b/SmashBros/GameScreen.cpp new file mode 100755 index 0000000..1d1d125 --- /dev/null +++ b/SmashBros/GameScreen.cpp @@ -0,0 +1,160 @@ +#include "GameScreen.h" +#include "Global.h" +#include "Camera.h" +#include "Controls.h" +#include "Preferences.h" +#include "Menus.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + GameScreen::GameScreen(const String&name) : Screen(name) + { + prevEnterPressed = false; + firstUpdate = true; + sendFrame = true; + } + + GameScreen::~GameScreen() + { + delete Global::hud; + Global::hud = null; + } + + void GameScreen::Initialize() + { + // + } + + void GameScreen::LoadContent() + { + Global::createHUD(); + Game::showBackground(false); + Camera::Update(); + sendFrame = true; + if(Preferences::ingameMusicOn()) + { + MusicManager::play(); + } + P2PDataManager::lastRecieveTime = 0; + } + + void GameScreen::UnloadContent() + { + MusicManager::stop(); + } + + void GameScreen::Update(long gameTime) + { + if(P2PDataManager::isEnabled() && P2PDataManager::isServer()) + { + P2PDataManager::updateGame(gameTime); + if(P2PDataManager::errorstate) + { + P2PDataManager::errorstate = false; + //P2PDataManager::dataQueue.clear(); + //Global::UnloadGame(); + //ScreenManager::GoToScreen("BrawlCharSelect"); + //ScreenManager::GoToScreen("BluetoothMenu"); + P2PManager::endSession(); + return; + } + } + if((P2PDataManager::isEnabled() && (P2PDataManager::isServer() || (!P2PDataManager::isServer() && firstUpdate))) + || !P2PDataManager::isEnabled()) + { + Global::Update(gameTime); + + if(Global::currentStage!=null) + { + Global::currentStage->Update(gameTime); + } + if(Global::currentStage!=null) + { + Camera::Update(); + } + if(Global::hud!=null) + { + Global::hud->Update(gameTime); + } + if(Global::gamePlaying) + { + Controls::Update(gameTime); + } + } + else if(P2PDataManager::isEnabled() && !P2PDataManager::isServer()) + { + if(Global::gamePlaying) + { + Controls::Update(gameTime); + } + } + firstUpdate = false; + } + + void GameScreen::Draw(Graphics2D&g, long gameTime) + { + if(P2PDataManager::isEnabled()) + { + if(P2PDataManager::isServer()) + { + if(Preferences::highFPS()) + { + if(sendFrame) + { + P2PDataManager::sendGameData(); + sendFrame = false; + } + else + { + sendFrame = true; + } + } + else + { + P2PDataManager::sendGameData(); + } + } + else + { + P2PDataManager::updateGame(gameTime); + if(P2PDataManager::errorstate) + { + P2PDataManager::errorstate = false; + //P2PDataManager::dataQueue.clear(); + //Global::UnloadGame(); + //ScreenManager::GoToScreen("BrawlCharSelect"); + //ScreenManager::GoToScreen("BluetoothMenu"); + P2PManager::endSession(); + return; + } + } + } + if(Global::currentStage!=null) + { + if(Game::KeyPressed(Keys::ENTER) && !prevEnterPressed) + { + if(Game::Suspended()) + { + Console::WriteLine("resumed"); + Game::Resume(); + } + else if(Global::gamePlaying) + { + Console::WriteLine("paused"); + Game::Suspend(); + } + prevEnterPressed = true; + } + else if(!Game::KeyPressed(Keys::ENTER)) + { + prevEnterPressed = false; + } + Global::currentStage->Draw(g, gameTime); + if(Global::hud!=null) + { + Global::hud->Draw(g, gameTime); + } + } + } +} \ No newline at end of file diff --git a/SmashBros/GameScreen.h b/SmashBros/GameScreen.h new file mode 100755 index 0000000..222de8a --- /dev/null +++ b/SmashBros/GameScreen.h @@ -0,0 +1,24 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class GameScreen : public Screen + { + private: + boolean prevEnterPressed; + boolean firstUpdate; + boolean sendFrame; + + public: + GameScreen(const String&name); + virtual ~GameScreen(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/Global.cpp b/SmashBros/Global.cpp new file mode 100755 index 0000000..6cc68ab --- /dev/null +++ b/SmashBros/Global.cpp @@ -0,0 +1,1276 @@ +#include "Global.h" +#include "ProjectileManager.h" +#include "ItemManager.h" +#include "Camera.h" +#include "Controls.h" +#include "P2PDataManager.h" + +#include "Mario.h" +#include "Sonic.h" +#include "Ichigo.h" +#include "Fox.h" + +#include "FractalStage.h" +#include "HillsideBattleground.h" +#include "BattlefieldBrawl.h" +#include "FinalDestinationBrawl.h" +#include "HyruleTemple.h" + +namespace SmashBros +{ + long Global::worldTime = 0; + + int*Global::players = new int[possPlayers+1]; + + Player**Global::characters = new Player*[possPlayers+1]; + byte*Global::currentTeams = new byte[possPlayers+1]; + int*Global::scores = new int[possPlayers+1]; + int*Global::KOs = new int[possPlayers+1]; + int*Global::deaths = new int[possPlayers+1]; + int*Global::winners = new int[possPlayers+1]; + int*Global::teamWinners = new int[possTeams+1]; + Stage*Global::currentStage = null; + + HUD*Global::hud = null; + + int Global::charAmount = 0; + + int*Global::selectedChar = new int[possPlayers]; + int Global::selectedStage = 0; + + boolean Global::gamePlaying = false; + boolean Global::gameFinished = false; + + boolean Global::suddenDeath = false; + ArrayList Global::suddenDeathPlayers = ArrayList(); + + boolean Global::smashBallOnField = false; + boolean Global::playerHasSmashBall = false; + + boolean*Global::CPU = new boolean[possPlayers]; + int Global::timeLimit = 2; + int Global::stockAmount = 3; + int Global::gameMode = 1; + int Global::gameType = 0; + boolean Global::teamBattle = false; + long Global::timeAmount = 0; + + boolean*Global::itemsOn = new boolean[30]; + ArrayList Global::itemsActive = ArrayList(); + + int Global::maxLives = 20; + int Global::minLives = 1; + + int Global::maxTime = 45; + int Global::minTime = 1; + + ArrayList Global::stageVotes = ArrayList(); + boolean Global::selfReadyToPlay = false; + boolean Global::peerReadyToPlay = false; + boolean Global::peerLoaded = false; + boolean Global::selfLoaded = false; + String Global::P2PMessage = "Waiting for Peer...\n"; + + void Global::init() + { + for(int i=0; icharNo); + } + + boolean Global::isInSuddenDeath(byte playerNo) + { + for(int i=0; ilastHit == 0) + { + scores[pNum]-=1; + Console::WriteLine((String)"scores[" + pNum + "]-=1"); + hud->showScore(pNum, -1); + } + else + { + scores[pNum]-=1; + scores[playr->lastHit]+=1; + Console::WriteLine((String)"scores[" + pNum + "]-=1 scores[" + playr->lastHit + "]+1"); + hud->showScore(pNum, -1); + hud->showScore(playr->lastHit, 1); + } + for(int i=0; i<=possPlayers; i++) + { + Console::Write((String)"scores[" + i + "]=" + scores[i] + ", "); + } + Console::WriteLine(""); + } + + void Global::finishBrawl() + { + if(P2PDataManager::isEnabled() && P2PDataManager::isServer()) + { + DataVoid data; + + byte type = P2PDataManager::DATA_READYGO; + data.add(&type, sizeof(type)); + + type = P2PDataManager::READYGO_GAME; + data.add(&type, sizeof(type)); + + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + + if(Global::suddenDeath) + { + for(byte i=0; i<=Global::possPlayers; i++) //TODO: loop characters + { + if(Global::characters[i]!=null) + { + boolean inSuddenDeath = Global::isInSuddenDeath(i); + if(inSuddenDeath) + { + if(P2PDataManager::isEnabled()) + { + if(P2PDataManager::isServer()) + { + Global::characters[i]->respawn(); + } + } + else + { + Global::characters[i]->respawn(); + } + Global::characters[i]->percent = 300; + ItemManager::RemoveAll(); + hud->firstUpdate = true; + ScreenManager::GoToScreen("Game"); + + } + else + { + Global::characters[i]->reset(); + Global::characters[i]->alive = false; + } + } + } + } + else + { + Global::UnloadGame(); + //TODO: add game types + switch(Global::gameType) + { + case Global::TYPE_GROUPBRAWL: + ScreenManager::GoToScreen("Winners"); + break; + } + } + } + + void Global::UnloadGame() + { + for(byte i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + characters[i]->Unload(); + delete characters[i]; + characters[i] = null; + } + } + + hud->Unload(); + + ProjectileManager::RemoveAll(); + ItemManager::Unload(); + + currentStage->Unload(); + delete currentStage; + currentStage = null; + ItemManager::RemoveAll(); + Global::gameFinished = true; + Global::gamePlaying = false; + } + + void Global::createHUD() + { + hud = new HUD(); + } + + void Global::LoadGame() + { + Console::WriteLine("calling function LoadGame()"); + + Controls::enableTouchControls(true); + + for(int i=0; i<=Global::possPlayers; i++) + { + Global::characters[i] = null; + } + + Camera::reset(); + + ProjectileManager::destroyedProjectiles.clear(); + ItemManager::destroyedItems.clear(); + + gamePlaying = false; + + for(int i=0; i0) + { + counter++; + players[counter]=i+1; + } + } + + charAmount=counter; + timeAmount = timeLimit*60; + + Console::WriteLine("finished storing in array players[]"); + + for(int i=0; i<=possPlayers; i++) + { + scores[i]=0; + winners[i]=0; + teamWinners[i]=0; + KOs[i]=0; + deaths[i]=0; + } + + itemsActive.clear(); + + Global::playerHasSmashBall = false; + Global::smashBallOnField = false; + + for(int i=0; iaiType = Player::AI_STOP; + } + } + } + + void Global::createPlayers() + { + for(int i=0; igetSpawnPoint(players[i+1]); + byte teamNo = 0; + if(teamBattle) + { + teamNo = currentTeams[i+1]; + } + characters[players[i+1]]=createPlayer((float)pnt.x,(float)pnt.y,(byte)players[i+1],teamNo,selectedChar[players[i+1]-1]); + } + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + characters[i]->whenCreated(); + } + } + } + + Player*Global::createPlayer(float x1, float y1, byte playerNo, byte team,int charNum) + { + Player*p = null; + Console::WriteLine((String)"creating character " + charNum); + switch(charNum) + { + case CHAR_MARIO: + p = new Mario(x1,y1,playerNo,team); + p->charNo = CHAR_MARIO; + break; + + case CHAR_ICHIGO: + p = new Ichigo(x1,y1,playerNo,team); + p->charNo = CHAR_ICHIGO; + break; + + case CHAR_SONIC: + p = new Sonic(x1,y1,playerNo,team); + p->charNo = CHAR_SONIC; + break; + + case CHAR_FOX: + p = new Fox(x1,y1,playerNo,team); + p->charNo = CHAR_FOX; + break; + } + return p; + } + + Stage*Global::createStage(int x1, int y1, int stageNum) + { + switch(stageNum) + { + case STAGE_FRACTALSTAGE: + return new FractalStage(x1,y1); + + case STAGE_HILLSIDEBATTLEGROUND: + return new HillsideBattleground(x1,y1); + + case STAGE_HYRULETEMPLE: + return new HyruleTemple(x1,y1); + + case STAGE_BATTLEFIELDBRAWL: + return new BattlefieldBrawl(x1,y1); + + case STAGE_FINALDESTINATION: + return new FinalDestinationBrawl(x1,y1); + break; + } + return null; + } + + Player*Global::getPlayerActor(int pNum) + { + return characters[pNum]; + } + + String Global::getItemName(int itemNo) + { + switch(itemNo) //TODO: add items + { + default: + return "Unknown"; + + case ITEM_SMASHBALL: + return "SmashBall"; + + case ITEM_SUPERMUSHROOM: + return "Super Mushroom"; + + case ITEM_POISONMUSHROOM: + return "Poison Mushroom"; + + case ITEM_RAYGUN: + return "Ray Gun"; + + case ITEM_HEARTCONTAINER: + return "Heart Container"; + + case ITEM_BEAMSWORD: + return "Beam Sword"; + } + } + + boolean Global::checkWinners(byte pNum) + { + if(gamePlaying) + { + if(suddenDeath) + { + return checkWinnersSuddenDeath(pNum); + } + else + { + if(teamBattle) + { + ArrayList > teams = ArrayList >(); + + for(int i=0; i<=possTeams; i++) + { + teams.add(ArrayList()); + } + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + int t = characters[i]->team; + + teams.get(t).add(i); + } + } + + int totalTeams = 0; + + ArrayList aliveTeams = ArrayList(); + + for(int i=0; i0) + { + totalTeams++; + for(int j=0; jstock > 0) + { + totalAlive++; + } + } + if(totalAlive>0) + { + aliveTeams.add(i); + } + } + } + + byte team = characters[pNum]->team; + + int total = teams.get(team).size(); + + int totalAlive = 0; + + for(int i=0; istock > 0) + { + totalAlive++; + } + } + + if(totalAlive == 0) + { + for(int i=totalTeams; i>=1; i--) + { + if(teamWinners[i]==0) + { + teamWinners[i] = team; + i=0; + } + } + } + + if(aliveTeams.size()>1) + { + if(characters[pNum]->stock <= 0) + { + checkWinnersFreeForAll(pNum); + } + + return false; + } + else + { + if(characters[pNum]->stock <= 0) + { + checkWinnersFreeForAll(pNum); + + int*actualWinners = new int[possTeams+1]; + for(int i=1; i<=possTeams; i++) + { + actualWinners[winners[i]] = i; + } + + ArrayList remaining = ArrayList(); + for(int i=1; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + if(actualWinners[i]==0) + { + remaining.add(i); + } + } + } + + int n = remaining.size(); + + for(int i = 0; i < n; i++) + { + for(int j = 1; j < (n-i); j++) + { + if(characters[remaining.get(j-1)]->stock < characters[remaining.get(j)]->stock) + { + int i1 = remaining.get(j-1); + remaining.set(j-1,remaining.get(j)); + remaining.set(j,i1); + } + else if(characters[remaining.get(j-1)]->stock == characters[remaining.get(j)]->stock) + { + if(KOs[remaining.get(j-1)] < KOs[remaining.get(j)]) + { + int i1 = remaining.get(j-1); + remaining.set(j-1,remaining.get(j)); + remaining.set(j,i1); + } + } + } + } + + int counter = 0; + for(int i=1; istock <= 0) + { + for(int i=charAmount; i>=1; i--) + { + if(winners[i] == 0) + { + winners[i] = pNum; + if(i==2) + { + for(int j=0; j<=possPlayers; j++) + { + if(characters[j]!=null) + { + if(characters[j]->stock > 0) + { + winners[1] = j; + return true; + } + } + } + return true; + } + return false; + } + } + } + return false; + } + + boolean Global::checkWinnersSuddenDeath(byte pNum) + { + if(teamBattle) + { + //for teams, make sure only one team is left standing. + //queue the teamWinners and winners (by team) + //winners need to be completely queued (all players) + + //Get Teams in array + ArrayList > sdteams = ArrayList >(); + + for(int i=0; i<(possTeams+1); i++) + { + sdteams.add(ArrayList()); + } + + for(int i=0; iteam; + + sdteams.get(t).add(suddenDeathPlayers.get(i)); + } + + //check if player's team is dead + byte team = characters[pNum]->team; + + int totalAlive = 0; + + for(int i=0; istock > 0) + { + totalAlive++; + } + } + + if(totalAlive > 0) + { + //player's team is alive + } + else + { + //put player's team in queue + + boolean*aliveTeams = new boolean[possTeams+1]; + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + aliveTeams[characters[i]->team] = true; + } + } + + int totalTeams = 0; + + int aliveTeamsLength = possTeams+1; + for(int i=0; i=1; i--) + { + if(teamWinners[i]==0) + { + teamWinners[i] = team; + i=0; + } + } + + delete[] aliveTeams; + } + + //check if only 1 team is alive + + ArrayList aliveTeams = ArrayList(); + + for(int i=0; istock > 0) + { + totalInTeam++; + } + } + + if(totalInTeam > 0) + { + aliveTeams.add(i); + } + } + + if(aliveTeams.size() > 1) + { + return false; + } + else + { + winners[1] = aliveTeams.get(0); + + int*actualWinners = new int[possTeams+1]; + for(int i=1; i<=possTeams; i++) + { + actualWinners[winners[i]] = i; + } + + ArrayList remaining = ArrayList(); + for(int i=1; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + if(actualWinners[i]==0) + { + remaining.add(i); + } + } + } + + int n = remaining.size(); + + for(int i = 0; i < n; i++) + { + for(int j = 1; j < (n-i); j++) + { + if(characters[remaining.get(j-1)]->stock < characters[remaining.get(j)]->stock) + { + int i1 = remaining.get(j-1); + remaining.set(j-1,remaining.get(j)); + remaining.set(j,i1); + } + else if(characters[remaining.get(j-1)]->stock == characters[remaining.get(j)]->stock) + { + if(KOs[remaining.get(j-1)] < KOs[remaining.get(j)]) + { + int i1 = remaining.get(j-1); + remaining.set(j-1,remaining.get(j)); + remaining.set(j,i1); + } + } + } + } + + int counter = 0; + for(int i=1; i0) + { + teamWinners[1] = aliveTeams.get(0); + } + + delete[] actualWinners; + + return true; + } + } + else + { + //just regular easy queueing. just fill in teh zeros + + for(int i=suddenDeathPlayers.size(); i>=1; i--) + { + if(winners[i]==0) + { + winners[i] = pNum; + i=0; + } + } + + int totalAlive = 0; + + for(int i=0; istock > 0) + { + totalAlive++; + } + } + + if(totalAlive > 1) + { + return false; + } + else + { + for(int i=0; istock>0) + { + winners[1] = suddenDeathPlayers.get(i); + return true; + } + } + return true; + } + } + } + + void Global::finishGame() + { + Console::WriteLine("calling function finishGame()"); + switch(gameType) + { + case 1: + if(suddenDeath) + { + finishGameSuddenDeath(); + } + else + { + if(teamBattle) + { + finishGameTeam(); + } + else + { + finishGameFreeForAll(); + } + } + break; + + case 2: + finishGameSoloTraining(); + break; + } + Console::WriteLine("reached end of function finishGame()"); + } + + void Global::finishGameFreeForAll() + { + if(gameMode == MODE_TIME_LIMIT) + { + ArrayList > ties = ArrayList >(); + + ArrayList order = ArrayList(); + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + Vector2i vect = Vector2i(i,scores[i]); + order.add(vect); + } + } + + int n = order.size(); + + for(int i = 0; i < n; i++) + { + for(int j = 1; j < (n-i); j++) + { + if(order.get(j-1).y < order.get(j).y) + { + Vector2i vect = order.get(j-1); + order.set(j-1,order.get(j)); + order.set(j,vect); + } + } + } + + int prevScore = 0; + + for(int i=0; i0) + { + if(scores[ties.get(ties.size()-1).get(0)] == value) + { + ties.get(ties.size()-1).add(order.get(i).x); + } + else + { + ArrayList tied = ArrayList(); + tied.add(order.get(i).x); + tied.add(order.get(i-1).x); + ties.add(tied); + } + } + else + { + ArrayList tied = ArrayList(); + tied.add(order.get(i).x); + tied.add(order.get(i-1).x); + ties.add(tied); + } + } + prevScore = value; + } + + for(int i=0; i0) + { + for(int j=0; j0) + { + suddenDeath = true; + int totalTies = ties.get(0).size(); + for(int i=0; istock = 1; + } + } + + gamePlaying = false; + hud->showFinishGame = true; + hud->finishGameTime = getWorldTime() + 30; + } + + void Global::finishGameTeam() + { + if(gameMode == MODE_TIME_LIMIT) + { + //get teams in arraylist + + ArrayList > teams = ArrayList >(); + + for(int i=0; i<5; i++) + { + teams.add(ArrayList()); + } + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + int t = characters[i]->team; + + teams.get(t).add(i); + } + } + + //get team totals + + int*teamTotals = new int[possTeams+1]; + + for(int i=0; i<=possTeams; i++) + { + teamTotals[i] = 0; + } + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + teamTotals[characters[i]->team]+=scores[i]; + } + } + + ArrayList teamOrder = ArrayList(); + + for(int i=0; i<=possTeams; i++) + { + if(teams.get(i).size()>0) + { + Vector2i vect = Vector2i(i,teamTotals[i]); + teamOrder.add(vect); + } + } + + int n = teamOrder.size(); + + for(int i = 0; i < n; i++) + { + for(int j = 1; j < (n-i); j++) + { + if(teamOrder.get(j-1).y < teamOrder.get(j).y) + { + Vector2i vect = teamOrder.get(j-1); + teamOrder.set(j-1,teamOrder.get(j)); + teamOrder.set(j,vect); + } + } + } + + ArrayList > ties = ArrayList >(); + + int prevScore = 0; + + for(int i=0; i0) + { + if(teamTotals[ties.get(ties.size()-1).get(0)] == value) + { + ties.get(ties.size()-1).add(teamOrder.get(i).x); + } + else + { + ArrayList tied = ArrayList(); + tied.add(teamOrder.get(i).x); + tied.add(teamOrder.get(i-1).x); + ties.add(tied); + } + } + else + { + ArrayList tied = ArrayList(); + tied.add(teamOrder.get(i).x); + tied.add(teamOrder.get(i-1).x); + ties.add(tied); + } + } + prevScore = value; + } + + for(int i=0; i0) + { + for(int j=0; j0) + { + suddenDeath = true; + int totalTies = ties.get(0).size(); + for(int i=0; i order = ArrayList(); + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + Vector2i vect = Vector2i(i,scores[i]); + order.add(vect); + } + } + + int n2 = order.size(); + + for(int i = 0; i < n2; i++) + { + for(int j = 1; j < (n2-i); j++) + { + if(order.get(j-1).y < order.get(j).y) + { + Vector2i vect = order.get(j-1); + order.set(j-1,order.get(j)); + order.set(j,vect); + } + } + } + + for(int i=0; istock = 1; + } + + delete[] teamTotals; + } + + gamePlaying = false; + hud->showFinishGame = true; + hud->finishGameTime = getWorldTime() + 30; + } + + void Global::finishGameSoloTraining() + { + UnloadGame(); + ScreenManager::GoToScreen("TrainingCharSelect"); + } + + void Global::finishGameSuddenDeath() + { + /*if(teamBattle) + { + + } + else + {*/ + ArrayList order = ArrayList(); + + for(int i=0; i<=possPlayers; i++) + { + if(characters[i]!=null) + { + Vector2i vect = Vector2i(i,scores[i]); + order.add(vect); + } + } + + int n2 = order.size(); + + for(int i = 0; i < n2; i++) + { + for(int j = 1; j < (n2-i); j++) + { + if(order.get(j-1).y < order.get(j).y) + { + Vector2i vect = order.get(j-1); + order.set(j-1,order.get(j)); + order.set(j,vect); + } + } + } + + for(int i=0; ishowFinishGame = true; + hud->finishGameTime = getWorldTime() + 30; + } +} diff --git a/SmashBros/Global.h b/SmashBros/Global.h new file mode 100755 index 0000000..f2b9868 --- /dev/null +++ b/SmashBros/Global.h @@ -0,0 +1,155 @@ +#include "Game.h" +#include "SmashForwards.h" +#include "Player.h" +#include "Stage.h" +#include "HUD.h" + +#pragma once + +namespace SmashBros +{ + class Global + { + friend class Game; + friend class GameScreen; + public: + static const int possPlayers = 4; + static const int possTeams = 4; + + static long worldTime; + + static int*players; + + static Player**characters; + static byte*currentTeams; + static int*scores; + static int*KOs; + static int*deaths; + static int*winners; + static int*teamWinners; + static Stage*currentStage; + + static HUD*hud; + + static int charAmount; + + static int*selectedChar; + static int selectedStage; + + static ArrayList stageVotes; + static boolean peerReadyToPlay; + static boolean selfReadyToPlay; + static boolean peerLoaded; + static boolean selfLoaded; + static String P2PMessage; + + static boolean gamePlaying; + static boolean gameFinished; + + static boolean suddenDeath; + static ArrayList suddenDeathPlayers; + + static boolean smashBallOnField; + static boolean playerHasSmashBall; + + static boolean*CPU; + static int timeLimit; + static int stockAmount; + static int gameMode; + static int gameType; + static boolean teamBattle; + static long timeAmount; + + static boolean*itemsOn; + static ArrayList itemsActive; + + static int maxLives; + static int minLives; + + static int maxTime; + static int minTime; + + static const int TYPE_TRAINING = 0; + static const int TYPE_GROUPBRAWL = 1; + + static const int MODE_FREEFORALL = 0; + static const int MODE_TIME_LIMIT = 1; + static const int MODE_STOCK = 2; + + static const byte TEAM_RED = 1; + static const byte TEAM_BLUE = 2; + static const byte TEAM_GREEN = 3; + static const byte TEAM_YELLOW = 4; + + //CHARACTER CONSTANTS + static const int CHAR_MARIO = 1; + static const int CHAR_ICHIGO = 2; + static const int CHAR_SONIC = 3; + static const int CHAR_FOX = 4; + static const int CHAR_PIKACHU = 5; + + //STAGE CONSTANTS + static const int STAGE_FRACTALSTAGE = 0; + static const int STAGE_HILLSIDEBATTLEGROUND = 1; + static const int STAGE_BATTLEFIELDBRAWL = 2; + static const int STAGE_FINALDESTINATION = 3; + static const int STAGE_HYRULETEMPLE = 4; + + //ITEM CONSTANTS + static const int ITEM_SMASHBALL = 1; + static const int ITEM_RAYGUN = 2; + static const int ITEM_HEARTCONTAINER = 3; + static const int ITEM_BEAMSWORD = 4; + static const int ITEM_SUPERMUSHROOM = 5; + static const int ITEM_POISONMUSHROOM = 6; + + static const int totalCharacters = 4; + static const int totalItems = 6; + static const int totalStages = 4; + + static void onReturnToMenu(); + + static String getDirText(byte dir); + + static long getWorldTime(); + + static void Update(long gameTime); + + static String getCharName(int num); //TODO: add characters + static String getPlayerName(int playerNo); + + static boolean isInSuddenDeath(byte playerNo); + + static void scorePoint(byte pNum); + + static void UnloadGame(); + static void LoadGame(); + + static Player*getPlayerActor(int pNum); + static String getItemName(int itemNo); + + static boolean checkWinners(byte pNum); + + static void finishBrawl(); + + static void finishGame(); + static void finishGameSoloTraining(); + static void finishGameSuddenDeath(); + + private: + static void init(); + + static void createHUD(); + + static void createPlayers(); + static Player*createPlayer(float x1, float y1, byte playerNo, byte team,int charNum); + static Stage*createStage(int x1, int y1, int stageNum); + + static boolean checkWinnersFreeForAll(byte pNum); + static boolean checkWinnersSuddenDeath(byte pNum); + + static void finishGameFreeForAll(); + static void finishGameTeam(); + }; +} + diff --git a/SmashBros/HUD.cpp b/SmashBros/HUD.cpp new file mode 100755 index 0000000..9e8262d --- /dev/null +++ b/SmashBros/HUD.cpp @@ -0,0 +1,1206 @@ +#include "HUD.h" +#include "Global.h" +#include "ItemManager.h" +#include "Camera.h" +#include "Controls.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + HUD::ReadyGoActor::ReadyGoActor(float x1, float y1, HUD*hud) : Actor(x1,y1) + { + relativeToView(false); + this->hud = hud; + } + + HUD::ReadyGoActor::~ReadyGoActor() + { + // + } + + void HUD::ReadyGoActor::onAnimationFinish(const String&n) + { + if(n.equals("go")) + { + hud->showReadyGo = false; + } + } + + HUD::HUD() + { + Load(); + + showReadyGo = true; + showFinishGame = false; + finishGameTime = 0; + prevWorldTime = 0; + firstUpdate = true; + + if(Global::gameType == Global::TYPE_TRAINING) + { + trainingMenu = new TrainingMenu(this); + pauseMenu = null; + } + else + { + pauseMenu = new PauseMenu(); + trainingMenu = null; + } + + ReadyGo = new ReadyGoActor(View::ScaleWidth() * 0.5f,View::ScaleHeight() * 0.5f, this); + ReadyGo->relativeToView(false); + + ReadyGo->addAnimation(new Animation("ready",1,"Images/Game/HUD/Ready.png")); + ReadyGo->addAnimation(new Animation("go",1,"Images/Game/HUD/Go.png")); + ReadyGo->addAnimation(new Animation("suddendeath", 1, "Images/Game/HUD/SuddenDeath.png")); + if(Global::suddenDeath) + { + ReadyGo->changeAnimation("suddendeath", FORWARD); + } + else + { + ReadyGo->changeAnimation("ready", FORWARD); + } + ReadyGo->Scale = 0.7f; + + FinishGame = new Actor(View::ScaleWidth() * 0.5f,View::ScaleHeight() * 0.5f); + FinishGame->relativeToView(false); + + FinishGame->addAnimation(new Animation("game", 1, "Images/Game/HUD/Game.png")); + FinishGame->changeAnimation("game", FORWARD); + + int counter = 0; + for(byte i=1; i<=Global::possPlayers; i++) //TODO: loop characters + { + if(Global::characters[i]!=null && (!Global::suddenDeath || (Global::suddenDeath && Global::isInSuddenDeath(i)))) + { + counter++; + + CharacterPanel*panel = new CharacterPanel(this,i); + + panel->y = (View::ScaleHeight() * 0.8f); + if(Global::suddenDeath) + { + panel->x = ((float)View::ScaleWidth() / (Global::suddenDeathPlayers.size()+1))*counter; + } + else + { + panel->x = ((float)View::ScaleWidth() / (Global::charAmount+1))*counter; + } + + charPanels.add(panel); + } + } + + if(Global::gameMode == Global::MODE_TIME_LIMIT) + { + currentTime = new TextActor((float)View::ScaleWidth()/2, 40, "0:00", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 48), Color::WHITE); + currentTime->relativeToView(false); + currentTime->setAlignment(TextActor::ALIGN_CENTER); + } + else + { + currentTime = null; + } + } + + HUD::~HUD() + { + if(ReadyGo!=null) + { + delete ReadyGo; + } + if(FinishGame!=null) + { + delete FinishGame; + } + if(currentTime!=null) + { + delete currentTime; + } + if(trainingMenu!=null) + { + delete trainingMenu; + } + if(pauseMenu!=null) + { + delete pauseMenu; + } + for(int i=0; isetText((String)tempMinutes + ":0" + tempSeconds); + } + else + { + currentTime->setText((String)tempMinutes + ":" + tempSeconds); + } + } + } + + void HUD::Update(long gameTime) + { + if(firstUpdate) + { + startGameTime = (gameTime/100) + 10; + firstUpdate = false; + } + else if(startGameTime>0) + { + if(Global::getWorldTime() > startGameTime) + { + Global::gamePlaying = true; + startGameTime = 0; + ReadyGo->changeAnimation("go", FORWARD); + + if(P2PDataManager::isEnabled()) + { + DataVoid data; + + byte type = P2PDataManager::DATA_READYGO; + data.add(&type, sizeof(type)); + + type = P2PDataManager::READYGO_GO; + data.add(&type, sizeof(type)); + + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + } + } + if(showReadyGo) + { + ReadyGo->Update(gameTime); + } + for(int i=0; iUpdate(gameTime); + } + if(Global::gamePlaying) + { + if(prevWorldTime!=Global::getWorldTime()) + { + if((Global::getWorldTime()%10)==0) + { + Global::timeAmount-=1; + } + prevWorldTime = Global::getWorldTime(); + } + } + if(Global::gameMode == Global::MODE_TIME_LIMIT && Global::gamePlaying && !Global::suddenDeath) + { + updateTimeActor(); + if(Global::timeAmount<=0) + { + Global::finishGame(); + + P2PDataManager::sendScore(NULL, true); + } + currentTime->Update(gameTime); + } + if(showFinishGame && Global::getWorldTime()>=finishGameTime) + { + showFinishGame = false; + + Global::finishBrawl(); + } + if(trainingMenu!=null) + { + trainingMenu->Update(gameTime); + } + if(pauseMenu!=null && !P2PDataManager::isEnabled()) + { + pauseMenu->Update(gameTime); + } + } + + void HUD::Draw(Graphics2D&g, long gameTime) + { + for(int i=0; iDraw(g, gameTime); + } + if(Global::gameMode == Global::MODE_TIME_LIMIT && !Global::suddenDeath) + { + updateTimeActor(); + currentTime->Draw(g, gameTime); + } + if(showReadyGo) + { + ReadyGo->Draw(g, gameTime); + } + else if(showFinishGame) + { + FinishGame->Draw(g, gameTime); + } + Controls::Draw(g, gameTime); + if(trainingMenu!=null) + { + trainingMenu->Draw(g, gameTime); + } + if(pauseMenu!=null && !P2PDataManager::isEnabled()) + { + pauseMenu->Draw(g, gameTime); + } + } + + HUD::CharacterPanel*HUD::getCharPanel(byte pNum) + { + for(int i=0; iplayerNo == pNum) + { + return charPanels.get(i); + } + } + return null; + } + + bool HUD::isClicked() + { + if(trainingMenu!=NULL) + { + if(trainingMenu->tab->isClicked()) + { + return true; + } + } + if(pauseMenu!=NULL) + { + if(pauseMenu->pauseButton->isClicked()) + { + return true; + } + } + return false; + } + + void HUD::showScore(byte pNum, int amount) + { + if(amount<=0) + { + CharacterPanel*panel = getCharPanel(pNum); + panel->scoreText->setText(amount); + panel->scoreText->setColor(Color::RED); + panel->scoreShowing = true; + panel->scoreTime = Global::getWorldTime() + 20; + } + else if(amount>0) + { + CharacterPanel*panel = getCharPanel(pNum); + panel->scoreText->setText(amount); + panel->scoreText->setColor(Color::BLUE); + panel->scoreShowing = true; + panel->scoreTime = Global::getWorldTime() + 20; + } + } + + HUD::CharacterPanel::CharacterPanel(HUD*hud, byte playerNo) + { + percentText = null; + symbol = null; + stockIcon = null; + stockText = null; + playerName = null; + scoreText = null; + + percent = 00; + this->playerNo = 0; + scoreTime = 0; + scoreShowing = false; + + x = 0; + y = 0; + + this->playerNo = playerNo; + + String path = Global::getPlayerActor(playerNo)->getFolderPath(); + + if(Global::gameMode == Global::MODE_STOCK) + { + stockIcon = new Actor(0,0); + /*{ + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g, gameTime, this.x, this.y, this.Scale, false); + } + };*/ + stockIcon->relativeToView(false); + int exists = AssetManager::loadImage(path + "stock.png"); + + if(exists == 1) + { + String image = path + "stock.png"; + hud->files.add(image); + stockIcon->addAnimation(new Animation("normal", 1, image)); + stockIcon->changeAnimation("normal", FORWARD); + } + else + { + String image = "Images/Game/HUD/default_stock.png"; + hud->files.add(image); + stockIcon->addAnimation(new Animation("normal", 1, image)); + stockIcon->changeAnimation("normal", FORWARD); + } + stockIcon->Scale = 1.6f; + + stockText = new TextActor("", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 18),Color::WHITE); + /*{ + @Override + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g, gameTime, false); + } + };*/ + stockText->relativeToView(false); + + stockText->setAlignment(TextActor::ALIGN_TOPLEFT); + } + + scoreText = new TextActor("+1", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 36), Color::BLUE); + /*{ + @Override + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g, gameTime, false); + } + };*/ + scoreText->relativeToView(false); + scoreText->setAlignment(TextActor::ALIGN_CENTER); + + percentText = new Actor(0,0); + /*{ + @Override + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g,gameTime,x,y,Scale,false); + width *= Scale; + height*= Scale; + } + };*/ + percentText->relativeToView(false); + + percentText->addAnimation(new Animation("0",1,"Images/Game/HUD/PercentText/0.png")); + percentText->addAnimation(new Animation("1",1,"Images/Game/HUD/PercentText/1.png")); + percentText->addAnimation(new Animation("2",1,"Images/Game/HUD/PercentText/2.png")); + percentText->addAnimation(new Animation("3",1,"Images/Game/HUD/PercentText/3.png")); + percentText->addAnimation(new Animation("4",1,"Images/Game/HUD/PercentText/4.png")); + percentText->addAnimation(new Animation("5",1,"Images/Game/HUD/PercentText/5.png")); + percentText->addAnimation(new Animation("6",1,"Images/Game/HUD/PercentText/6.png")); + percentText->addAnimation(new Animation("7",1,"Images/Game/HUD/PercentText/7.png")); + percentText->addAnimation(new Animation("8",1,"Images/Game/HUD/PercentText/8.png")); + percentText->addAnimation(new Animation("9",1,"Images/Game/HUD/PercentText/9.png")); + percentText->addAnimation(new Animation("%",1,"Images/Game/HUD/PercentText/percent.png")); + percentText->Scale = 0.28f; + + int exists = AssetManager::loadImage(path + "symbol.png"); + + if(exists == 1) + { + String image = path + "symbol.png"; + hud->files.add(image); + symbol = new Actor(0,0); + /*{ + @Override + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g,gameTime,x,y,Scale,false); + width *= Scale; + height*= Scale; + } + };*/ + symbol->relativeToView(false); + symbol->addAnimation(new Animation("normal",1,image)); + symbol->changeAnimation("normal", FORWARD); + symbol->setAlpha(0.5f); + } + else + { + AssetManager::loadImage("Images/Game/HUD/default_symbol.png"); + hud->files.add("Images/Game/HUD/default_symbol.png"); + symbol = new Actor(0,0); + /*{ + @Override + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g,gameTime,x,y,Scale,false); + width *= Scale; + height*= Scale; + } + };*/ + symbol->relativeToView(false); + symbol->addAnimation(new Animation("normal",1,"Images/Game/HUD/default_symbol.png")); + symbol->changeAnimation("normal", FORWARD); + symbol->setAlpha(0.5f); + } + + byte team = Global::getPlayerActor(playerNo)->getTeam(); + + if(team==0) + { + team = (byte)playerNo; + } + + switch(team) + { + default: + symbol->setColor(Color::GRAY); + break; + + case 1: + symbol->setColor(Color::RED); + break; + + case 2: + symbol->setColor(Color::BLUE); + break; + + case 3: + symbol->setColor(Color::YELLOW); + break; + + case 4: + symbol->setColor(Color::GREEN); + break; + } + + playerName = new TextActor(Global::getPlayerActor(playerNo)->getName(),AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 18),Color::WHITE); + /*{ + @Override + public void Draw(Graphics2D g, long gameTime) + { + drawActor(g,gameTime,false); + } + };*/ + playerName->relativeToView(false); + playerName->setAlignment(TextActor::ALIGN_CENTER); + } + + HUD::CharacterPanel::~CharacterPanel() + { + if(percentText!=null) + { + delete percentText; + } + if(symbol!=null) + { + delete symbol; + } + if(stockIcon!=null) + { + delete stockIcon; + } + if(stockText!=null) + { + delete stockText; + } + if(playerName!=null) + { + delete playerName; + } + if(scoreText!=null) + { + delete scoreText; + } + } + + void HUD::CharacterPanel::Update(long gameTime) + { + percent = Global::characters[playerNo]->getPercent(); + if(Global::getWorldTime()>=scoreTime) + { + scoreShowing = false; + } + + if(percent<=510) + { + byte newColor=(510-(percent))/2; + byte r = percentText->getColor().r; + byte g=newColor; + byte b=newColor; + percentText->setColor(Color(r,g,b)); + } + else if(percent<820) + { + byte newColor=(310-(percent-510))/2; + byte r=newColor; + byte g=0; + byte b=0; + percentText->setColor(Color(r,g,b)); + } + else + { + byte r=100; + byte g=0; + byte b=0; + percentText->setColor(Color(r,g,b)); + } + } + + void HUD::CharacterPanel::Draw(Graphics2D&g, long gameTime) + { + percent = Global::characters[playerNo]->getPercent(); + + if(percent<=510) + { + byte newColor=(510-(percent))/2; + byte r = percentText->getColor().r; + byte g=newColor; + byte b=newColor; + percentText->setColor(Color(r,g,b)); + } + else if(percent<820) + { + byte newColor=(310-(percent-510))/2; + byte r=newColor; + byte g=0; + byte b=0; + percentText->setColor(Color(r,g,b)); + } + else + { + byte r=100; + byte g=0; + byte b=0; + percentText->setColor(Color(r,g,b)); + } + + symbol->x = x + 30; + symbol->y = y + 15; + symbol->Draw(g, gameTime); + String percentString = ""; + if(percent<10) + { + percentString = (String)"0" + percent + "%"; + } + else + { + percentString = (String)percent + "%"; + } + float currentX = 50; + percentText->y = y + 10; + for(int i=(percentString.length()-1); i>=0; i--) + { + percentText->changeAnimation((String)"" + percentString.charAt(i), FORWARD); + percentText->x = x + currentX; + percentText->Draw(g, gameTime); + currentX -=42; + } + + playerName->x = x; + playerName->y = y + 50; + playerName->Draw(g, gameTime); + if(stockIcon!=null) + { + stockIcon->x = x - 22; + stockIcon->y = y - 28; + stockIcon->Draw(g, gameTime); + + stockText->x = x; + stockText->y = y - 40; + stockText->setText((String)"x " + Global::characters[playerNo]->stock); + stockText->Draw(g, gameTime); + } + + if(scoreShowing) + { + scoreText->x = x - 30; + scoreText->y = y - 30; + scoreText->Draw(g, gameTime); + } + } + + HUD::TrainingMenu::TrainingMenu(HUD*hud) + { + bg = new Actor(0,0); + bg->Scale = 1.9f; + bg->addAnimation(new Animation("normal",1,"Images/Game/HUD/Training/bg.png")); + bg->changeAnimation("normal", FORWARD); + bg->setVisible(false); + bg->relativeToView(false); + + bg->x = (float)bg->width/2; + bg->y = (float)bg->height/2; + + tab = new Actor(0,0); + tab->addAnimation(new Animation("closed",1,"Images/Game/HUD/Training/button_open.png")); + tab->addAnimation(new Animation("opened",1,"Images/Game/HUD/Training/button_close.png")); + tab->changeAnimation("closed", FORWARD); + tab->relativeToView(false); + + tab->x = (float)tab->width/2; + tab->y = 100; + + apply = new Actor(100,450); + apply->addAnimation(new Animation("normal",1,"Images/Game/HUD/Training/button_apply.png")); + apply->changeAnimation("normal", FORWARD); + apply->relativeToView(false); + apply->setVisible(false); + apply->Scale = 1.2f; + + finish = new Actor(100,500); + finish->addAnimation(new Animation("normal",1,"Images/Game/HUD/Training/button_finish.png")); + finish->changeAnimation("normal", FORWARD); + finish->relativeToView(false); + finish->setVisible(false); + finish->Scale = 1.2f; + + //options = new ArrayList(); + + OptionPanel*optionPanel = new OptionPanel(100,100,"Images/Game/HUD/Training/panel_items.png"); + optionPanel->setMin(0); + optionPanel->setMax(Global::totalItems); + optionPanel->setValue(0); + optionPanel->Scale = 1.4f; + options.add(optionPanel); + + optionPanel = new OptionPanel(100,180,"Images/Game/HUD/Training/panel_cpu.png"); + optionPanel->setMin(1); + optionPanel->setMax(6); + optionPanel->setValue(1); + optionPanel->Scale = 1.4f; + options.add(optionPanel); + + optionPanel = new OptionPanel(100,260,"Images/Game/HUD/Training/panel_camera.png"); + optionPanel->setMin(0); + optionPanel->setMax(2); + optionPanel->setValue(2); + optionPanel->Scale = 1.4f; + options.add(optionPanel); + + opened = false; + } + + HUD::TrainingMenu::~TrainingMenu() + { + if(bg!=null) + { + delete bg; + } + if(tab!=null) + { + delete tab; + } + for(int i=0; iUpdate(gameTime); + tab->Update(gameTime); + apply->Update(gameTime); + finish->Update(gameTime); + + if(opened) + { + tab->x = (float)bg->width + (float)tab->width/2; + tab->y = 100; + tab->changeAnimation("opened", FORWARD); + bg->setVisible(true); + bg->x = (float)bg->width/2; + bg->y = (float)bg->height/2; + apply->setVisible(true); + finish->setVisible(true); + + if(apply->wasClicked() && !apply->isClicked()) + { + applyChanges(); + opened = false; + onClose(); + } + if(apply->mouseOver()) + { + apply->setColor(Color::RED); + } + else + { + apply->setColor(Color::WHITE); + } + applyLabels(gameTime); + + if(finish->wasClicked() && !finish->isClicked()) + { + Global::finishGameSoloTraining(); + Controls::enableTouchControls(true); + return; + } + if(finish->mouseOver()) + { + finish->setColor(Color::RED); + } + else + { + finish->setColor(Color::WHITE); + } + } + else + { + tab->x = (float)tab->width/2; + tab->y = 100; + tab->changeAnimation("closed", FORWARD); + bg->setVisible(false); + apply->setVisible(false); + finish->setVisible(false); + } + + if(!Controls::controlsDown()) + { + if(tab->mouseOver()) + { + tab->setColor(Color::RED); + } + else + { + tab->setColor(Color::WHITE); + } + } + if(!Controls::controlsDown() && tab->wasClicked() && !tab->isClicked()) + { + if(opened) + { + opened = false; + onClose(); + } + else if(!Controls::controlsDown()) + { + opened = true; + onOpen(); + } + } + } + + void HUD::TrainingMenu::Draw(Graphics2D&g, long gameTime) + { + bg->Draw(g, gameTime); + tab->Draw(g, gameTime); + apply->Draw(g, gameTime); + finish->Draw(g, gameTime); + if(opened) + { + for(int i=0; iDraw(g, gameTime); + } + } + } + + void HUD::TrainingMenu::applyLabels(long gameTime) + { + for(int i=0; iUpdate(gameTime); + switch(i) + { + case OPTION_ITEMS: //item options + if(option->getValue()==0) + { + option->setLabel("none"); + } + else + { + option->setLabel(Global::getItemName(option->getValue())); + } + break; + + case OPTION_CPU: //AI options + switch(option->getValue()) + { + case Player::AI_STOP: + option->setLabel("Stop"); + break; + + case Player::AI_WALK: + option->setLabel("Walk"); + break; + + case Player::AI_RUN: + option->setLabel("Run"); + break; + + case Player::AI_JUMP: + option->setLabel("Jump"); + break; + + case Player::AI_NORMAL: + option->setLabel("Attack"); + break; + + case Player::AI_FOLLOW: + option->setLabel("Follow"); + break; + } + break; + + case OPTION_CAMERA: //camera options + switch(option->getValue()) + { + case Camera::MODE_ZOOM: + option->setLabel("Zoom"); + break; + + case Camera::MODE_FOLLOW: + option->setLabel("Follow"); + break; + + case Camera::MODE_FIXED: + option->setLabel("Fixed"); + break; + } + break; + } + } + } + + void HUD::TrainingMenu::applyChanges() + { + for(int i=0; igetValue()!=0) + { + ItemManager::SpawnItem(option->getValue()); + } + break; + + case OPTION_CPU: //AI options + if(Global::characters[2]!=null) + { + Global::characters[2]->aiType = (byte)option->getValue(); + } + break; + + case OPTION_CAMERA: //camera options + Camera::setMode((byte)option->getValue()); + break; + } + } + } + + void HUD::TrainingMenu::onOpen() + { + Controls::enableTouchControls(false); + for(int i=0; isetValue(Global::characters[2]->aiType); + } + else + { + option->setValue(Player::AI_STOP); + } + break; + } + } + } + + void HUD::TrainingMenu::onClose() + { + Controls::enableTouchControls(true); + for(int i=0; isetValue(0); + break; + } + } + } + + HUD::OptionPanel::OptionPanel(float x1, float y1, String anim) : Actor(x1,y1) + { + min = 0; + max = 0; + value = 0; + label = new TextActor("",AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, textSize),Color::BLACK); + label->setAlignment(TextActor::ALIGN_CENTER); + label->relativeToView(false); + + relativeToView(false); + + addAnimation(new Animation("normal",1,anim)); + changeAnimation("normal",FORWARD); + + left = new Actor(0,0); + left->addAnimation(new Animation("normal",1,"Images/Game/HUD/Training/arrow.png")); + left->changeAnimation("normal", FORWARD); + left->relativeToView(false); + left->setAlpha(0.6f); + right = new Actor(0,0); + Animation*a = new Animation("normal",1,"Images/Game/HUD/Training/arrow.png"); + a->mirror(true); + right->addAnimation(a); + right->changeAnimation("normal", FORWARD); + right->relativeToView(false); + right->setAlpha(0.6f); + } + + HUD::OptionPanel::~OptionPanel() + { + if(left!=null) + { + delete left; + } + if(right!=null) + { + delete right; + } + if(label!=null) + { + delete label; + } + } + + void HUD::OptionPanel::Update(long gameTime) + { + Actor::Update(gameTime); + left->Scale = Scale; + left->x = x-((float)arrowXOffset*Scale); + left->y = y; + right->Scale = Scale; + right->x = x+((float)arrowXOffset*Scale); + right->y = y; + left->Update(gameTime); + right->Update(gameTime); + label->setSize((unsigned int)((float)textSize*Scale)); + label->x = x; + label->y = y + ((float)labelYOffset*Scale); + label->Update(gameTime); + + if(left->wasClicked() && !left->isClicked()) + { + value--; + if(value < min) + { + value = max; + } + } + else if(right->wasClicked() && !right->isClicked()) + { + value++; + if(value > max) + { + value = min; + } + } + if(left->mouseOver()) + { + left->setColor(Color::RED); + } + else + { + left->setColor(Color::WHITE); + } + if(right->mouseOver()) + { + right->setColor(Color::RED); + } + else + { + right->setColor(Color::WHITE); + } + } + + void HUD::OptionPanel::Draw(Graphics2D&g, long gameTime) + { + Actor::Draw(g, gameTime); + left->Draw(g, gameTime); + right->Draw(g, gameTime); + label->Draw(g, gameTime); + } + + void HUD::OptionPanel::setMin(int min) + { + this->min = min; + } + + void HUD::OptionPanel::setMax(int max) + { + this->max = max; + } + + void HUD::OptionPanel::setValue(int value) + { + this->value = value; + } + + void HUD::OptionPanel::setLabel(String label) + { + this->label->setText(label); + } + + int HUD::OptionPanel::getValue() + { + return value; + } + + HUD::PauseMenu::PauseMenu() + { + pauseButton = new Actor(110,60); + pauseButton->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_start.png")); + pauseButton->changeAnimation("normal", FORWARD); + pauseButton->relativeToView(false); + pauseButton->setAlpha(0.2f); + pauseButton->Scale = 2.0f; + + resumeButton = new Actor(220,160); + resumeButton->addAnimation(new Animation("normal", 1, "Images/Game/HUD/ResumeButton.png")); + resumeButton->changeAnimation("normal", FORWARD); + resumeButton->relativeToView(false); + resumeButton->setAlpha(0.2f); + resumeButton->Scale = 1.6f; + + finishButton = new Actor(View::ScaleWidth()/2, View::ScaleHeight()/2); + finishButton->addAnimation(new Animation("normal", 1, "Images/Game/HUD/FinishButton.png")); + finishButton->changeAnimation("normal", FORWARD); + finishButton->relativeToView(false); + finishButton->setAlpha(0.2f); + finishButton->Scale = 1.6f; + + exitButton = new Actor(680, 440); + exitButton->addAnimation(new Animation("normal", 1, "Images/Game/HUD/ExitButton.png")); + exitButton->changeAnimation("normal", FORWARD); + exitButton->relativeToView(false); + exitButton->setAlpha(0.2f); + exitButton->Scale = 1.6f; + } + + HUD::PauseMenu::~PauseMenu() + { + delete pauseButton; + delete resumeButton; + delete finishButton; + delete exitButton; + } + + void HUD::PauseMenu::Update(long gameTime) + { + pauseButton->Update(gameTime); + if(!Controls::controlsDown()) + { + if(pauseButton->isClicked() && !pauseButton->wasClicked()) + { + pauseButton->setColor(Color::BLUE); + } + else if(!pauseButton->isClicked() && pauseButton->wasClicked()) + { + pauseButton->setColor(Color::WHITE); + Game::Suspend(); + } + } + } + + void HUD::PauseMenu::Draw(Graphics2D&g, long gameTime) + { + if(Game::Suspended()) + { + resumeButton->Update(gameTime); + if(resumeButton->isClicked() && !resumeButton->wasClicked()) + { + resumeButton->setColor(Color::BLUE); + } + if(!resumeButton->isClicked() && resumeButton->wasClicked()) + { + resumeButton->setColor(Color::WHITE); + Game::Resume(); + } + resumeButton->Draw(g, gameTime); + + finishButton->Update(gameTime); + if(finishButton->isClicked() && !finishButton->wasClicked()) + { + finishButton->setColor(Color::BLUE); + } + if(!finishButton->isClicked() && finishButton->wasClicked()) + { + finishButton->setColor(Color::WHITE); + Game::Resume(); + Global::UnloadGame(); + if(Global::gameType == Global::TYPE_TRAINING) + { + ScreenManager::GoToScreen("TrainingCharSelect"); + } + else if(Global::gameType == Global::TYPE_GROUPBRAWL) + { + ScreenManager::GoToScreen("BrawlCharSelect"); + } + } + finishButton->Draw(g, gameTime); + + exitButton->Update(gameTime); + if(exitButton->isClicked() && !exitButton->wasClicked()) + { + exitButton->setColor(Color::BLUE); + } + if(!exitButton->isClicked() && exitButton->wasClicked()) + { + exitButton->setColor(Color::WHITE); + Game::Resume(); + Game::Exit(); + } + exitButton->Draw(g, gameTime); + } + else + { + pauseButton->Draw(g, gameTime); + } + } +} \ No newline at end of file diff --git a/SmashBros/HUD.h b/SmashBros/HUD.h new file mode 100755 index 0000000..57d8d2d --- /dev/null +++ b/SmashBros/HUD.h @@ -0,0 +1,161 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class HUD + { + friend class P2PDataManager; + friend class Global; + private: + class CharacterPanel + { + private: + int percent; + byte playerNo; + friend class HUD; + Actor*percentText; + Actor*symbol; + Actor*stockIcon; + TextActor*stockText; + TextActor*playerName; + TextActor*scoreText; + long scoreTime; + boolean scoreShowing; + + public: + float x,y; + + CharacterPanel(HUD*hud, byte playerNo); + virtual ~CharacterPanel(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + }; + + class OptionPanel : public Actor + { + private: + int min; + int max; + int value; + + static const unsigned int textSize = 12; + static const int arrowXOffset = 48; + static const int labelYOffset = 8; + + Actor*left; + Actor*right; + TextActor*label; + + public: + OptionPanel(float x1, float y1, String anim); + virtual ~OptionPanel(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + void setMin(int min); + void setMax(int max); + void setValue(int value); + void setLabel(String label); + int getValue(); + }; + + class TrainingMenu + { + friend class HUD; + private: + Actor*bg; + Actor*tab; + ArrayList options; + + Actor*apply; + Actor*finish; + + boolean opened; + + void applyLabels(long gameTime); + void applyChanges(); + + void onOpen(); + void onClose(); + + public: + static const int OPTION_ITEMS = 0; + static const int OPTION_CPU = 1; + static const int OPTION_CAMERA = 2; + + TrainingMenu(HUD*hud); + virtual ~TrainingMenu(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class ReadyGoActor : public Actor + { + private: + HUD*hud; + + public: + ReadyGoActor(float x1, float y1, HUD*hud); + virtual ~ReadyGoActor(); + + virtual void onAnimationFinish(const String&n); + }; + + class PauseMenu + { + friend class HUD; + private: + Actor*pauseButton; + + Actor*resumeButton; + Actor*finishButton; + Actor*exitButton; + + public: + PauseMenu(); + ~PauseMenu(); + + void Update(long gameTime); + void Draw(Graphics2D&g, long gameTime); + }; + + long startGameTime; + boolean showReadyGo; + boolean showFinishGame; + long finishGameTime; + ReadyGoActor*ReadyGo; + Actor*FinishGame; + TextActor*currentTime; + long prevWorldTime; + TrainingMenu*trainingMenu; + PauseMenu*pauseMenu; + + boolean firstUpdate; + ArrayList charPanels; + + ArrayList files; + + void updateTimeActor(); + + CharacterPanel*getCharPanel(byte pNum); + + public: + HUD(); + virtual ~HUD(); + + void Load(); + void Unload(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + bool isClicked(); + void showScore(byte pNum, int amount); + }; +} \ No newline at end of file diff --git a/SmashBros/HangPoint.cpp b/SmashBros/HangPoint.cpp new file mode 100755 index 0000000..76eb6bf --- /dev/null +++ b/SmashBros/HangPoint.cpp @@ -0,0 +1,31 @@ +#include "HangPoint.h" +#include "Camera.h" + +namespace SmashBros +{ + HangPoint::HangPoint(byte dir, float x1, float y1) : WireframeActor(x1,y1,10,10) + { + hanging = 0; + this->dir = dir; + } + + HangPoint::~HangPoint() + { + // + } + + void HangPoint::Update(long gameTime) + { + WireframeActor::Update(gameTime); + } + + void HangPoint::Draw(Graphics2D&g, long gameTime) + { + drawActor(g, gameTime, (float)(x*Camera::Zoom), (float)(y*Camera::Zoom), Camera::Zoom); + } + + byte HangPoint::getHangSide() + { + return dir; + } +} \ No newline at end of file diff --git a/SmashBros/HangPoint.h b/SmashBros/HangPoint.h new file mode 100755 index 0000000..2f73a4a --- /dev/null +++ b/SmashBros/HangPoint.h @@ -0,0 +1,26 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class HangPoint : public WireframeActor + { + private: + byte dir; + + public: + static const byte LEFT = 1; + static const byte RIGHT = 2; + + int hanging; + + HangPoint(byte dir, float x1, float y1); + virtual ~HangPoint(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + byte getHangSide(); + }; +} \ No newline at end of file diff --git a/SmashBros/HeartContainer.cpp b/SmashBros/HeartContainer.cpp new file mode 100755 index 0000000..d4c0f69 --- /dev/null +++ b/SmashBros/HeartContainer.cpp @@ -0,0 +1,51 @@ +#include "HeartContainer.h" +#include "Global.h" + +namespace SmashBros +{ + HeartContainer::HeartContainer(float x1, float y1) : Item(x1, y1, 200, TYPE_FOOD) + { + weight = 0.8f; + accelerateGravity(false); + + itemNo = Global::ITEM_HEARTCONTAINER; + + available = true; + + addAnimation(new Animation("normal",1,"Images/Game/Items/HeartContainer/heart_container.png")); + Animation*anim = new Animation("sparkle",8,4,1); + anim->addFrame("Images/Game/Items/HeartContainer/sparkle.png"); + addAnimation(anim); + changeAnimation("normal",FORWARD); + } + + HeartContainer::~HeartContainer() + { + // + } + + void HeartContainer::Update(long gameTime) + { + Item::Update(gameTime); + } + + void HeartContainer::onPickUp(Player*collide) + { + doPowerUp(collide, POWERUP_HEAL, 100); + available = false; + changeAnimation("sparkle",FORWARD); + } + + boolean HeartContainer::canPickUp() + { + return available; + } + + void HeartContainer::onAnimationFinish(const String&n) + { + if(n.equals("sparkle")) + { + destroy(); + } + } +} \ No newline at end of file diff --git a/SmashBros/HeartContainer.h b/SmashBros/HeartContainer.h new file mode 100755 index 0000000..89eb554 --- /dev/null +++ b/SmashBros/HeartContainer.h @@ -0,0 +1,23 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class HeartContainer : public Item + { + private: + boolean available; + + public: + HeartContainer(float x1, float y1); + virtual ~HeartContainer(); + + virtual void Update(long gameTime); + + virtual void onPickUp(Player*collide); + virtual boolean canPickUp(); + virtual void onAnimationFinish(const String&n); + + }; +} \ No newline at end of file diff --git a/SmashBros/HillsideBattleground.cpp b/SmashBros/HillsideBattleground.cpp new file mode 100755 index 0000000..a266102 --- /dev/null +++ b/SmashBros/HillsideBattleground.cpp @@ -0,0 +1,128 @@ +#include "HillsideBattleground.h" + +namespace SmashBros +{ + HillsideBattleground::HillsideBattleground(int x1, int y1) : Stage(x1, y1) + { + setSpawnPoint(0, 0,0); + setSpawnPoint(1, -110,-110); + setSpawnPoint(2, 110,-110); + setSpawnPoint(3, 0,-138); + setSpawnPoint(4, 0, -10); + + bottomViewBorder = 255; + topViewBorder = -255; + leftViewBorder = -320; + rightViewBorder = 320; + + leftBorder = -400; + topBorder = -380; + rightBorder = 400; + bottomBorder = 320; + + setItemBoundaries(-200, -150, 190, 80); + + loadGameElements(); + loadPlatforms(); + loadHangPoints(); + loadGround(); + + setBackground("Images/Game/Stages/HillsideBattleground/bg.png"); + setBackgroundScale(1.45); + setBackgroundType(BG_FIXED); + + //setWireframeColor(Color.blue); + //showWireframes(true); + + MusicManager::loadSong("Battlefield v2"); + } + + HillsideBattleground::~HillsideBattleground() + { + // + } + + void HillsideBattleground::loadGameElements() + { + GameElement*bg; + + bg = new GameElement(0,80); + Animation*anim = new Animation("normal", 1,1,1); + anim->addFrame("Images/Game/Stages/HillsideBattleground/bg2.png"); + bg->addAnimation(anim); + bg->changeAnimation("normal", FORWARD); + bg->Scale = 1.05f; + addElement(bg); + + bg = new GameElement(0,20); + anim = new Animation("normal", 1,1,1); + anim->addFrame("Images/Game/Stages/HillsideBattleground/mainstage.png"); + bg->addAnimation(anim); + bg->changeAnimation("normal", FORWARD); + addElement(bg); + + bg = new GameElement(-4,-92); + bg->addAnimation(new Animation("normal",1,"Images/Game/Stages/HillsideBattleground/fplat2.png")); + bg->changeAnimation("normal", FORWARD); + bg->setVisible(false); + addElement(bg); + + bg = new GameElement(-105, -33); + bg->addAnimation(new Animation("normal",1,"Images/Game/Stages/HillsideBattleground/fplat1.png")); + bg->changeAnimation("normal", FORWARD); + bg->setVisible(false); + addElement(bg); + + bg = new GameElement(98, -33); + bg->addAnimation(new Animation("normal",1,"Images/Game/Stages/HillsideBattleground/fplat1.png")); + bg->changeAnimation("normal", FORWARD); + bg->setVisible(false); + addElement(bg); + } + + void HillsideBattleground::loadPlatforms() + { + Platform*plat; + + plat = new Platform(Platform::TYPE_NORMAL, 0,20); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HillsideBattleground/plat.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -46.5f, -99.5f, 85, 15); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -128, -39, 46, 14); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, 75, -39, 46, 14); + addPlatform(plat); + } + + void HillsideBattleground::loadHangPoints() + { + HangPoint*hp; + + hp = new HangPoint(HangPoint::LEFT,-217,88); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,197,99); + addHangPoint(hp); + } + + void HillsideBattleground::loadGround() + { + GameElement*ground; + + ground = new GameElement(0,70); + ground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HillsideBattleground/ground.png")); + ground->changeAnimation("normal", FORWARD); + addGround(ground); + } + + void HillsideBattleground::Draw(Graphics2D&g, long gameTime) + { + Stage::Draw(g, gameTime); + } +} \ No newline at end of file diff --git a/SmashBros/HillsideBattleground.h b/SmashBros/HillsideBattleground.h new file mode 100755 index 0000000..5818fbe --- /dev/null +++ b/SmashBros/HillsideBattleground.h @@ -0,0 +1,21 @@ +#include "Stage.h" + +#pragma once + +namespace SmashBros +{ + class HillsideBattleground : public Stage + { + private: + void loadGameElements(); + void loadPlatforms(); + void loadHangPoints(); + void loadGround(); + + public: + HillsideBattleground(int x1, int y1); + ~HillsideBattleground(); + + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/HitBox.cpp b/SmashBros/HitBox.cpp new file mode 100755 index 0000000..e6da44f --- /dev/null +++ b/SmashBros/HitBox.cpp @@ -0,0 +1,20 @@ +#include "HitBox.h" +#include "Camera.h" + +namespace SmashBros +{ + HitBox::HitBox(byte playerNo, float x1, float y1, int w, int h) : WireframeActor(x1,y1,w,h) + { + this->playerNo = playerNo; + } + + HitBox::~HitBox() + { + // + } + + void HitBox::Draw(Graphics2D&g, long gameTime) + { + drawActor(g, gameTime, (x*Camera::Zoom), (y*Camera::Zoom), Camera::Zoom); + } +} \ No newline at end of file diff --git a/SmashBros/HitBox.h b/SmashBros/HitBox.h new file mode 100755 index 0000000..5cc48c6 --- /dev/null +++ b/SmashBros/HitBox.h @@ -0,0 +1,20 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class HitBox : public WireframeActor + { + friend class Stage; + friend class Player; + private: + byte playerNo; + + public: + HitBox(byte playerNo, float x1, float y1, int w, int h); + virtual ~HitBox(); + + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/HyruleTemple.cpp b/SmashBros/HyruleTemple.cpp new file mode 100755 index 0000000..139bfca --- /dev/null +++ b/SmashBros/HyruleTemple.cpp @@ -0,0 +1,228 @@ +#include "HyruleTemple.h" + +namespace SmashBros +{ + HyruleTemple::HyruleTemple(int x1, int y1) : Stage(x1,y1) + { + watchPlat = null; + + setSpawnPoint(0, 0,0); + setSpawnPoint(1, -115, -95); + setSpawnPoint(2, 198,-162); + setSpawnPoint(3, -288,-186); + setSpawnPoint(4, -121, 44); + + topViewBorder = -330; + bottomViewBorder = 315; + leftViewBorder = -515; + rightViewBorder = 515; + + topBorder = -485; + bottomBorder = 440; + leftBorder = -560; + rightBorder = 560; + + setItemBoundaries(-348, -262, 348, -60); + + loadGameElements(); + loadPlatforms(); + loadHangPoints(); + loadForeground(); + loadGround(); + + setBackground("Images/Game/Stages/HyruleTemple/bg.png"); + setBackgroundScale(1.0); + setBackgroundType(BG_FIXED); + + setWireframeColor(Color::BLUE); + //showWireframes(true); + + MusicManager::loadSong("Zelda Theme"); + } + + HyruleTemple::~HyruleTemple() + { + // + } + + void HyruleTemple::loadGameElements() + { + GameElement*bg; + + bg = new GameElement(0,0); + Animation*anim = new Animation("normal", 1,1,1); + anim->addFrame("Images/Game/Stages/HyruleTemple/mainstage.png"); + bg->addAnimation(anim); + bg->changeAnimation("normal", FORWARD); + addElement(bg); + } + + void HyruleTemple::loadPlatforms() + { + Platform*plat; + + plat = new Platform(Platform::TYPE_NORMAL, -278, -25); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/plat1.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_NORMAL, -85, -59); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/plat2.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_NORMAL, 157, 9); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/plat3.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_NORMAL, -95, 195.5f); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/plat4.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_NORMAL, 65, 209); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/plat5.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + watchPlat = new Platform(Platform::TYPE_NORMAL, 68, -70, 30, 50); + addPlatform(watchPlat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -292, -97); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat1.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -193, -41); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat2.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -201, 11); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat3.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, -67, -136); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat4.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, 196, -80); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat5.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, 284, -172); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat6.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + + plat = new Platform(Platform::TYPE_GOTHROUGH, 283, -103); + plat->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/float_plat7.png")); + plat->changeAnimation("normal", FORWARD); + plat->setVisible(false); + addPlatform(plat); + } + + void HyruleTemple::loadForeground() + { + GameElement*foreground; + + foreground = new GameElement(242, -121); + foreground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/foreground1.png")); + foreground->changeAnimation("normal", FORWARD); + addForeground(foreground); + + foreground = new GameElement(-281, -72); + foreground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/foreground2.png")); + foreground->changeAnimation("normal", FORWARD); + addForeground(foreground); + + foreground = new GameElement(-108, -62); + foreground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/foreground3.png")); + foreground->changeAnimation("normal", FORWARD); + addForeground(foreground); + + foreground = new GameElement(-136, 70); + foreground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/foreground4.png")); + foreground->changeAnimation("normal", FORWARD); + addForeground(foreground); + + foreground = new GameElement(2, 87); + foreground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/foreground5.png")); + foreground->changeAnimation("normal", FORWARD); + addForeground(foreground); + } + + void HyruleTemple::loadHangPoints() + { + HangPoint*hp; + + hp = new HangPoint(HangPoint::LEFT,-358,-40); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::LEFT,-213,100); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::LEFT,36,181); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,9,137); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,83,181); + addHangPoint(hp); + + hp = new HangPoint(HangPoint::RIGHT,349,-20); + addHangPoint(hp); + } + + void HyruleTemple::loadGround() + { + GameElement*ground; + + ground = new GameElement(157, -5); + ground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/ground1.png")); + ground->changeAnimation("normal", FORWARD); + addGround(ground); + + ground = new GameElement(-100, -60); + ground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/ground2.png")); + ground->changeAnimation("normal", FORWARD); + addGround(ground); + + ground = new GameElement(-30, 110); + ground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/ground3.png")); + ground->changeAnimation("normal", FORWARD); + addGround(ground); + + ground = new GameElement(196, -85); + ground->addAnimation(new Animation("normal",1,"Images/Game/Stages/HyruleTemple/ground4.png")); + ground->changeAnimation("normal", FORWARD); + addGround(ground); + } + + void HyruleTemple::Update(long gameTime) + { + Stage::Update(gameTime); + } + + void HyruleTemple::Draw(Graphics2D&g, long gameTime) + { + Stage::Draw(g, gameTime); + + } +} \ No newline at end of file diff --git a/SmashBros/HyruleTemple.h b/SmashBros/HyruleTemple.h new file mode 100755 index 0000000..1cd36bc --- /dev/null +++ b/SmashBros/HyruleTemple.h @@ -0,0 +1,24 @@ +#include "Stage.h" + +#pragma once + +namespace SmashBros +{ + class HyruleTemple : public Stage + { + private: + Platform*watchPlat; + void loadGameElements(); + void loadPlatforms(); + void loadForeground(); + void loadHangPoints(); + void loadGround(); + + public: + HyruleTemple(int x1, int y1); + ~HyruleTemple(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/Ichigo.cpp b/SmashBros/Ichigo.cpp new file mode 100755 index 0000000..5d5d6f2 --- /dev/null +++ b/SmashBros/Ichigo.cpp @@ -0,0 +1,1297 @@ +#include "Ichigo.h" +#include "AttackTemplates.h" +#include "Global.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + void Ichigo::addProjectileInfo(byte type, int projID, float x, float y) + { + ProjectileInfo info; + info.type = type; + info.projID = projID; + info.x = x; + info.y = y; + createdProjectiles.add(info); + } + + Ichigo::Ichigo(float x1, float y1, byte playerNo, byte team) : Player(x1, y1, playerNo, team) + { + charging = 0; + finalSmash = false; + dropDownAttack = false; + + walkSpeed = 3.2f; + runSpeed = 5; + fallWalk = 2.8f; + fallRun = 3; + + weight = 0.18; + + name = "Ichigo"; + + Scale = 0.95f; + + setHitbox(-14, 0, 28, 45); + setHitboxColor(Color::GREEN); + //showHitboxWireframe(true); + //setWireframeColor(Color.red); + //showWireframe(true); + + setHangPoint(7, 23); + setIndicatorOffset(0, -10); + setItemOffset(4, 16); + + oldSmashPower = 0; + + Console::WriteLine((String)"finished creating player " + playerNo); + } + + Ichigo::~Ichigo() + { + // + } + + void Ichigo::addP2PData(DataVoid&data) + { + int total = createdProjectiles.size(); + + if(total>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + data.add(&oldSmashPower, sizeof(oldSmashPower)); + + int total = createdProjectiles.size(); + data.add(&total, sizeof(total)); + + for(int i=0; iScale = (float)oldSmashPower/100; + createProjectile(blast); + } + break; + + case 2: + { + Projectile::setNextID(projID); + createProjectile(new SpinningBlade(getPlayerNo(), x1, y1)); + } + break; + + case 3: + { + Projectile::setNextID(projID); + createProjectile(new GroundStab(getPlayerNo(), x1, y1)); + } + break; + + case 4: + { + Projectile::setNextID(projID); + createProjectile(new FinalSmashBlast(getPlayerNo(), x1, y1)); + } + } + } + } + } + + void Ichigo::Load() + { + setFolderPath("Images/Game/Characters/Ichigo/"); + + loadFile("Images/Game/Characters/Ichigo/projectile.png"); + loadFile("Images/Game/Characters/Ichigo/down_blast.png"); + loadFile("Images/Game/Characters/Ichigo/finalsmash_blast.png"); + loadFile("Images/Game/Characters/Ichigo/blade.png"); + + addTwoSidedAnimation("stand", "stand.png", 6, 4, 1); + addTwoSidedAnimation("walk", "walk.png", 6, 4, 1); + addTwoSidedAnimation("run", "run.png", 15, 2, 1); + addTwoSidedAnimation("jump", "jump.png", 8, 6, 1); + addTwoSidedAnimation("jump2", "jump2.png", 14, 6, 1); + addTwoSidedAnimation("land", "land.png", 8, 3, 1); + addTwoSidedAnimation("fall", "fall.png", 30, 1, 1); + addTwoSidedAnimation("hang", "hang.png", 1, 1, 1); + addTwoSidedAnimation("crouch", "crouch.png", 1, 1, 1); + addTwoSidedAnimation("melee_weapon", "melee_weapon.png", 10, 6, 1); + addTwoSidedAnimation("hurt_minor", "hurt_minor.png", 1, 1, 1); + addTwoSidedAnimation("hurt_fly", "hurt_fly.png", 1, 1, 1); + addTwoSidedAnimation("hurt_flip", "hurt_flip.png", 10, 4, 1); + addTwoSidedAnimation("hurt_spin", "hurt_spin.png", 12, 4, 1); + addSingleAnimation("hurt_spin_up", "hurt_spin_up.png", 12, 4, 1); + addTwoSidedAnimation("standard_attack", "standard_attack.png", 14, 5, 1); + addTwoSidedAnimation("standard_attack_finish", "standard_attack_finish.png", 14, 1, 1); + addTwoSidedAnimation("standard_attack2", "standard_attack2.png", 14, 6, 1); + addTwoSidedAnimation("standard_attack3", "standard_attack3.png", 14, 6, 1); + addTwoSidedAnimation("standard_attack_side", "standard_attack_side.png", 12, 6, 1); + addTwoSidedAnimation("standard_attack_up", "standard_attack_up.png", 10, 6, 1); + addTwoSidedAnimation("standard_attack_down", "standard_attack_down.png", 10, 6, 1); + addTwoSidedAnimation("air_attack", "air_attack.png", 10, 6, 1); + addTwoSidedAnimation("air_attack_side", "air_attack_side.png", 10, 6, 1); + addTwoSidedAnimation("air_attack_up", "air_attack_up.png", 10, 6, 1); + addTwoSidedAnimation("air_attack_down", "air_attack_down.png", 10, 6, 1); + addTwoSidedAnimation("special_attack", "special_attack.png", 10, 6, 1); + addTwoSidedAnimation("special_attack_side", "special_attack_side.png", 18, 6, 1); + addTwoSidedAnimation("special_attack_up", "special_attack_up.png", 12, 10, 1); + addTwoSidedAnimation("special_prep_down", "special_prep_down.png", 8, 2, 1); + addTwoSidedAnimation("special_drop_down", "special_drop_down.png", 1, 1, 1); + addTwoSidedAnimation("special_attack_down", "special_attack_down.png", 4, 4, 1); + addTwoSidedAnimation("smash_charge", "smash_charge.png", 8, 4, 1); + addTwoSidedAnimation("smash_attack", "smash_attack.png", 12, 6, 1); + addTwoSidedAnimation("smash_attack_up", "smash_attack_up.png", 12, 4, 1); + addTwoSidedAnimation("smash_attack_down", "smash_attack_down.png", 12, 6, 1); + addTwoSidedAnimation("finalsmash_stand", "finalsmash_stand.png", 6, 4, 1); + addTwoSidedAnimation("finalsmash_run", "finalsmash_run.png", 8, 8, 1); + addTwoSidedAnimation("finalsmash_shoot", "finalsmash_shoot.png", 14, 9, 1); + addTwoSidedAnimation("finalsmash_change", "finalsmash_change.png", 9, 6, 1); + } + + void Ichigo::LoadAttackTypes() + { + addAIAttackType(ATTACK_A, ATTACKTYPE_MELEE, 5); + addAIAttackType(ATTACK_SIDEA, ATTACKTYPE_MELEE, 4); + addAIAttackType(ATTACK_UPA, ATTACKTYPE_UPMELEE, 2); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_MELEE, 1); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_DOWNMELEE, 3); + addAIAttackType(ATTACK_B, ATTACKTYPE_PROJECTILE, 1, true); + addAIAttackType(ATTACK_SIDEB, ATTACKTYPE_SIDEMOVE, 1); + addAIAttackType(ATTACK_UPB, ATTACKTYPE_UPMOVE, 2); + addAIAttackType(ATTACK_UPB, ATTACKTYPE_UPMELEE, 1); + addAIAttackType(ATTACK_DOWNB, ATTACKTYPE_DOWNMELEE, 1); + addAIAttackType(ATTACK_DOWNB, ATTACKTYPE_DOWNMOVE, 2); + addAIAttackType(ATTACK_SIDESMASH, ATTACKTYPE_STRONGMELEE, 2); + addAIAttackType(ATTACK_UPSMASH, ATTACKTYPE_STRONGMELEE, 1); + addAIAttackType(ATTACK_DOWNSMASH, ATTACKTYPE_STRONGMELEE, 1); + addAIAttackType(ATTACK_FINALSMASH,ATTACKTYPE_PROJECTILE, 1); + } + + void Ichigo::setToDefaultValues() + { + charging = 0; + finalSmash = false; + dropDownAttack = false; + } + + boolean Ichigo::checkIfAble() + { + if(finalSmash) + { + return false; + } + return true; + } + + void Ichigo::onAnimationFinish(const String&n) + { + if(n.equals("special_drop_down_left") || n.equals("special_drop_down_right")) + { + // + } + else if(n.equals("standard_attack_left") || n.equals("standard_attack_right")) + { + animFinish(); + switch(playerdir) + { + case LEFT: + changeAnimation("standard_attack_finish_left",FORWARD); + break; + + case RIGHT: + changeAnimation("standard_attack_finish_right",FORWARD); + break; + } + } + else if(n.equals("special_attack_side_left") || n.equals("special_attack_side_right")) + { + xVel = 0; + animFinish(); + AttackTemplates::normalSideA(this, 3,2); + } + else if(n.equals("special_prep_down_left") || n.equals("special_prep_down_right")) + { + if(isOnGround()) + { + GroundStab*stab = new GroundStab(getPlayerNo(),x,y + 2); + AttackTemplates::singleProjectile(this, 14, 1.6, stab); + + addProjectileInfo(3, stab->getID(), x, y + 2); + + switch(playerdir) + { + case LEFT: + changeAnimation("special_attack_down_left",FORWARD); + break; + + case RIGHT: + changeAnimation("special_attack_down_right",FORWARD); + break; + } + } + else + { + dropDownAttack = true; + if(yvelocity < 5) + { + yvelocity = 5; + } + switch(playerdir) + { + case LEFT: + changeAnimation("special_drop_down_left",FORWARD); + break; + + case RIGHT: + changeAnimation("special_drop_down_right",FORWARD); + break; + } + } + } + else if(n.equals("finalsmash_change_left") || n.equals("finalsmash_change_right")) + { + switch(playerdir) + { + case LEFT: + changeAnimation("finalsmash_stand_left",FORWARD); + break; + + case RIGHT: + changeAnimation("finalsmash_stand_right",FORWARD); + break; + } + } + else if(n.equals("finalsmash_stand_left") || n.equals("finalsmash_stand_right")) + { + switch(playerdir) + { + case LEFT: + changeAnimation("finalsmash_run_left", FORWARD); + xVel=-5; + break; + + case RIGHT: + changeAnimation("finalsmash_run_right", FORWARD); + xVel=5; + break; + } + } + else if(n.equals("finalsmash_run_left") || n.equals("finalsmash_run_right")) + { + xVel=0; + switch(playerdir) + { + case LEFT: + changeAnimation("finalsmash_shoot_left", FORWARD); + break; + + case RIGHT: + changeAnimation("finalsmash_shoot_right", FORWARD); + break; + } + FinalSmashBlast*smashBlast = new FinalSmashBlast(getPlayerNo(),x,y); + createProjectile(smashBlast); + + addProjectileInfo(4, smashBlast->getID(), x, y); + } + else if(n.equals("finalsmash_shoot_left") || n.equals("finalsmash_shoot_right")) + { + finalSmash = false; + animFinish(); + AttackTemplates::finishFinalSmash(this); + } + else + { + Player::onAnimationFinish(n); + } + } + + void Ichigo::onGroundCollide() + { + Player::onGroundCollide(); + if(dropDownAttack) + { + dropDownAttack = false; + GroundStab*stab = new GroundStab(getPlayerNo(),x,y + 2); + AttackTemplates::singleProjectile(this, 14, 1.6, stab); + + addProjectileInfo(3, stab->getID(), x, y + 2); + + switch(playerdir) + { + case LEFT: + changeAnimation("special_attack_down_left",FORWARD); + break; + + case RIGHT: + changeAnimation("special_attack_down_right",FORWARD); + break; + } + } + } + + void Ichigo::Update(long gameTime) + { + Player::Update(gameTime); + checkAttacks(); + + if(attacksHolder==12 && !isOnGround()) + { + if(moveLeft>0) + { + x-=3; + } + else if(moveRight>0) + { + x+=3; + } + } + + if(!finalSmash && attacksHolder!=11) + { + updateGravity(); + } + updateFrame(); + + updateMovement(); + + updateHanging(); + updateHurt(); + updateDrop(); + updateAI(); + } + + void Ichigo::Draw(Graphics2D&g, long gameTime) + { + Player::Draw(g, gameTime); + } + + void Ichigo::jump() + { + Player::jump(5.2f,5.8f); + } + + void Ichigo::whilePlayerColliding(Player*collide, byte dir) + { + if(attacksHolder==11) + { + switch(playerdir) + { + case LEFT: + collide->x -= abs(xVel)+1; + break; + + case RIGHT: + collide->x += abs(xVel)+1; + break; + } + } + } + + void Ichigo::onPlayerHit(Player*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + { + switch(attacksHolder) + { + case 0: + //A + if(playerdir==LEFT) + { + causeDamage(collide,4); + collide->y-=3; + collide->x+=3; + x-=2; + causeHurt(collide, RIGHT, 1); + } + break; + + case 2: + //A 2 + if(playerdir==LEFT) + { + causeDamage(collide,4); + collide->y-=3; + collide->x+=3; + x-=4; + causeHurt(collide, RIGHT, 1); + } + break; + + case 11: + //B Side + if(playerdir==LEFT) + { + collide->x-=abs(xVel)+1; + } + break; + + case 15: + //Smash Side + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,5,((float)smashPower/6), -1,3,((float)smashPower/7)); + causeHurt(collide, RIGHT, 8); + } + break; + + case 16: + //Smash Up + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,2,((float)smashPower/7), -1,5,((float)smashPower/5)); + causeHurt(collide, RIGHT, 8); + } + break; + + case 17: + //Smash Down + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,5,((float)smashPower/5), -1,5,((float)smashPower/5)); + causeHurt(collide, RIGHT, 8); + } + break; + } + } + break; + + case DIR_RIGHT: + { + switch(attacksHolder) + { + case 0: + //A + if(playerdir==RIGHT) + { + causeDamage(collide,4); + collide->y-=3; + collide->x-=3; + x+=2; + causeHurt(collide, LEFT, 1); + } + break; + + case 1: + //A 2 + if(playerdir==RIGHT) + { + causeDamage(collide,4); + collide->y-=3; + collide->x-=3; + x+=4; + causeHurt(collide, LEFT, 1); + } + break; + + case 11: + //B Side + if(playerdir==RIGHT) + { + collide->x+=abs(xVel)+1; + } + break; + + case 15: + //Smash Side + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,5,((float)smashPower/6), -1,3,((float)smashPower/7)); + causeHurt(collide, LEFT, 8); + } + break; + + case 16: + //Smash Up + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,2,((float)smashPower/7), -1,5,((float)smashPower/5)); + causeHurt(collide, LEFT, 8); + } + break; + + case 17: + //Smash Down + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,5,((float)smashPower/5), -1,5,((float)smashPower/5)); + causeHurt(collide, LEFT, 8); + } + break; + } + } + break; + + case DIR_UP: + { + switch(attacksHolder) + { + case 0: + //A + causeDamage(collide,4); + collide->y-=3; + switch(playerdir) + { + case LEFT: + collide->x+=5; + x-=2; + causeHurt(collide, RIGHT, 1); + break; + + case RIGHT: + collide->x-=5; + x+=2; + causeHurt(collide, LEFT, 1); + break; + } + break; + + case 1: + //A 2 + causeDamage(collide,4); + collide->y-=3; + switch(playerdir) + { + case LEFT: + collide->x+=5; + x-=4; + causeHurt(collide, RIGHT, 1); + break; + + case RIGHT: + collide->x-=5; + x+=4; + causeHurt(collide, LEFT, 1); + break; + } + break; + + case 16: + //Smash Up + causeDamage(collide,smashPower); + causeHurtLaunch(collide,0,0,0, -1,6,((float)smashPower/6)); + causeHurt(collide, collide->getPlayerDir(), 8); + break; + } + } + break; + + case DIR_DOWN: + { + switch(attacksHolder) + { + case 0: + //A + causeDamage(collide,4); + collide->y-=3; + switch(playerdir) + { + case LEFT: + collide->x+=5; + x-=2; + causeHurt(collide, RIGHT, 1); + break; + + case RIGHT: + collide->x-=5; + x+=2; + causeHurt(collide, LEFT, 1); + break; + } + break; + + case 1: + //A 2 + causeDamage(collide,4); + collide->y-=3; + switch(playerdir) + { + case LEFT: + collide->x+=5; + x-=4; + causeHurt(collide, RIGHT, 1); + break; + + case RIGHT: + collide->x-=5; + x+=4; + causeHurt(collide, LEFT, 1); + break; + } + break; + + case 15: + //Smash Side + switch(playerdir) + { + case LEFT: + if(collide->x < x) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,5,((float)smashPower/6), -1,3,((float)smashPower/7)); + causeHurt(collide, RIGHT, 8); + } + break; + + case RIGHT: + if(collide->x > x) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,5,((float)smashPower/6), -1,3,((float)smashPower/7)); + causeHurt(collide, RIGHT, 8); + } + break; + } + break; + + case 17: + //Smash Down + causeDamage(collide,smashPower); + causeHurtLaunch(collide,0,0,0, 1,6,((float)smashPower/5)); + causeHurt(collide, collide->getPlayerDir(), smashPower/5); + break; + } + } + break; + } + } + + void Ichigo::onFinishCharge() + { + // + } + + void Ichigo::doChargingAttack(byte button) + { + if(charging==1) + { + destroyCharge(); + Blast*blast = new Blast(getPlayerNo(), x, y); + blast->Scale = (float)smashPower/100; + oldSmashPower = smashPower; + createProjectile(blast); + + addProjectileInfo(1, blast->getID(), x, y); + + charging = 0; + switch(playerdir) + { + case LEFT: + changeAnimation("special_attack_left",FORWARD); + break; + + case RIGHT: + changeAnimation("special_attack_right",FORWARD); + break; + } + } + } + + void Ichigo::attackA() + { + addAttackInfo(DIR_LEFT, 2, LEFT, 4, 4, -1,3,5, -1,2,3); + addAttackInfo(DIR_RIGHT,2,RIGHT, 4, 4, 1,3,5, -1,2,3); + addAttackInfo(DIR_LEFT, 6, LEFT, 12, 4, -1,3,3, -1,2,3); + addAttackInfo(DIR_RIGHT,6,RIGHT, 12, 4, 1,3,3, -1,2,3); + addAttackInfo(DIR_UP, 2, LEFT, 4, 4, -1,3,5, -1,2,3); + addAttackInfo(DIR_UP, 2,RIGHT, 4, 4, 1,3,5, -1,2,3); + addAttackInfo(DIR_UP, 6, LEFT, 12, 4, -1,2,3, -1,3,3); + addAttackInfo(DIR_UP, 6,RIGHT, 12, 4, 1,2,3, -1,3,3); + addAttackInfo(DIR_DOWN, 2, LEFT, 4, 4, -1,3,5, -1,2,3); + addAttackInfo(DIR_DOWN, 2,RIGHT, 4, 4, 1,3,5, -1,2,3); + addAttackInfo(DIR_DOWN, 6, LEFT, 12, 4, -1,2,3, 1,3,3); + addAttackInfo(DIR_DOWN, 6,RIGHT, 12, 4, 1,2,3, 1,2,3); + + if(!checkItemUse()) + { + if(isOnGround()) + { + AttackTemplates::combo3A(this, 7, 0,1.2, 1,1.1, 2,2.3); + } + else + { + AttackTemplates::normalAirA(this, 6,0.9); + } + } + } + + void Ichigo::attackSideA() + { + addAttackInfo(DIR_LEFT, 3, LEFT, 12, 5, -1,2,4, -1,4,4); + addAttackInfo(DIR_RIGHT,3,RIGHT, 12, 5, 1,2,4, -1,4,4); + addAttackInfo(DIR_LEFT, 7, LEFT, 10, 5, -1,3,3, -1,3,3); + addAttackInfo(DIR_RIGHT,7,RIGHT, 10, 5, 1,3,3, -1,3,3); + addAttackInfo(DIR_UP, 3, LEFT, 12, 5, -1,2,3, -1,5,5); + addAttackInfo(DIR_UP, 3,RIGHT, 12, 5, 1,2,3, -1,5,5); + addAttackInfo(DIR_UP, 7, LEFT, 10, 5, -1,3,3, -1,3,3); + addAttackInfo(DIR_UP, 7,RIGHT, 10, 5, 1,3,3, -1,3,3); + addAttackInfo(DIR_DOWN, 3, LEFT, 12, 5, -1,2,3, 1,5,5); + addAttackInfo(DIR_DOWN, 3,RIGHT, 12, 5, 1,2,3, 1,5,5); + + if(!checkItemUseSide()) + { + if(isOnGround()) + { + AttackTemplates::normalSideA(this, 3,2.25); + } + else + { + AttackTemplates::normalAirSideA(this, 7,2.23); + } + } + } + + void Ichigo::attackUpA() + { + addAttackInfo(DIR_LEFT, 8, LEFT, 13, 6, -1,3.2f,3.4f, -1,2.9f,3.8f); + addAttackInfo(DIR_RIGHT,8,RIGHT, 13, 6, 1,3.2f,3.4f, -1,2.9f,3.8f); + addAttackInfo(DIR_UP, 4, LEFT, 9, 6, -1,1.2f,1.4f, -1,4,3.8f); + addAttackInfo(DIR_UP, 4,RIGHT, 9, 6, 1,1.2f,1.4f, -1,4,3.8f); + addAttackInfo(DIR_UP, 8, LEFT, 13, 6, -1,2.1f,2.3f, -1,4.5f,3.8f); + addAttackInfo(DIR_UP, 8,RIGHT, 13, 6, 1,2.1f,2.3f, -1,4.5f,3.8f); + addAttackInfo(DIR_DOWN, 4, LEFT, 9, 6, 0,0,0, -1,4,6); + addAttackInfo(DIR_DOWN, 4,RIGHT, 9, 6, 0,0,0, -1,4,6); + addAttackInfo(DIR_DOWN, 8, LEFT, 13, 6, 0,0,0, -1,4.5f,6); + addAttackInfo(DIR_DOWN, 8,RIGHT, 13, 6, 0,0,0, -1,4.5f,6); + + if(isOnGround()) + { + AttackTemplates::normalUpA(this, 4,1.94); + } + else + { + AttackTemplates::normalAirUpA(this, 8,2.36); + } + } + + void Ichigo::attackDownA() + { + addAttackInfo(DIR_LEFT, 5, LEFT, 9, 5, -1,3,6, -1,2,3); + addAttackInfo(DIR_RIGHT,5,RIGHT, 9, 5, 1,3,6, -1,2,3); + addAttackInfo(DIR_LEFT, 9, LEFT, 12, 6, 0,0,0, -1,5,6); + addAttackInfo(DIR_RIGHT,9,RIGHT, 12, 6, 0,0,0, -1,5,6); + addAttackInfo(DIR_DOWN, 9, LEFT, 12, 6, 0,0,0, 1,5,6); + addAttackInfo(DIR_DOWN, 9,RIGHT, 12, 6, 0,0,0, 1,5,6); + + if(isOnGround()) + { + AttackTemplates::normalDownA(this, 5,2.24); + } + else + { + AttackTemplates::normalAirDownA(this, 9,2.83); + } + } + + void Ichigo::attackB() + { + if(!bUp) + { + if((canFinalSmash()) && (isOnGround())) + { + attackFinalSmash(); + } + else + { + AttackTemplates::chargeB(this, 30, 100, 30); + attacksHolder=10; + attacksPriority=0; + charging = 1; + switch(playerdir) + { + case LEFT: + changeAnimation("smash_charge_left",FORWARD); + break; + + case RIGHT: + changeAnimation("smash_charge_right",FORWARD); + break; + } + } + } + } + + void Ichigo::attackSideB() + { + if(!bUp) + { + AttackTemplates::dashSideB(this, 11, 1, 9); + } + } + + void Ichigo::attackUpB() + { + if(!bUp) + { + AttackTemplates::rehitUpB2(this, 12, 4, 2, 0); + SpinningBlade*blade = new SpinningBlade(getPlayerNo(),x, y-((float)4*Scale)); + createProjectile(blade); + + addProjectileInfo(2, blade->getID(), x, y-((float)4*Scale)); + + yvelocity=0; + xvelocity=0; + } + } + + void Ichigo::attackDownB() + { + if(!bUp) + { + AttackTemplates::prepareDownB(this, 13, 0); + } + } + + void Ichigo::attackSideSmash(byte type) + { + if((!checkItemUseSmash(type))&&(!bUp)) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,15,3.49,type,1,18,11,20); + } + else + { + attackSideA(); + } + } + } + + void Ichigo::attackUpSmash(byte type) + { + if(!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,16,3.65,type,2,17,11,20); + } + else + { + attackUpA(); + } + } + } + + void Ichigo::attackDownSmash(byte type) + { + if(!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,17,3.48,type,3,16,11,20); + } + else + { + attackDownA(); + } + } + } + + void Ichigo::attackFinalSmash() + { + addAttackInfo(DIR_LEFT, 18, LEFT, 10, 9, -1,5,8, -1,5,8); + addAttackInfo(DIR_RIGHT,18,RIGHT, 10, 9, 1,5,8, -1,5,8); + + if(isOnGround()) + { + yVel=0; + chargeSmash=0; + smashPower=0; + finalSmash = true; + AttackTemplates::finalSmash(this, 18); + destroyCharge(); + switch(playerdir) + { + case 1: + changeAnimation("finalsmash_change_left", FORWARD); + attacksPriority=7; + break; + + case 2: + changeAnimation("finalsmash_change_right", NO_CHANGE); + attacksPriority=7; + break; + } + } + else + { + attackB(); + } + } + + Ichigo::Blast::Blast(byte playerNo, float x1, float y1) : Projectile(playerNo, x1, y1) + { + Animation*anim; + anim = new Animation("left",1,"Images/Game/Characters/Ichigo/projectile.png"); + addAnimation(anim); + + anim = new Animation("right",1,"Images/Game/Characters/Ichigo/projectile.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case LEFT: + xvelocity = -5; + changeAnimation("left",FORWARD); + break; + + case RIGHT: + xvelocity = 5; + changeAnimation("right",FORWARD); + break; + } + startX = x; + + setLayer(LAYER_MIDDLEUPPER); + } + + Ichigo::Blast::~Blast() + { + // + } + + void Ichigo::Blast::Update(long gameTime) + { + Projectile::Update(gameTime); + if(abs(startX - x)>240) + { + destroy(); + } + } + + void Ichigo::Blast::onPlayerHit(Player*collide, byte dir) + { + int smashPower = Global::getPlayerActor(getPlayerNo())->getSmashPower(); + if(isHittable(collide,dir)) + { + causeDamage(collide,5); + switch(itemdir) + { + case LEFT: + causeHurtLaunch(collide, -1,2.5f,((float)smashPower/5), -1,2.5f,((float)smashPower/5)); + causeHurt(collide, RIGHT, 4); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,2.5f,((float)smashPower/5), -1,2.5f,((float)smashPower/5)); + causeHurt(collide, LEFT, 4); + break; + } + destroy(); + } + } + + Ichigo::SpinningBlade::SpinningBlade(byte playerNo, float x1, float y1) : Projectile(playerNo,x1,y1) + { + Animation*anim; + + anim = new Animation("left",12,8,1); + anim->addFrame("Images/Game/Characters/Ichigo/blade.png"); + addAnimation(anim); + + anim = new Animation("right",12,8,1); + anim->addFrame("Images/Game/Characters/Ichigo/blade.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case LEFT: + changeAnimation("left",FORWARD); + break; + + case RIGHT: + changeAnimation("right",FORWARD); + break; + } + + Scale = Global::getPlayerActor(playerNo)->Scale; + + setLayer(LAYER_MIDDLELOWER); + + hits=0; + } + + Ichigo::SpinningBlade::~SpinningBlade() + { + // + }; + + void Ichigo::SpinningBlade::Update(long gameTime) + { + Player*owner = Global::getPlayerActor(getPlayerNo()); + + x = owner->x; + y = owner->y - ((float)4*owner->Scale); + + if(owner->isHurt() || owner->isHanging()) + { + destroy(); + } + + Projectile::Update(gameTime); + } + + void Ichigo::SpinningBlade::Draw(Graphics2D&g, long gameTime) + { + Player*owner = Global::getPlayerActor(getPlayerNo()); + + x = owner->x; + y = owner->y - ((float)4*owner->Scale); + + Projectile::Draw(g, gameTime); + } + + void Ichigo::SpinningBlade::onAnimationFinish(const String&n) + { + Player*owner = Global::getPlayerActor(getPlayerNo()); + owner->yvelocity = owner->yVel; + owner->yVel = 0; + destroy(); + } + + void Ichigo::SpinningBlade::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + Player*playr = Global::getPlayerActor(getPlayerNo()); + switch(playr->getPlayerDir()) + { + case LEFT: + //B Up + switch(hits) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + causeDamage(collide,2); + collide->y=y-((height/2)+(collide->height/2)+2); + hits+=1; + causeHurt(collide, collide->getPlayerDir(), 1); + break; + + case 6: + causeDamage(collide,2); + playr->yvelocity=-2; + hits+=1; + collide->yvelocity=0; + causeHurtLaunch(collide,0,0,0, -1,5,3); + causeHurt(collide, collide->getPlayerDir(), 3); + break; + } + break; + + case RIGHT: + //B Up + switch(hits) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + causeDamage(collide,2); + //collide->y=y-((height/2)+(collide->height/2)+12); + collide->y=y-((height/2)+(collide->height/2)+2); + hits+=1; + causeHurt(collide, collide->getPlayerDir(), 1); + break; + + case 6: + causeDamage(collide,2); + playr->yvelocity=-2; + hits+=1; + collide->yvelocity=0; + causeHurtLaunch(collide,0,0,0, -1,5,3); + causeHurt(collide, collide->getPlayerDir(), 3); + break; + } + break; + } + } + } + + Ichigo::GroundStab::GroundStab(byte playerNo, float x1, float y1) : Projectile(playerNo, x1,y1) + { + Animation*anim; + anim = new Animation("normal",6,4,1); + anim->addFrame("Images/Game/Characters/Ichigo/down_blast.png"); + addAnimation(anim); + changeAnimation("normal",FORWARD); + + setLayer(LAYER_MIDDLEUPPER); + } + + Ichigo::GroundStab::~GroundStab() + { + // + } + + void Ichigo::GroundStab::onPlayerHit(Player*collide, byte dir) + { + dir = getDir2(x,y,collide->x,collide->y); + if(isHittable(collide,dir)) + { + switch(dir) + { + case DIR_LEFT: + causeDamage(collide,11); + causeHurtLaunch(collide, -1,4,3, -1,3,3); + causeHurt(collide, RIGHT, 4); + break; + + case DIR_RIGHT: + causeDamage(collide,11); + causeHurtLaunch(collide, 1,4,3, -1,3,3); + causeHurt(collide, LEFT, 4); + break; + + case DIR_UP: + causeDamage(collide,11); + causeHurtLaunch(collide, 0,0,0, -1,4,5); + causeHurt(collide, collide->getPlayerDir(), 4); + break; + + case DIR_DOWN: + causeDamage(collide,11); + causeHurtLaunch(collide, 0,0,0, 1,4,5); + causeHurt(collide, collide->getPlayerDir(), 4); + break; + } + } + } + + void Ichigo::GroundStab::onAnimationFinish(const String&n) + { + if(n.equals("normal")) + { + destroy(); + } + } + + Ichigo::FinalSmashBlast::FinalSmashBlast(byte playerNo, float x1, float y1) : Projectile(playerNo, x1,y1) + { + Scale = 1.6f; + + addAnimation(new Animation("left",1,"Images/Game/Characters/Ichigo/finalsmash_blast.png")); + Animation*anim = new Animation("right",1,"Images/Game/Characters/Ichigo/finalsmash_blast.png"); + anim->mirror(true); + addAnimation(anim); + + setLayer(LAYER_MIDDLEUPPER); + + switch(itemdir) + { + case LEFT: + changeAnimation("left",FORWARD); + xvelocity = -5.5f; + break; + + case RIGHT: + changeAnimation("right",FORWARD); + xvelocity = 5.5f; + break; + } + } + + Ichigo::FinalSmashBlast::~FinalSmashBlast() + { + // + } + + void Ichigo::FinalSmashBlast::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + switch(dir) + { + case DIR_LEFT: + causeDamage(collide,34); + causeHurtLaunch(collide, -1,6,8, -1,6,8); + causeHurt(collide, RIGHT, 9); + break; + + case DIR_RIGHT: + causeDamage(collide,34); + causeHurtLaunch(collide, 1,6,8, -1,6,8); + causeHurt(collide, LEFT, 9); + break; + + case DIR_UP: + causeDamage(collide, 34); + causeHurtLaunch(collide, 0,0,0, -1,6,8); + causeHurt(collide, collide->getPlayerDir(), 9); + break; + + case DIR_DOWN: + causeDamage(collide, 34); + causeHurtLaunch(collide, 0,0,0, 1,6,8); + causeHurt(collide, collide->getPlayerDir(), 9); + break; + } + } + } +} \ No newline at end of file diff --git a/SmashBros/Ichigo.h b/SmashBros/Ichigo.h new file mode 100755 index 0000000..2f436db --- /dev/null +++ b/SmashBros/Ichigo.h @@ -0,0 +1,113 @@ +#include "Player.h" + +#pragma once + +namespace SmashBros +{ + class Ichigo : public Player + { + private: + typedef struct + { + byte type; + int projID; + float x; + float y; + } ProjectileInfo; + + void addProjectileInfo(byte type, int projID, float x, float y); + + ArrayList createdProjectiles; + + int oldSmashPower; + + class Blast : public Projectile + { + private: + float startX; + + public: + Blast(byte playerNo, float x1, float y1); + virtual ~Blast(); + + virtual void Update(long gameTime); + + virtual void onPlayerHit(Player*collide, byte dir); + }; + + class SpinningBlade : public Projectile + { + private: + int hits; + + public: + SpinningBlade(byte playerNo, float x1, float y1); + virtual ~SpinningBlade(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void onAnimationFinish(const String&n); + virtual void onPlayerHit(Player*collide, byte dir); + }; + + class GroundStab : public Projectile + { + public: + GroundStab(byte playerNo, float x1, float y1); + virtual ~GroundStab(); + + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onAnimationFinish(const String&n); + }; + + class FinalSmashBlast : public Projectile + { + public: + FinalSmashBlast(byte playerNo, float x1, float y1); + ~FinalSmashBlast(); + + virtual void onPlayerHit(Player*collide, byte dir); + }; + + byte charging; + boolean finalSmash; + boolean dropDownAttack; + + public: + Ichigo(float x1, float y1, byte playerNo, byte team); + virtual ~Ichigo(); + + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void Load(); + virtual void LoadAttackTypes(); + virtual void setToDefaultValues(); + virtual boolean checkIfAble(); + virtual void onAnimationFinish(const String&n); + virtual void onGroundCollide(); + + virtual void jump(); + virtual void whilePlayerColliding(Player*collide, byte dir); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onFinishCharge(); + virtual void doChargingAttack(byte button); + + virtual void attackA(); + virtual void attackSideA(); + virtual void attackUpA(); + virtual void attackDownA(); + virtual void attackB(); + virtual void attackSideB(); + virtual void attackUpB(); + virtual void attackDownB(); + virtual void attackSideSmash(byte type); + virtual void attackUpSmash(byte type); + virtual void attackDownSmash(byte type); + virtual void attackFinalSmash(); + }; +} \ No newline at end of file diff --git a/SmashBros/Item.cpp b/SmashBros/Item.cpp new file mode 100755 index 0000000..9053b5f --- /dev/null +++ b/SmashBros/Item.cpp @@ -0,0 +1,1422 @@ +#include "Item.h" +#include "Global.h" +#include "ItemManager.h" +#include "ProjectileManager.h" +#include "Global.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + int Item::nextID = 0; + + Item::Item(float x1, float y1, long liveTime, byte type) : GameElement(x1,y1) + { + this->id = nextID; + nextID++; + if(nextID == INTEGER_MAX) + { + nextID = 0; + } + while(!ItemManager::checkIDAvailable(nextID)) + { + nextID++; + if(nextID == INTEGER_MAX) + { + nextID = 0; + } + } + + Console::WriteLine((String)"Item created with ID " + id); + + index = 0; + + this->type = type; + this->collideType = COLLIDE_BOX; + + itemNo = 0; + weight = 0; + finishTime = 0; + dead = false; + isSolid = false; + accelGrav = true; + ignoreGoThrough = false; + bound = true; + canCarry = true; + checkHits = false; + held = false; + ownerNo = 0; + holderNo = 0; + offsetX = 0; + offsetY = 0; + + groundColliding = false; + prevGroundColliding = false; + + playerCollisions = CollisionManager(); + playerHits = CollisionManager(); + + this->finishTime = Global::getWorldTime() + liveTime; + + dead = false; + } + + Item::~Item() + { + if(!dead && P2PDataManager::isEnabled()) + { + ItemManager::destroyedItems.add(this->id); + } + dead = true; + } + + int Item::getID() + { + return this->id; + } + + void Item::setNextID(int itemID) + { + nextID = itemID; + } + + //x, y, animIndex, frame, bools, ownerNo, holderNo + //4, 4, 4, 4, 1, 1 1 = 31 + void Item::handleAddP2PData(DataVoid&data) + { + int frame = getAnimation()->getCurrentFrame(); + int animIndex = getAnimIndex(); + Bitset bools; + //visible + if(isVisible()) + { + bools.set(0, true); + } + else + { + bools.set(0, false); + } + byte boolsByte = bools.getByte(); + + data.add(&x, sizeof(x)); + data.add(&y, sizeof(y)); + data.add(&animIndex, sizeof(animIndex)); + data.add(&frame, sizeof(frame)); + data.add(&boolsByte, sizeof(boolsByte)); + data.add(&ownerNo, sizeof(ownerNo)); + data.add(&holderNo, sizeof(holderNo)); + + DataVoid newData; + addP2PData(newData); + data.add(newData); + } + + void Item::handleSetP2PData(byte*&data) + { + //x + x = DataVoid::toFloat(data); + data += sizeof(float); + + //y + y = DataVoid::toFloat(data); + data += sizeof(float); + + //animIndex + int animIndex = DataVoid::toInt(data); + changeAnimation(animIndex, STOPPED); + data += sizeof(int); + + //frame + int frame = DataVoid::toInt(data); + getAnimation()->setCurrentFrame(frame); + data += sizeof(int); + + //bools + byte boolsByte = data[0]; + Bitset bools(boolsByte); + //visibility + if(bools.get(0)) + { + setVisible(true); + } + else + { + setVisible(false); + } + data += sizeof(byte); + + //ownerNo + ownerNo = data[0]; + data += sizeof(byte); + + //holderNo + holderNo = data[0]; + data += sizeof(byte); + + setP2PData(data); + } + + void Item::addP2PData(DataVoid&data) + { + //Open for implementation + } + + void Item::setP2PData(byte*&data) + { + //Open for implementation + } + + void Item::addAnimation(Animation*a) + { + ArrayList animFiles = a->getAllFilenames(); + for(int i=0; icanCarry = toggle; + } + + boolean Item::canPickUp() + { + return true; + } + + int Item::getItemNo() + { + return itemNo; + } + + void Item::setItemOwner(byte owner) + { + this->ownerNo = owner; + } + + byte Item::getItemOwner() + { + return ownerNo; + } + + byte Item::getItemHolder() + { + return holderNo; + } + + void Item::setBoundToHolder(boolean toggle) + { + bound = toggle; + if(held) + { + Player*playr = getPlayer(); + if(playr!=null) + { + switch(playr->getPlayerDir()) + { + case Player::LEFT: + x = playr->x - (float)((playr->itemOffsetX + offsetX)*playr->Scale); + break; + + case Player::RIGHT: + x = playr->x + (float)((playr->itemOffsetX + offsetX)*playr->Scale); + } + y = playr->y + (float)((playr->itemOffsetY + offsetY)*playr->Scale); + } + } + } + + void Item::setHoldOffset(float x1, float y1) + { + offsetX = x1; + offsetY = y1; + } + + Player*Item::getPlayer() + { + if(held) + { + return Global::getPlayerActor(getItemHolder()); + } + return null; + } + + boolean Item::isHeld() + { + return held; + } + + void Item::setSolid(boolean toggle) + { + isSolid = toggle; + } + + boolean Item::chargeSmash() + { + return false; + } + + boolean Item::use(byte attackDir) + { + return false; + } + + void Item::pickUp(Player*collide) + { + if(type!= TYPE_FOOD) + { + if(bound) + { + x = collide->x; + y = collide->y; + } + yvelocity = 0; + xvelocity = 0; + held = true; + holderNo = collide->getPlayerNo(); + ownerNo = collide->getPlayerNo(); + } + onPickUp(collide); + } + + void Item::discard() + { + Player*playr = getPlayer(); + held = false; + holderNo = 0; + onDiscard(playr); + } + + void Item::onPickUp(Player*collide) + { + // + } + + void Item::onDiscard(Player*discarder) + { + // + } + + void Item::onPlayerCollide(Player*collide) + { + // + } + + void Item::whilePlayerColliding(Player*collide) + { + // + } + + void Item::finishPlayerCollide(Player*collide) + { + // + } + + void Item::onPlayerHit(Player*collide, byte dir) + { + // + } + + void Item::whilePlayerHitting(Player*collide, byte dir) + { + // + } + + void Item::finishPlayerHit(Player*collide) + { + // + } + + void Item::onPlatformCollide(Platform*collide, byte dir) + { + // + } + + void Item::whilePlatformColliding(Platform*collide, byte dir) + { + // + } + + void Item::finishPlatformCollide(Platform*collide, byte dir) + { + // + } + + void Item::onGroundCollide() + { + // + } + + void Item::whileGroundColliding() + { + // + } + + void Item::finishGroundCollide() + { + // + } + + void Item::onHolderHurt() + { + // + } + + boolean Item::holderCanDo() + { + return true; + } + + void Item::onCreate() + { + // + } + + void Item::onDestroy() + { + // + } + + void Item::doPowerUp(Player*collide, byte type, float value) + { + switch(type) + { + case POWERUP_FINALSMASH: + Global::smashBallOnField = false; + Global::playerHasSmashBall = true; + collide->canFinalsmash = true; + break; + + case POWERUP_HEAL: + collide->percent-=(int)value; + if(collide->percent<0) + { + collide->percent = 0; + } + break; + } + } + + void Item::platformCollision(Platform*collide, byte dir) + { + if(dir>0) + { + if(prevPlatformColliding[dir-1]) + { + whilePlatformColliding(collide, dir); + } + else + { + onPlatformCollide(collide, dir); + whilePlatformColliding(collide, dir); + } + } + else + { + if(prevPlatformColliding[dir-1]) + { + finishPlatformCollide(collide,dir); + } + } + } + + void Item::ignoreGoThroughPlatforms(boolean toggle) + { + ignoreGoThrough = toggle; + } + + void Item::Update(long gameTime) + { + GameElement::Update(gameTime); + /*if(isSolid || checkHits || collideType == COLLIDE_SOLID) + { + updateBooleanGrid(); + }*/ + if(!held) + { + if(accelGrav) + { + yvelocity+=weight; + } + else + { + yvelocity = weight; + } + Global::currentStage->itemPlatformCollisions(this); + } + for(int j=0; j<=Global::possPlayers; j++) + { + if(Global::characters[j]!=null) + { + checkPlayerCollision(Global::characters[j]); + } + } + if(held) + { + if(bound) + { + Player*playr = getPlayer(); + if(playr!=null) + { + switch(playr->getPlayerDir()) + { + case Player::LEFT: + x = playr->x - (float)((playr->itemOffsetX + offsetX)*playr->Scale); + break; + + case Player::RIGHT: + x = playr->x + (float)((playr->itemOffsetX + offsetX)*playr->Scale); + } + y = playr->y + (float)((playr->itemOffsetY + offsetY)*playr->Scale); + } + } + } + if(Global::getWorldTime() >= finishTime && !held) + { + destroy(); + } + Rect borders = Global::currentStage->getBorders(); + int left = Global::currentStage->x + borders.left; + int top = Global::currentStage->y + borders.top; + int right = Global::currentStage->x + borders.right; + int bottom = Global::currentStage->y + borders.bottom; + if((x+width/2)right || (y+height/2)bottom) + { + destroy(); + } + } + + void Item::Draw(Graphics2D&g, long gameTime) + { + if(held && bound) + { + Player*playr = getPlayer(); + if(playr!=null) + { + switch(playr->getPlayerDir()) + { + case Player::LEFT: + x = playr->x - (float)((playr->itemOffsetX + offsetX)*playr->Scale); + break; + + case Player::RIGHT: + x = playr->x + (float)((playr->itemOffsetX + offsetX)*playr->Scale); + } + y = playr->y + (float)((playr->itemOffsetY + offsetY)*playr->Scale); + } + } + GameElement::Draw(g, gameTime); + } + + void Item::checkPlayerCollision(Player*playr) + { + boolean colliding = false; + boolean pxlColliding = false; + byte pxlDir = 0; + if(isSolid) + { + byte dir = 0; + if(held && checkHits) + { + dir = isColliding2(playr); + } + else + { + dir = solidElementCollision(playr); + } + if(dir>0) + { + colliding = true; + if(checkHits && hitState) + { + pxlColliding = true; + pxlDir = dir; + } + } + } + else + { + if(Actor::rectsColliding(playr->getHitbox())) + { + colliding = true; + } + if(checkHits && hitState) + { + pxlDir = isColliding2(playr); + if(pxlDir>0) + { + pxlColliding = true; + } + } + } + if(colliding) + { + if(playerCollisions.isColliding(playr->playerNo)) + { + if(isHittable(playr)) + { + whilePlayerColliding(playr); + } + } + else + { + if(isHittable(playr)) + { + onPlayerCollide(playr); + } + } + playerCollisions.addCollision(playr->playerNo); + + if(canCarry) + { + playr->itemCollidingIndex=this->index; + } + } + else + { + if(playerCollisions.isColliding(playr->playerNo)) + { + finishPlayerCollide(playr); + } + playerCollisions.removeCollision(playr->playerNo); + } + + if(pxlColliding && checkHits && hitState && holderNo != playr->getPlayerNo()) + { + if(playerHits.isColliding(playr->playerNo)) + { + if(isHittable(playr)) + { + whilePlayerHitting(playr, pxlDir); + } + } + else + { + if(isHittable(playr)) + { + onPlayerHit(playr, pxlDir); + } + playerHits.addCollision(playr->playerNo); + } + } + else if(checkHits && playerHits.isColliding(playr->playerNo)) + { + finishPlayerHit(playr); + playerHits.removeCollision(playr->playerNo); + } + } + + void Item::destroy() + { + if(!dead && P2PDataManager::isEnabled()) + { + ItemManager::destroyedItems.add(this->id); + } + dead = true; + setVisible(false); + } + + void Item::createProjectile(Projectile*p) + { + ProjectileManager::AddProjectile(p); + } + + void Item::setHitState(boolean toggle) + { + hitState = toggle; + } + + void Item::updateHitState(boolean toggle) + { + checkHits = toggle; + if(!toggle) + { + playerHits.clear(); + } + } + + void Item::setCollideType(byte type) + { + collideType = type; + } + + void Item::accelerateGravity(boolean toggle) + { + accelGrav = toggle; + } + + boolean Item::isHittable(Player*collide) + { + byte team = 0; + + + Player*playr = getPlayer(); + if(playr!=null) + { + team = playr->getTeam(); + } + + if((collide->getPlayerNo()>0)&&!((Global::teamBattle)&&(team==collide->getTeam())) + &&(holderNo != collide->getPlayerNo())&&(!collide->isInvincible())) + { + return true; + } + return false; + } + + void Item::causeDamage(Player*collide, int amount) + { + boolean canInflict = true; + if(collide->attacksPriority==5) + { + collide->updateHitbox(); + switch(collide->playerdir) + { + case Player::LEFT: + if(xx && PrimitiveActor::getDir(collide->getHitbox(),this)!=PrimitiveActor::DIR_LEFT) + { + boolean inflicted = collide->onItemDeflectDamage(this, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + break; + + case Player::RIGHT: + if(x>collide->x && PrimitiveActor::getDir(collide,this)!=PrimitiveActor::DIR_RIGHT) + { + boolean inflicted = collide->onItemDeflectDamage(this, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + break; + } + } + else if(collide->attacksPriority==6) + { + boolean inflicted = collide->onItemDeflectDamage(this, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + if(canInflict) + { + collide->percent+=amount; + if(collide->percent>999) + { + collide->percent=999; + } + } + } + + void Item::causeHurtLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + if(collide->deflectState) + { + collide->onItemDeflectLaunch(this, xDir, xAmount, xMult, yDir, yAmount, yMult); + } + else + { + //float oldXvel; + //float oldYvel; + float newyVel=(float)(yDir*(yAmount+(yMult*(collide->percent))/100)); + float newxVel=(float)(xDir*(xAmount+(xMult*(collide->percent))/100)); + //Console.WriteLine(this.attacksHolder + ": " + newyVel + ""); + if(newyVel>0) + { + if(newyVel>collide->yvelocity) + { + collide->yvelocity=newyVel; + } + } + else if(newyVel<0) + { + if(newyVelyvelocity) + { + collide->yvelocity=newyVel; + } + } + if(newxVel>0) + { + if(newxVel>collide->xvelocity) + { + collide->xvelocity=newxVel; + } + } + else if(newxVel<0) + { + if(newxVelxvelocity) + { + collide->xvelocity=newxVel; + } + } + collide->y-=1; + if(collide->yvelocity>0 && collide->isOnGround()) + { + collide->yvelocity = -(collide->yvelocity/2); + } + } + } + + void Item::causeHurt(Player*collide, byte dir, int time) + { + if(!collide->deflectState) + { + if(abs(collide->xvelocity)<=3) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + collide->changeAnimation("hurt_spin_up", FORWARD); + } + } + + else if((abs(collide->xvelocity)>3)&&(abs(collide->xvelocity)<7)) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_fly_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_fly_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_fly_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_fly_right", FORWARD); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_right", FORWARD); + break; + } + } + } + + else if(abs(collide->xvelocity)>=7) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", FORWARD); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_right", FORWARD); + break; + } + } + } + collide->xVel=0; + collide->yVel=0; + collide->attackTime=0; + collide->setToDefaultValues(); + collide->chargingAttack=false; + collide->bUp=false; + collide->up=false; + collide->hurt=2; + collide->landing=false; + collide->jumping=false; + //collide->moveLeft=0; + //collide->moveRight=0; + collide->hanging=false; + collide->attacksHolder=-1; + collide->attacksPriority=0; + collide->canDo=false; + collide->hurtTime=Global::worldTime+time; + collide->hurtFrame=4; + collide->runTime=0; + collide->chargeSmash=0; + if(holderNo>0) + { + collide->lastHit = holderNo; + } + else if(ownerNo>0) + { + collide->lastHit = ownerNo; + } + + collide->destroyCharge(); + + if(collide->itemHolding!=null) + { + collide->itemHolding->onHolderHurt(); + } + /*if(itemActor->itemOwner>0) + { + collide.lastHit=itemOwner; + }*/ + } + } + + byte Item::solidPlatformCollision(Platform*collide) + { + if(collideType==COLLIDE_SOLID) + { + //Rectangle rect = this.grid.getAreaRect(); + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)(x-(float)width/2), (int)(y-(float)height/2), width, height); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)(collide->x - collide->width/2),(int)(collide->y - collide->height/2),collide->width,collide->height); + GameEngine::Rectangle collideOverlap = getOverlapRect(r2,r1); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX2 = collideOverlap.x; + int endX2 = collideOverlap.x + collideOverlap.width; + int startY2 = collideOverlap.y; + int endY2 = collideOverlap.y + collideOverlap.height; + + int left1=0; + int right1=0; + int top1=0; + int bottom1=0; + + int left2=0; + int right2=0; + int top2=0; + int bottom2=0; + + int left2_1=0; + int right2_1=0; + int top2_1=0; + int bottom2_1=0; + + int startX1 = overlap.x; + int startY1 = overlap.y; + + int xPnt = startX1; // bounds checker for this + int yPnt = startY1; + + float x1 = ((float)startX1/Scale);//pixel checker starter for this + float y1 = ((float)startY1/Scale); + float incr1 = (float)(1/Scale); + + float x2 = ((float)startX2/collide->Scale);//pixel checker starter for collide + float y2 = ((float)startY2/collide->Scale); + float incr2 = (float)(1/collide->Scale); + + boolean itemCol = false; + boolean colliding = false; + boolean anyCol = false; + + PixelIterator pxlIter(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)collideOverlap.width,(int)collideOverlap.height); + PixelIterator colPxlIter(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY2; cntYright1) + { + right1 = xPnt; + } + if(yPntbottom1) + { + bottom1 = yPnt; + } + } + itemCol = true; + + if(collideAtPoint) + { + if(!colliding) + { + left2 = cntX; + right2 = cntX; + top2 = cntY; + bottom2 = cntY; + } + else + { + if(cntXright2) + { + right2 = cntX; + } + if(cntYbottom2) + { + bottom2 = cntY; + } + } + colliding = true; + } + } + if(collideAtPoint) + { + if(!anyCol) + { + left2_1 = cntX; + right2_1 = cntX; + top2_1 = cntY; + bottom2_1 = cntY; + } + else + { + if(cntXright2_1) + { + right2_1 = cntX; + } + if(cntYbottom2_1) + { + bottom2_1 = cntY; + } + } + anyCol = true; + } + xPnt++; + } + yPnt++; + } + + if(colliding) + { + int w2 = (int)(right2 - left2); + int h2 = (int)(bottom2 - top2); + int w2_1 = (int)(right2_1 - left2_1); + int h2_1 = (int)(bottom2_1 - top2_1); + GameEngine::Rectangle collideOverlap2 = GameEngine::Rectangle((int)left2, top2, w2, h2); + int overlapX = (int)(left2_1 - startX2) + overlap.x + (w2_1/2); + int overlapY = (int)(top2_1 - startY2) + overlap.y + (h2_1/2); + byte dir = getDir2((float)width/2,(float)height/2,(float)overlapX, (float)overlapY); + + byte type = collide->getType(); + if((type == Platform::TYPE_NORMAL)||(type == Platform::TYPE_GOTHROUGH && !ignoreGoThrough && dir == DIR_DOWN)) + { + switch(dir) + { + case DIR_DOWN: + y = (collideOverlap2.y + (collide->y - collide->height/2)) - (float)(bottom1 - (height/2)) + 1; + return DIR_UP; + + case DIR_UP: + y = ((collide->y - collide->height/2) + (collideOverlap2.y + collideOverlap2.height)) + (float)((height/2) - top1) + 1; + return DIR_DOWN; + + case DIR_LEFT: + x = ((collide->x - collide->width/2) + (collideOverlap2.x + collideOverlap2.width)) + (float)((right1) - (width/2)); + xvelocity = 0; + return DIR_RIGHT; + + case DIR_RIGHT: + x = (collideOverlap2.x + (collide->x - collide->width/2)) - (float)((width/2) - left1); + xvelocity = 0; + return DIR_LEFT; + } + } + } + } + } + else if(collideType == COLLIDE_BOX) + { + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)x-width/2, (int)y-height/2, width, height); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)(collide->x - collide->width/2),(int)(collide->y - collide->height/2),collide->width,collide->height); + GameEngine::Rectangle collideOverlap = getOverlapRect(r2,r1); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX = collideOverlap.x; + int endX = collideOverlap.x + collideOverlap.width; + int startY = collideOverlap.y; + int endY = collideOverlap.y + collideOverlap.height; + + int left=0; + int right=0; + int top=0; + int bottom=0; + boolean colliding = false; + + float x2 = ((float)startX/collide->Scale);//pixel checker starter for collide + float y2 = ((float)startY/collide->Scale); + float incr2 = (float)(1/collide->Scale); + + PixelIterator colPxlIter(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY; cntYright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + colliding = true; + } + } + } + + if(colliding) + { + int w = right - left; + int h = bottom - top; + GameEngine::Rectangle collideOverlap2 = GameEngine::Rectangle(left, top, w, h); + int overlapX = (left - startX) + overlap.x + (w/2); + int overlapY = (top - startY) + overlap.y + (h/2); + byte dir = getDir2((float)width/2,(float)height/2,(float)overlapX, (float)overlapY); + + byte type = collide->getType(); + if((type == Platform::TYPE_NORMAL)||(type == Platform::TYPE_GOTHROUGH && !ignoreGoThrough && dir == DIR_DOWN)) + { + switch(dir) + { + case DIR_DOWN: + y = (collideOverlap2.y + (collide->y - (float)collide->height/2)) - ((float)height/2) + 1; + return DIR_UP; + + case DIR_UP: + y = ((collide->y - collide->height/2) + (collideOverlap2.y + collideOverlap2.height)) + height/2 - + height/2; + return DIR_DOWN; + + case DIR_LEFT: + x = ((collide->x - collide->width/2) + (collideOverlap2.x + collideOverlap2.width) + width/2); + return DIR_RIGHT; + + case DIR_RIGHT: + x = (collideOverlap2.x + (collide->x - collide->width/2)) - width/2; + return DIR_LEFT; + } + } + } + } + } + return 0; + } + + byte Item::normalPlatformCollision(Platform*collide) + { + if(collideType == COLLIDE_SOLID) + { + //Rectangle rect = this.grid.getAreaRect(); + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)(x-(float)width/2), (int)(y-(float)height/2), width, height); + WireframeActor*collideBox = collide->getBox(); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)collideBox->x,(int)collideBox->y,collideBox->width,collideBox->height); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + if(overlap.x!=-1) + { + int left=0; + int right=0; + int top=0; + int bottom=0; + + int startX = overlap.x; + int startY = overlap.y; + int endX = overlap.x + overlap.width; + int endY = overlap.y + overlap.height; + + float x1 = ((float)startX/Scale);//pixel checker starter for this + float y1 = ((float)startY/Scale); + float incr1 = (float)(1/Scale); + + boolean itemCol = false; + + PixelIterator pxlIter(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)overlap.width,(int)overlap.height); + + for(int cntY=startY; cntYright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + itemCol = true; + } + } + } + + if(!itemCol) + { + return 0; + } + + byte dir = getDir(r2,r1); + switch(dir) + { + case DIR_UP: + y = (collideBox->y - (float)(bottom - (height/2))); + return DIR_UP; + + case DIR_DOWN: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + y=(collideBox->y+collideBox->height) + (float)((height/2) - top); + } + return DIR_DOWN; + + case DIR_UPLEFT: + case DIR_DOWNLEFT: + case DIR_LEFT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + x = collideBox->x - (float)((width/2) - left); + } + return DIR_LEFT; + + case DIR_UPRIGHT: + case DIR_DOWNRIGHT: + case DIR_RIGHT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + x = (collideBox->x + collideBox->width) + (float)(right - (width/2)); + } + return DIR_RIGHT; + } + } + } + else if(collideType == COLLIDE_BOX) + { + GameEngine::Rectangle rect = GameEngine::Rectangle((int)(x - (float)width/2),(int)(y - (float)height/2), width, height); + WireframeActor*collideBox = collide->getBox(); + GameEngine::Rectangle rect2 = GameEngine::Rectangle((int)collideBox->x,(int)collideBox->y,collideBox->width,collideBox->height); + byte dir = getDir(rect2,rect); + switch(dir) + { + case DIR_UP: + y = ((float)collideBox->y - ((float)((float)rect.height - (y - (float)rect.y))) + 1); + yvelocity=0; + return DIR_UP; + + case DIR_DOWN: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + y=(collideBox->y+collideBox->height - (float)((float)(-(y - rect.y)))); + } + return DIR_DOWN; + + case DIR_UPLEFT: + case DIR_DOWNLEFT: + case DIR_LEFT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + x = (collideBox->x - (float)(((float)rect.width)/2)); + } + return DIR_LEFT; + + case DIR_UPRIGHT: + case DIR_DOWNRIGHT: + case DIR_RIGHT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + x = (collideBox->x + collideBox->width + (float)(((float)rect.width)/2)); + } + return DIR_RIGHT; + } + } + return 0; + } +} \ No newline at end of file diff --git a/SmashBros/Item.h b/SmashBros/Item.h new file mode 100755 index 0000000..1ee438b --- /dev/null +++ b/SmashBros/Item.h @@ -0,0 +1,150 @@ +#include "GameElement.h" +#include "CollisionManager.h" +#include "Platform.h" +#include "Projectile.h" +#include "SmashForwards.h" + +#pragma once + +namespace SmashBros +{ + class Item : public GameElement + { + friend class P2PDataManager; + friend class Player; + friend class Stage; + private: + + static int nextID; + int id; + + byte type; + byte collideType; + + boolean accelGrav; + boolean ignoreGoThrough; + + long finishTime; + + boolean dead; + boolean isSolid; + boolean bound; + boolean canCarry; + boolean held; + byte ownerNo; + byte holderNo; + boolean checkHits; + boolean hitState; + float offsetX; + float offsetY; + + int index; + friend class ItemManager; + + CollisionManager playerCollisions; + CollisionManager playerHits; + + boolean platformColliding[8]; + boolean prevPlatformColliding[8]; + + boolean groundColliding; + boolean prevGroundColliding; + + Platform*currentCollidePlatform[8]; + + void pickUp(Player*collide); + void discard(); + + void platformCollision(Platform*collide, byte dir); + void checkPlayerCollision(Player*playr); + boolean isHittable(Player*collide); + + byte solidPlatformCollision(Platform*collide); + byte normalPlatformCollision(Platform*collide); + + void handleAddP2PData(DataVoid&data); + void handleSetP2PData(byte*&data); + + protected: + int itemNo; + float weight; + + void setItemOwner(byte owner); + void setSolid(boolean toggle); + void ignoreGoThroughPlatforms(boolean toggle); + void createProjectile(Projectile*p); + void setHitState(boolean toggle); + void updateHitState(boolean toggle); + void setCollideType(byte type); + void accelerateGravity(boolean toggle); + void causeDamage(Player*collide, int amount); + void causeHurtLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + void causeHurt(Player*collide, byte dir, int time); + + public: + static const byte ATTACK_NORMAL = 0; + static const byte ATTACK_SIDE = 1; + static const byte ATTACK_SMASH = 2; + + static const byte TYPE_HOLD = 0; + static const byte TYPE_WEAR = 1; + static const byte TYPE_HAT = 2; + static const byte TYPE_WIELD = 3; + static const byte TYPE_FOOD = 4; + + static const byte POWERUP_FINALSMASH = 0; + static const byte POWERUP_HEAL = 1; + + static const byte COLLIDE_BOX = 1; + static const byte COLLIDE_SOLID = 2; + + Item(float x1, float y1, long liveTime, byte type); + virtual ~Item(); + + int getID(); + static void setNextID(int itemID); + + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + virtual void onPickUp(Player*collide); + virtual void onDiscard(Player*discarder); + virtual void onPlayerCollide(Player*collide); + virtual void whilePlayerColliding(Player*collide); + virtual void finishPlayerCollide(Player*collide); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void whilePlayerHitting(Player*collide, byte dir); + virtual void finishPlayerHit(Player*collide); + virtual void onPlatformCollide(Platform*collide, byte dir); + virtual void whilePlatformColliding(Platform*collide, byte dir); + virtual void finishPlatformCollide(Platform*collide, byte dir); + virtual void onGroundCollide(); + virtual void whileGroundColliding(); + virtual void finishGroundCollide(); + virtual void onHolderHurt(); + virtual boolean holderCanDo(); + virtual void onCreate(); + virtual void onDestroy(); + + virtual boolean canPickUp(); + virtual boolean use(byte attackDir); + + void addAnimation(Animation*a); + + void addFileResource(String file); + void canBeCarried(boolean toggle); + int getItemNo(); + byte getItemOwner(); + byte getItemHolder(); + void setBoundToHolder(boolean toggle); + void setHoldOffset(float x1, float y1); + Player*getPlayer(); + boolean isHeld(); + boolean chargeSmash(); + void destroy(); + + void doPowerUp(Player*collide, byte type, float value); + }; +} \ No newline at end of file diff --git a/SmashBros/ItemManager.cpp b/SmashBros/ItemManager.cpp new file mode 100755 index 0000000..419efb2 --- /dev/null +++ b/SmashBros/ItemManager.cpp @@ -0,0 +1,552 @@ +#include "ItemManager.h" +#include "Global.h" +#include "SmashBall.h" +#include "RayGun.h" +#include "HeartContainer.h" +#include "BeamSword.h" +#include "SuperMushroom.h" +#include "PoisonMushroom.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + ArrayList ItemManager::items = ArrayList(); + long ItemManager::spawnTime = 0; + ArrayList ItemManager::files = ArrayList(); + ArrayList ItemManager::createdItems = ArrayList(); + ArrayList ItemManager::destroyedItems = ArrayList(); + + void ItemManager::handleAddP2PData(DataVoid&data) + { + ArrayList justCreated = createdItems; + if(createdItems.size()>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + int totalCreated = createdItems.size(); + data.add(&totalCreated, sizeof(totalCreated)); + + for(int i=0; i otherItems; + for(int i=0; i<=Global::possPlayers; i++) + { + if(Global::characters[i]!=null) + { + Player*playr = Global::characters[i]; + if(playr->itemHolding!=null) + { + otherItems.add(playr->itemHolding); + } + if(playr->itemWearing!=null) + { + otherItems.add(playr->itemWearing); + } + if(playr->itemHatting!=null) + { + otherItems.add(playr->itemHatting); + } + if(playr->itemWielding!=null) + { + otherItems.add(playr->itemWielding); + } + } + } + totalItems+=otherItems.size(); + + if(totalItems>0) + { + bool avail = true; + data.add(&avail, sizeof(avail)); + + DataVoid itemUpdates; + int realTotal = 0; + + for(int i=0; igetID() == justCreated.get(j).itemID) + { + tooSoon = true; + j = justCreated.size(); + } + }*/ + if(!item->dead && !tooSoon) + { + realTotal++; + + int itemID = item->getID(); + //Console::WriteLine((String)"updating item with id " + itemID); + itemUpdates.add(&itemID, sizeof(itemID)); + + item->handleAddP2PData(itemUpdates); + } + else + { + //Console::WriteLine((String)"was gonna send item " + item->getID() + " but it was dead"); + } + } + + for(int i=0; igetID() == justCreated.get(j).itemID) + { + tooSoon = true; + j = justCreated.size(); + } + }*/ + if(!item->dead && !tooSoon) + { + realTotal++; + + int itemID = item->getID(); + //Console::WriteLine((String)"updating item with id " + itemID); + itemUpdates.add(&itemID, sizeof(itemID)); + + item->handleAddP2PData(itemUpdates); + } + else + { + //Console::WriteLine((String)"was gonna send item " + item->getID() + " but it was dead"); + } + } + + data.add(&realTotal, sizeof(realTotal)); + data.add(itemUpdates); + } + else + { + bool avail = false; + data.add(&avail, sizeof(avail)); + } + + if(destroyedItems.size()>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + int total = destroyedItems.size(); + data.add(&total, sizeof(total)); + + for(int i=0; iid = info.itemID; + AddItem(newItem); + Console::WriteLine((String)"Spawned item " + Global::getItemName(info.itemNo) + "with ID " + newItem->id); + } + } + + avail = data[0]; + data += sizeof(bool); + + if(avail) + { + int totalItems = DataVoid::toInt(data); + data += sizeof(int); + + for(int i=0; igetID()) + { + item = checkItem; + j = items.size(); + } + } + + if(item == NULL) + { + //Console::WriteLine("but i didn't fucking have it"); + P2PDataManager::setErrorState(); + Game::showMessage("Error", (String)"An error has occured in ItemManager::handleSetP2PData(byte*&)\n No item to update found with id " + itemID); + String mylog = (String)"items.size() = " + items.size() + '\n'; + for(int j=0; jgetID(); + mylog += (String)"index " + j + ": " + hold; + } + Game::showMessage(mylog); + return; + } + else + { + //Console::WriteLine("and i had it. thank jesus"); + item->handleSetP2PData(data); + } + } + } + + avail = data[0]; + data += sizeof(bool); + + if(avail) + { + int total = DataVoid::toInt(data); + data += sizeof(int); + + for(int i=0; igetID()) + { + item = checkItem; + index = j; + j = items.size(); + } + } + + if(item == NULL) + { + P2PDataManager::setErrorState(); + Game::showMessage("Error", (String)"An error has occured in ItemManager::handleSetP2PData(byte*&)\n No item to destroy found with id " + itemID); + String mylog = (String)"destroyedItems.size() = " + destroyedItems.size() + '\n'; + for(int j=0; jgetID(); + mylog += (String)"index " + j + ": " + hold; + } + Game::showMessage(mylog); + return; + } + else + { + delete item; + items.remove(index); + } + } + } + destroyedItems.clear(); + } + + bool ItemManager::checkIDAvailable(int itemID) + { + for(int i=0; igetID(); + if(check == itemID) + { + return false; + } + } + for(int i=0; i<=Global::possPlayers; i++) + { + Player*playr = Global::characters[i]; + if(playr!=NULL) + { + if(playr->itemHolding!=null) + { + if(itemID == playr->itemHolding->getID()) + { + return false; + } + } + if(playr->itemWearing!=null) + { + if(itemID == playr->itemWearing->getID()) + { + return false; + } + } + if(playr->itemHatting!=null) + { + if(itemID == playr->itemHatting->getID()) + { + return false; + } + } + if(playr->itemWielding!=null) + { + if(itemID == playr->itemWielding->getID()) + { + return false; + } + } + } + } + return true; + } + + void ItemManager::Unload() + { + for(int i=0; iisHeld()) + { + item->onCreate(); + } + item->index = items.size(); + items.add(item); + } + + Item*ItemManager::GetItem(int index) + { + if(index < items.size()) + { + return items.get(index); + } + return null; + } + + int ItemManager::TotalItems() + { + return items.size(); + } + + void ItemManager::RemoveAll() + { + for(int i=0; idestroy(); + items.get(i)->onDestroy(); + delete items.get(i); + } + items.clear(); + destroyedItems.clear(); + createdItems.clear(); + } + + void ItemManager::Update(long gameTime) + { + if(Global::gameType == Global::TYPE_GROUPBRAWL) + { + if(spawnTime==0) + { + spawnTime=Global::getWorldTime()+(int)((GameEngine::random()*300)+50); + } + else + { + if(spawnTime<=Global::getWorldTime()) + { + RandomItemSpawn(); + spawnTime=Global::getWorldTime()+(int)((GameEngine::random()*300)+50); + } + } + } + for(int i=0; i<=Global::possPlayers; i++) + { + if(Global::characters[i]!=null) + { + Global::characters[i]->itemCollidingIndex = -1; + } + } + for(int i=(items.size()-1); i>=0; i--) + { + if(items.get(i)->dead) + { + items.get(i)->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(items.get(i)->itemNo)); + delete items.get(i); + items.remove(i); + } + else if(items.get(i)->held) + { + items.remove(i); + } + } + for(int i=0; iindex = i; + item->Update(gameTime); + } + } + + void ItemManager::Draw(Graphics2D&g, long gameTime) + { + for(int i=0; iindex = i; + item->Draw(g, gameTime); + } + } + + void ItemManager::RandomItemSpawn() + { + if(Global::itemsActive.size()>0) + { + int index = (int)(GameEngine::random()*Global::itemsActive.size()); + SpawnItem(Global::itemsActive.get(index)); + } + } + + Item*ItemManager::CreateItem(int itemNo, float x1, float y1) + { + Item*newItem = NULL; + + switch(itemNo) //TODO: add items + { + case Global::ITEM_SMASHBALL: + if(!Global::smashBallOnField && !Global::playerHasSmashBall) + { + newItem = new SmashBall(x1,y1); + } + break; + + case Global::ITEM_RAYGUN: + newItem = new RayGun(x1,y1); + break; + + case Global::ITEM_HEARTCONTAINER: + newItem = new HeartContainer(x1,y1); + break; + + case Global::ITEM_BEAMSWORD: + newItem = new BeamSword(x1,y1); + break; + + case Global::ITEM_SUPERMUSHROOM: + newItem = new SuperMushroom(x1,y1); + break; + + case Global::ITEM_POISONMUSHROOM: + newItem = new PoisonMushroom(x1,y1); + break; + } + + if(newItem!=NULL) + { + if(P2PDataManager::isEnabled() && P2PDataManager::isServer()) + { + //Console::WriteLine((String)"adding item with id " + newItem->getID() + " to createdItems"); + CreateItemInfo info; + info.itemID = newItem->getID(); + info.itemNo = itemNo; + info.x = x1; + info.y = y1; + createdItems.add(info); + } + } + + return newItem; + } + + void ItemManager::SpawnItem(int itemNo) + { + GameEngine::Rectangle bounds = Global::currentStage->itemBounds; + float x1 = (float)((GameEngine::random()*bounds.width)+bounds.x); + float y1 = (float)((GameEngine::random()*bounds.height)+bounds.y); + + Item*newItem = CreateItem(itemNo, x1, y1); + + if(newItem!=NULL) + { + AddItem(newItem); + Console::WriteLine((String)"Spawned item " + Global::getItemName(itemNo)); + } + } +} \ No newline at end of file diff --git a/SmashBros/ItemManager.h b/SmashBros/ItemManager.h new file mode 100755 index 0000000..a47a065 --- /dev/null +++ b/SmashBros/ItemManager.h @@ -0,0 +1,48 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class ItemManager + { + friend class Item; + friend class Global; + friend class P2PDataManager; + private: + typedef struct + { + int itemID; + int itemNo; + float x; + float y; + } CreateItemInfo; + + static ArrayList items; + static long spawnTime; + static ArrayList files; + static ArrayList createdItems; + static ArrayList destroyedItems; + + static Item*CreateItem(int itemNo, float x1, float y1); + + static void handleAddP2PData(DataVoid&data); + static void handleSetP2PData(byte*&data); + + static void addFile(String file); + + static void RandomItemSpawn(); + + static bool checkIDAvailable(int itemID); + public: + static void Unload(); + static void AddItem(Item*item); + static Item*GetItem(int index); + static int TotalItems(); + static void RemoveAll(); + static void SpawnItem(int itemNo); + + static void Update(long gameTime); + static void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/Mario.cpp b/SmashBros/Mario.cpp new file mode 100755 index 0000000..599444e --- /dev/null +++ b/SmashBros/Mario.cpp @@ -0,0 +1,1247 @@ +#include "Mario.h" +#include "Global.h" +#include "AttackTemplates.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + void Mario::addProjectileInfo(byte type, int projID, float x, float y) + { + ProjectileInfo info; + info.type = type; + info.projID = projID; + info.x = x; + info.y = y; + createdProjectiles.add(info); + } + + Mario::Mario(float x1, float y1, byte playerNo, byte team) : Player(x1, y1, playerNo, team) + { + walkSpeed = 3; + runSpeed = 4; + fallWalk = 2; + fallRun = 2; + + weight = 0.1; + + name = "Mario"; + + setHitbox(-10, -9, 20, 28); + setHitboxColor(Color::GREEN); + //showHitboxWireframe(true); + //setWireframeColor(Color.red); + //showWireframe(true); + + setHangPoint(5, 20); + + Console::WriteLine((String)"finished creating player " + playerNo); + } + + Mario::~Mario() + { + // + } + + void Mario::setToDefaultValues() + { + charging_attack = 0; + } + + void Mario::Load() + { + setFolderPath("Images/Game/Characters/Mario/"); + + loadFile("Images/Game/Characters/Mario/fireball.png"); + loadFile("Images/Game/Characters/Mario/fludd_water.png"); + loadFile("Images/Game/Characters/Mario/finalsmash_fire.png"); + addTwoSidedAnimation("stand", "stand.png", 10, 9, 1); + addTwoSidedAnimation("walk", "walk.png", 10, 4, 1); + addTwoSidedAnimation("run", "run.png", 15, 8, 1); + addTwoSidedAnimation("jump", "jump.png", 10, 6, 1); + addTwoSidedAnimation("jump2", "jump2.png", 30, 20, 1); + addTwoSidedAnimation("land", "land.png", 20, 3, 1); + addTwoSidedAnimation("fall", "fall.png", 30, 2, 1); + addTwoSidedAnimation("hang", "hang.png", 1, 1, 1); + addTwoSidedAnimation("crouch", "crouch.png", 1, 1, 1); + addTwoSidedAnimation("melee_weapon", "melee_weapon.png", 6, 3, 1); + addTwoSidedAnimation("hurt_minor", "hurt_minor.png", 2, 1, 1); + addTwoSidedAnimation("hurt_fly", "hurt_fly.png", 2, 1, 1); + addTwoSidedAnimation("hurt_flip", "hurt_flip.png", 10, 4, 1); + addTwoSidedAnimation("hurt_spin", "hurt_spin.png", 18, 9, 1); + addSingleAnimation("hurt_spin_up", "hurt_spin_up.png", 18, 9, 1); + addTwoSidedAnimation("dash_attack", "dash_attack.png", 12, 6, 1); + addTwoSidedAnimation("standard_attack", "standard_attack.png", 24, 6, 1); + addTwoSidedAnimation("standard_attack2", "standard_attack2.png", 26, 7, 1); + addTwoSidedAnimation("standard_attack3", "standard_attack3.png", 18, 6, 1); + addTwoSidedAnimation("standard_attack_side", "standard_attack_side.png", 16, 9, 1); + addTwoSidedAnimation("standard_attack_up", "standard_attack_up.png", 18, 6, 1); + addTwoSidedAnimation("standard_attack_down", "standard_attack_down.png", 25, 12, 1); + addTwoSidedAnimation("air_attack", "air_attack.png", 8, 3, 1); + addTwoSidedAnimation("air_attack_side", "air_attack_side.png", 12, 6, 1); + addTwoSidedAnimation("air_attack_up", "air_attack_up.png", 45, 20, 1); + addSingleAnimation("air_attack_down", "air_attack_down.png", 20, 14, 1); + addTwoSidedAnimation("special_attack", "special_attack.png", 14, 4, 1); + addTwoSidedAnimation("special_attack_side", "special_attack_side.png", 14, 5, 1); + addTwoSidedAnimation("special_attack_up", "special_attack_up.png", 7, 4, 1); + addTwoSidedAnimation("special_charge_down", "special_charge_down.png", 0, 1, 1); + addTwoSidedAnimation("special_attack_down", "special_attack_down.png", 0, 1, 1); + addTwoSidedAnimation("smash_charge", "smash_charge.png", 1, 1, 1); + addTwoSidedAnimation("smash_attack", "smash_attack.png", 10, 4, 1); + addTwoSidedAnimation("smash_attack_up", "smash_attack_up.png", 8, 4, 1); + addTwoSidedAnimation("smash_attack_down", "smash_attack_down.png", 10, 4, 1); + addTwoSidedAnimation("finalsmash_begin", "finalsmash_begin.png", 10, 13, 1); + addTwoSidedAnimation("finalsmash_hold", "finalsmash_hold.gif", 0, 1, 1); + addTwoSidedAnimation("finalsmash_end", "finalsmash_end.png", 15, 18, 1); + } + + void Mario::LoadAttackTypes() + { + addAIAttackType(ATTACK_A, ATTACKTYPE_MELEE, 6); + addAIAttackType(ATTACK_SIDEA, ATTACKTYPE_MELEE, 3); + addAIAttackType(ATTACK_UPA, ATTACKTYPE_UPMELEE, 1); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_DOWNMELEE, 1); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_MELEE, 1); + addAIAttackType(ATTACK_B, ATTACKTYPE_PROJECTILE, 1); + addAIAttackType(ATTACK_SIDEB, ATTACKTYPE_MELEE, 1); + addAIAttackType(ATTACK_SIDEB, ATTACKTYPE_DEFENSIVE, 1); + addAIAttackType(ATTACK_SIDEB, ATTACKTYPE_SIDEMOVE, 1); + addAIAttackType(ATTACK_UPB, ATTACKTYPE_STRONGMELEE, 1); + addAIAttackType(ATTACK_UPB, ATTACKTYPE_UPMOVE, 1); + addAIAttackType(ATTACK_SIDESMASH, ATTACKTYPE_STRONGMELEE, 2, true); + addAIAttackType(ATTACK_UPSMASH, ATTACKTYPE_STRONGMELEE, 1, true); + addAIAttackType(ATTACK_DOWNSMASH, ATTACKTYPE_STRONGMELEE, 1, true); + addAIAttackType(ATTACK_FINALSMASH,ATTACKTYPE_PROJECTILE, 1); + } + + void Mario::Unload() + { + Player::Unload(); + } + + void Mario::addP2PData(DataVoid&data) + { + int total = createdProjectiles.size(); + + if(total>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + int total = createdProjectiles.size(); + data.add(&total, sizeof(total)); + + for(int i=0; igetID(), x-60, y-40); + } + break; + + case RIGHT: + { + changeAnimation("finalsmash_hold_right",FORWARD); + + FinalSmashFire*fire = new FinalSmashFire(getPlayerNo(), x+60, y-40); + createProjectile(fire); + + addProjectileInfo(3, fire->getID(), x+60, y-40); + } + break; + } + } + else if(n.equals("finalsmash_end_left") || n.equals("finalsmash_end_right")) + { + animFinish(); + AttackTemplates::finishFinalSmash(this); + } + else + { + Player::onAnimationFinish(n); + } + } + + void Mario::jump() + { + Player::jump(4.8f,5.0f); + } + + void Mario::onPlayerHit(Player*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + { + switch(attacksHolder) + { + case 0: + //A + if(hitAmount==0 && playerdir==LEFT) + { + causeDamage(collide,3); + collide->y-=3; + collide->x+=3; + x-=1; + causeHurt(collide, RIGHT, 1); + hitAmount++; + } + break; + + case 1: + //A 2 + if(hitAmount==0 && playerdir==LEFT) + { + causeDamage(collide,2); + collide->y-=3; + collide->x+=3; + x-=1; + causeHurt(collide, RIGHT, 1); + hitAmount++; + } + break; + + case 2: + //A 3 + if(hitAmount==0 && playerdir==LEFT) + { + causeDamage(collide,4); + causeHurtLaunch(collide,-1,2,2.5f, -1,2,3); + causeHurt(collide, RIGHT, 4); + hitAmount++; + } + break; + + case 11: + //B side + if(playerdir==LEFT) + { + switch(collide->getPlayerDir()) + { + case LEFT: + collide->setPlayerDir(RIGHT); + break; + + case RIGHT: + collide->setPlayerDir(LEFT); + break; + } + collide->stand(); + causeDamage(collide,8); + } + break; + + case 14: + //smash left + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + collide->x-=5; + causeHurtLaunch(collide,-1,3,((float)smashPower/5), -1,3,((float)smashPower/4)); + causeHurt(collide, RIGHT, smashPower/3); + } + break; + + case 15: + //smash up left + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,4,((float)smashPower/5), -1,3,((float)smashPower/5)); + causeHurt(collide, RIGHT, smashPower/3); + } + break; + + case 16: + //smash down left + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,4,((float)smashPower/6), -1,3,((float)smashPower/5)); + causeHurt(collide, RIGHT, smashPower/3); + } + break; + } + } + break; + + case DIR_RIGHT: + { + switch(attacksHolder) + { + case 0: + //A + if(hitAmount==0 && playerdir==RIGHT) + { + causeDamage(collide,3); + collide->y-=3; + collide->x-=3; + x+=1; + causeHurt(collide, LEFT, 1); + hitAmount++; + } + break; + + case 1: + //A 2 + if(hitAmount==0 && playerdir==RIGHT) + { + causeDamage(collide,2); + collide->y-=3; + collide->x-=3; + x+=1; + causeHurt(collide, LEFT, 1); + hitAmount++; + } + break; + + case 2: + //A 3 + if(hitAmount==0 && playerdir==RIGHT) + { + causeDamage(collide,4); + causeHurtLaunch(collide,1,2,2.5f, -1,2,3); + causeHurt(collide, LEFT, 4); + hitAmount++; + } + break; + + case 11: + //B side + if(playerdir==RIGHT) + { + causeDamage(collide,8); + switch(collide->getPlayerDir()) + { + case LEFT: + collide->setPlayerDir(RIGHT); + break; + + case RIGHT: + collide->setPlayerDir(LEFT); + break; + } + collide->stand(); + + } + break; + + case 14: + //smash right + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + collide->x+=5; + causeHurtLaunch(collide,1,3,((float)smashPower/5), -1,3,((float)smashPower/4)); + causeHurt(collide, LEFT, smashPower/3); + } + break; + + case 15: + //smash up right + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,4,((float)smashPower/5), -1,2,((float)smashPower/5)); + causeHurt(collide, LEFT, smashPower/3); + } + break; + + case 16: + //smash down right + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,4,((float)smashPower/6), -1,3,((float)smashPower/5)); + causeHurt(collide, LEFT, smashPower/3); + } + break; + } + } + break; + + case DIR_UP: + { + switch(attacksHolder) + { + case 14: + //smash + causeDamage(collide,smashPower); + causeHurtLaunch(collide,0,0,0, -1,3,((float)smashPower/4)); + causeHurt(collide, collide->getPlayerDir(), smashPower/3); + break; + + case 15: + //smash up + causeDamage(collide,smashPower); + causeHurtLaunch(collide,0,0,0, -1,4,((float)smashPower/4)); + causeHurt(collide, collide->getPlayerDir(), smashPower/3); + break; + + case 16: + //smash down left + causeDamage(collide,smashPower); + causeHurtLaunch(collide,0,0,0, -1,4.5f,((float)smashPower/4)); + causeHurt(collide, collide->getPlayerDir(), smashPower/3); + break; + } + } + break; + + case DIR_DOWN: + { + switch(attacksHolder) + { + case 5: + //A down left + causeDamage(collide,5); + if(collide->y<=y) + { + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide,-1,1,1, -1,2.3f,3.1f); + causeHurt(collide, RIGHT, 5); + break; + + case RIGHT: + causeHurtLaunch(collide,1,1,1, -1,2.3f,3.1f); + causeHurt(collide, LEFT, 5); + break; + } + } + else + { + causeHurtLaunch(collide,0,0,0, 1,3,3); + causeHurt(collide, collide->getPlayerDir(), 5); + } + break; + + case 9: + //A air down + collide->y-=5; + break; + + case 16: + //smash down left + causeDamage(collide,smashPower); + causeHurtLaunch(collide,0,0,0, 1,3.9f,((float)smashPower/4)); + causeHurt(collide, collide->getPlayerDir(), smashPower/3); + break; + } + } + break; + } + } + + void Mario::onPlayerRectHit(Player*collide, byte dir) + { + if(attacksHolder==12) + { + switch(playerdir) + { + case LEFT: + switch(hitAmount) + { + case 0: + if(collide->x > x) + { + return; + } + case 1: + case 2: + case 3: + case 4: + changeAnimation("special_attack_up_left", FORWARD); + causeDamage(collide,2); + collide->y=(y - ((height/2) + (collide->height/2) + 16)); + collide->x=x; + collide->xvelocity=0; + collide->yvelocity=0; + hitAmount+=1; + yvelocity=-4; + causeHurt(collide, collide->getPlayerDir(), 0); + break; + + case 5: + changeAnimation("special_attack_up_left", FORWARD); + causeDamage(collide,2); + yvelocity=-2; + attacksHolder=-1; + hitAmount+=1; + collide->yvelocity=0; + causeHurtLaunch(collide,0,0,0, -1,2.4f,2); + causeHurt(collide, collide->getPlayerDir(), 3); + break; + } + break; + + case RIGHT: + switch(hitAmount) + { + case 0: + if(collide->x < this->x) + { + return; + } + case 1: + case 2: + case 3: + case 4: + changeAnimation("special_attack_up_right", FORWARD); + causeDamage(collide,2); + collide->y=(this->y - ((this->height/2) + (collide->height/2) + 16)); + collide->x=x; + collide->xvelocity=0; + collide->yvelocity=0; + hitAmount+=1; + yvelocity=-4; + causeHurt(collide, collide->getPlayerDir(), 0); + break; + + case 5: + changeAnimation("special_attack_up_right", FORWARD); + causeDamage(collide,2); + yvelocity=-2; + attacksHolder=-1; + hitAmount+=1; + collide->yvelocity=0; + causeHurtLaunch(collide,0,0,0, -1,3,4); + causeHurt(collide, collide->getPlayerDir(), 3); + break; + } + break; + } + } + } + + boolean Mario::onPlayerDeflectDamage(Player*collide, int damage) + { + return false; + } + + void Mario::onFinishCharge() + { + destroyCharge(); + chargeDownTime = Global::getWorldTime() + 100; + chargedDownAttack = true; + charging_attack = 0; + animFinish(); + } + + void Mario::doChargingAttack(byte button) + { + destroyCharge(); + chargingAttack = false; + chargedDownAttack = false; + charging_attack = 0; + animFinish(); + } + + void Mario::attackA() + { + addAttackInfo(DIR_LEFT, 6, LEFT, 10, 5, -1,1,1.5f, -1,1.1f,2.1f); + addAttackInfo(DIR_RIGHT,6,RIGHT, 10, 5, 1,1,1.5f, -1,1.1f,2.1f); + addAttackInfo(DIR_DOWN, 6, LEFT, 10, 4, 0,0,0, 1,3,2); + addAttackInfo(DIR_DOWN, 6,RIGHT, 10, 4, 0,0,0, 1,3,2); + + if(!checkItemUse()) + { + if(isOnGround()) + { + AttackTemplates::combo3A(this, 6, 0,1, 1,1, 2,1.8); + } + else + { + if(!bUp) + { + AttackTemplates::normalAirA(this, 6,1.2); + } + } + } + } + + void Mario::attackSideA() + { + addAttackInfo(DIR_LEFT, 3, LEFT, 8, 5, -1,2,2.6f, -1,1.5f,2.5f); + addAttackInfo(DIR_RIGHT,3,RIGHT, 8, 5, 1,2,2.6f, -1,1.5f,2.5f); + addAttackInfo(DIR_DOWN, 3, LEFT, 8, 5, -1,2,2.6f, -1,1.5f,2.5f); + addAttackInfo(DIR_DOWN, 3,RIGHT, 8, 5, 1,2,2.6f, -1,1.5f,2.5f); + addAttackInfo(DIR_LEFT, 7, LEFT, 10, 6, -1,2,2.9f, -1,0.5f,0); + addAttackInfo(DIR_RIGHT,7,RIGHT, 10, 6, 1,2,2.9f, -1,0.5f,0); + addAttackInfo(DIR_DOWN, 7, LEFT, 10, 4, 0,0,0, 1,6,6); + addAttackInfo(DIR_DOWN, 7,RIGHT, 10, 4, 0,0,0, 1,6,6); + + if(((getMoveLeft()==2) || (getMoveRight()==2)) && (isOnGround())) + { + AttackTemplates::normalDashA(this, 3,2.3, 4.3f); + } + else + { + if(!checkItemUseSide()) + { + if(isOnGround()) + { + AttackTemplates::normalSideA(this, 3,2.1); + } + else + { + if(!bUp) + { + AttackTemplates::normalAirSideA(this, 7,2.8); + } + } + } + } + } + + void Mario::attackUpA() + { + addAttackInfo(DIR_LEFT, 8, LEFT, 10, 6, -1,2,2.7f, -1,1,2.2f); + addAttackInfo(DIR_RIGHT,8,RIGHT, 10, 6, 1,2,2.7f, -1,1,2.2f); + addAttackInfo(DIR_UP, 8, LEFT, 10, 6, 0,0,0, -1,2,3.6f); + addAttackInfo(DIR_UP, 8,RIGHT, 10, 6, 0,0,0, -1,2,3.6f); + addAttackInfo(DIR_DOWN, 8, LEFT, 10, 6, 0,0,0, 1,4,5); + addAttackInfo(DIR_DOWN, 8,RIGHT, 10, 6, 0,0,0, 1,4,5); + addAttackInfo(DIR_UP, 4, LEFT, 7, 4, 0,0,0, -1,2,3); + addAttackInfo(DIR_UP, 4,RIGHT, 7, 4, 0,0,0, -1,2,3); + addAttackInfo(DIR_LEFT, 4, LEFT, 7, 4, -1,1,2, -1,1,1.6f); + addAttackInfo(DIR_RIGHT, 4,RIGHT, 7, 4, 1,1,2, -1,1,1.6f); + + if(isOnGround()) + { + AttackTemplates::normalUpA(this, 4, 0.95); + } + else + { + if(!bUp) + { + AttackTemplates::normalAirUpA(this, 8,2.349); + } + } + } + + void Mario::attackDownA() + { + addAttackInfo(DIR_LEFT, 5, LEFT, 5, 5, -1,2,1.8f, -1,2.5f,2); + addAttackInfo(DIR_RIGHT,5,RIGHT, 5, 5, 1,2,1.8f, -1,2.5f,2); + addAttackInfo(DIR_UP, 5, LEFT, 5, 5, 0,0,0, -1,2.3f,3.1f); + addAttackInfo(DIR_UP, 5,RIGHT, 5, 5, 0,0,0, -1,2.3f,3.1f); + addAttackInfo(DIR_LEFT, 9, LEFT, 7, 6, -1,3,3.1f, -1,1,3); + addAttackInfo(DIR_LEFT, 9,RIGHT, 7, 6, -1,3,3.1f, -1,1,3); + addAttackInfo(DIR_RIGHT,9,LEFT, 7, 6, 1,3,3.1f, -1,1,3); + addAttackInfo(DIR_RIGHT,9,RIGHT, 7, 6, 1,3,3.1f, -1,1,3); + addAttackInfo(DIR_UP, 9, LEFT, 7, 6, 0,0,0, -1,3,2); + addAttackInfo(DIR_UP, 9,RIGHT, 7, 6, 0,0,0, -1,3,2); + addAttackInfo(DIR_DOWN, 9, LEFT, 7, 3, 0,0,0, 1,4,5); + addAttackInfo(DIR_DOWN, 9,RIGHT, 7, 3, 0,0,0, 1,4,5); + + if(isOnGround()) + { + AttackTemplates::normalDownA(this, 5,2.15); + } + else + { + if(!bUp) + { + AttackTemplates::singleAirDownA(this, 9,2.65); + } + } + } + + void Mario::attackB() + { + if(!bUp) + { + if((canFinalSmash())&&(isOnGround())) + { + attackFinalSmash(); + } + else + { + Fireball*fireball = new Fireball(this->getPlayerNo(),x,y); + AttackTemplates::singleProjectile(this, 10,0, fireball); + + addProjectileInfo(1, fireball->getID(), x, y); + + switch(playerdir) + { + case 1: + changeAnimation("special_attack_left",FORWARD); + break; + + case 2: + changeAnimation("special_attack_right",FORWARD); + break; + } + } + } + } + + void Mario::attackSideB() + { + if(!bUp) + { + AttackTemplates::normalSideB(this, 11,1.83f, 2.99f); + if(!isOnGround()) + { + switch(playerdir) + { + case LEFT: + xvelocity-=2; + break; + + case RIGHT: + xvelocity+=2; + break; + } + } + } + } + + void Mario::attackUpB() + { + if(!bUp) + { + AttackTemplates::rehitUpB(this, 12, 3.1f, 5.5f, 5.5f); + if(isOnGround()) + { + switch(playerdir) + { + case LEFT: + xvelocity=-0.8f; + break; + + case RIGHT: + xvelocity=0.8f; + break; + } + } + else + { + switch(playerdir) + { + case LEFT: + xvelocity=-2.1f; + break; + + case RIGHT: + xvelocity=2.1f; + break; + } + } + } + } + + void Mario::attackDownB() + { + if(!bUp) + { + if(charging_attack==0) + { + if(chargedDownAttack) + { + switch(playerdir) + { + case LEFT: + { + FluddWater*fludd = new FluddWater(getPlayerNo(),this->x-66,this->y-1); + AttackTemplates::singleProjectile(this, 13, 0, fludd); + + addProjectileInfo(2, fludd->getID(), this->x-66, this->y-1); + + changeAnimation("special_attack_down_left", FORWARD); + } + break; + + case RIGHT: + { + FluddWater*fludd = new FluddWater(getPlayerNo(),this->x+66,this->y-1); + AttackTemplates::singleProjectile(this, 13, 0, fludd); + + addProjectileInfo(2, fludd->getID(), this->x+66, this->y-1); + + changeAnimation("special_attack_down_right", FORWARD); + } + break; + } + chargedDownAttack = false; + } + else + { + AttackTemplates::chargeB(this, 0, 100, 10); + switch(playerdir) + { + case LEFT: + changeAnimation("special_charge_down_left",FORWARD); + break; + + case RIGHT: + changeAnimation("special_charge_down_right",FORWARD); + break; + } + charging_attack = 1; + } + } + } + } + + void Mario::attackSideSmash(byte type) + { + if(!checkItemUseSmash(type) && !bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this, 14, 3.28, type, 1, 15, 11, 20); + } + else + { + attackSideA(); + } + } + } + + void Mario::attackUpSmash(byte type) + { + if(!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this, 15, 3.26, type, 2, 15, 10, 20); + } + else + { + attackUpA(); + } + } + } + + void Mario::attackDownSmash(byte type) + { + if(!bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this, 16, 3.27, type, 3, 15, 10, 20); + } + else + { + attackDownA(); + } + } + } + + void Mario::attackFinalSmash() + { + addAttackInfo(DIR_LEFT, 17, LEFT, 30, 9, -1,7,4.5f, -1,6,5); + addAttackInfo(DIR_RIGHT,17,RIGHT, 30, 9, 1,7,4.5f, -1,6,5); + addAttackInfo(DIR_UP, 17, LEFT, 30, 9, 0,0,0, -1,5,6); + addAttackInfo(DIR_UP, 17,RIGHT, 30, 9, 0,0,0, -1,5,6); + addAttackInfo(DIR_DOWN, 17, LEFT, 30, 9, 0,0,0, 1,5,6); + addAttackInfo(DIR_DOWN, 17,RIGHT, 30, 9, 0,0,0, 1,5,6); + + if(isOnGround()) + { + AttackTemplates::finalSmash(this, 17); + switch(playerdir) + { + case 1: + changeAnimation("finalsmash_begin_left", FORWARD); + break; + + case 2: + changeAnimation("finalsmash_begin_right", FORWARD); + break; + } + } + else + { + attackB(); + } + } + + Mario::Fireball::Fireball(byte playerNo, float x1, float y1) : Projectile(playerNo,x1,y1) + { + xspeed = 3.1f; + yspeed = 2; + + Animation*anim; + anim = new Animation("left", 8, 4, 1); + anim->addFrame("Images/Game/Characters/Mario/fireball.png"); + addAnimation(anim); + + anim = new Animation("right", 8, 4, 1); + anim->addFrame("Images/Game/Characters/Mario/fireball.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case LEFT: + xvelocity=-xspeed; + changeAnimation("left",FORWARD); + break; + + case RIGHT: + xvelocity=xspeed; + changeAnimation("right",FORWARD); + break; + } + liveTime = Global::getWorldTime() + 15; + } + + Mario::Fireball::~Fireball() + { + // + } + + void Mario::Fireball::Update(long gameTime) + { + Projectile::Update(gameTime); + yvelocity += 0.2f; + if(liveTime <= Global::getWorldTime()) + { + this->destroy(); + } + } + + void Mario::Fireball::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + if(collide->getAttacksPriority()==5) + { + if(collide->getPlayerDir()==1) + { + xvelocity=-xvelocity; + yvelocity=-yvelocity; + } + else + { + destroy(); + causeDamage(collide,5); + collide->y-=3; + switch(itemdir) + { + case LEFT: + causeHurtLaunch(collide,-1,1,3, -1,1,3); + causeHurt(collide, RIGHT, 2); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,1,3, -1,1,3); + causeHurt(collide, LEFT, 2); + break; + } + } + } + + else if(collide->getAttacksPriority()==6) + { + xvelocity=-xvelocity; + yvelocity=-yvelocity; + } + + else if(collide->getAttacksPriority()==7) + { + destroy(); + } + + else + { + destroy(); + causeDamage(collide,5); + collide->y-=3; + switch(itemdir) + { + case LEFT: + causeHurtLaunch(collide, -1,1,3, -1,1,3); + causeHurt(collide, RIGHT, 2); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,1,3, -1,1,3); + causeHurt(collide, LEFT, 2); + break; + } + } + } + } + + void Mario::Fireball::whilePlatformColliding(Platform*collide, byte dir) + { + switch(dir) + { + case DIR_UP: + yvelocity=-yspeed; + break; + + case DIR_DOWN: + yvelocity=yspeed; + break; + + case DIR_LEFT: + xvelocity=-xspeed; + break; + + case DIR_RIGHT: + xvelocity=xspeed; + break; + } + } + + Mario::FluddWater::FluddWater(byte playerNo, float x1, float y1) : Projectile(playerNo, x1, y1) + { + Animation*anim; + + anim = new Animation("left",10,10,1); + anim->addFrame("Images/Game/Characters/Mario/fludd_water.png"); + addAnimation(anim); + + anim = new Animation("right",10,10,1); + anim->addFrame("Images/Game/Characters/Mario/fludd_water.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case LEFT: + changeAnimation("left",FORWARD); + break; + + case RIGHT: + changeAnimation("right",FORWARD); + break; + } + } + + Mario::FluddWater::~FluddWater() + { + // + } + + void Mario::FluddWater::Update(long gameTime) + { + Projectile::Update(gameTime); + Player*playr = Global::getPlayerActor(this->getPlayerNo()); + if(!playr->isAlive() && !playr->isHurt()) + { + destroy(); + } + } + + void Mario::FluddWater::whilePlayerHitting(Player*collide, byte dir) + { + if(collide->x < Global::getPlayerActor(getPlayerNo())->x) + { + collide->x -= 2; + } + else + { + collide->x += 2; + } + } + + void Mario::FluddWater::onAnimationFinish(const String&aName) + { + destroy(); + Mario*playr = (Mario*)Global::getPlayerActor(getPlayerNo()); + playr->animFinish(); + } + + Mario::FinalSmashFire::FinalSmashFire(byte playerNo, float x1, float y1) : Projectile(playerNo,x1,y1) + { + Animation*anim; + + anim = new Animation("left", 12, 5, 2); + anim->addFrame("Images/Game/Characters/Mario/finalsmash_fire.png"); + addAnimation(anim); + + anim = new Animation("right", 12, 5, 2); + anim->addFrame("Images/Game/Characters/Mario/finalsmash_fire.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case LEFT: + changeAnimation("left",FORWARD); + break; + + case RIGHT: + changeAnimation("right",FORWARD); + break; + } + } + + Mario::FinalSmashFire::~FinalSmashFire() + { + // + } + + void Mario::FinalSmashFire::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + switch(dir) + { + case DIR_UP: + causeDamage(collide,30); + causeHurtLaunch(collide, 0,0,0, -1,6,7); + causeHurt(collide, collide->getPlayerDir(), 9); + break; + + case DIR_DOWN: + causeDamage(collide,30); + causeHurtLaunch(collide, 0,0,0, 1,6,7); + causeHurt(collide, collide->getPlayerDir(), 9); + break; + + case DIR_LEFT: + causeDamage(collide,30); + causeHurtLaunch(collide, -1,7,6.5f, -1,6,7); + causeHurt(collide, RIGHT, 9); + break; + + case DIR_RIGHT: + causeDamage(collide,30); + causeHurtLaunch(collide, 1,7,6.5f, -1,6,7); + causeHurt(collide, LEFT, 9); + break; + } + } + } + + void Mario::FinalSmashFire::onAnimationFinish(const String&n) + { + Player*playr = Global::getPlayerActor(this->getPlayerNo()); + switch(playr->getPlayerDir()) + { + case LEFT: + playr->changeAnimation("finalsmash_end_left", FORWARD); + break; + + case RIGHT: + playr->changeAnimation("finalsmash_end_right", FORWARD); + break; + } + destroy(); + } +} \ No newline at end of file diff --git a/SmashBros/Mario.h b/SmashBros/Mario.h new file mode 100755 index 0000000..2001081 --- /dev/null +++ b/SmashBros/Mario.h @@ -0,0 +1,100 @@ +#include "Player.h" + +#pragma once + +namespace SmashBros +{ + class Mario : public Player + { + private: + byte charging_attack; + boolean chargedDownAttack; + long chargeDownTime; + + typedef struct + { + byte type; + int projID; + float x; + float y; + } ProjectileInfo; + + void addProjectileInfo(byte type, int projID, float x, float y); + + ArrayList createdProjectiles; + + class Fireball : public Projectile + { + private: + long liveTime; + float xspeed; + float yspeed; + + public: + Fireball(byte playerNo, float x1, float y1); + virtual ~Fireball(); + + virtual void Update(long gameTime); + + virtual void onPlayerHit(Player*collide, byte dir); + virtual void whilePlatformColliding(Platform*collide, byte dir); + }; + + class FluddWater : public Projectile + { + public: + FluddWater(byte playerNo, float x1, float y1); + virtual ~FluddWater(); + + virtual void Update(long gameTime); + + virtual void whilePlayerHitting(Player*collide, byte dir); + virtual void onAnimationFinish(const String&n); + }; + + class FinalSmashFire : public Projectile + { + public: + FinalSmashFire(byte playerNo, float x1, float y1); + virtual ~FinalSmashFire(); + + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onAnimationFinish(const String&n); + }; + + public: + Mario(float x1, float y1, byte playerNo, byte team); + virtual ~Mario(); + + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + virtual void setToDefaultValues(); + virtual void Load(); + virtual void LoadAttackTypes(); + virtual void Unload(); + virtual void onAnimationFinish(const String&n); + virtual void jump(); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onPlayerRectHit(Player*collide, byte dir); + virtual boolean onPlayerDeflectDamage(Player*collide, int damage); + + virtual void onFinishCharge(); + virtual void doChargingAttack(byte button); + + virtual void attackA(); + virtual void attackSideA(); + virtual void attackUpA(); + virtual void attackDownA(); + virtual void attackB(); + virtual void attackSideB(); + virtual void attackUpB(); + virtual void attackDownB(); + virtual void attackSideSmash(byte type); + virtual void attackUpSmash(byte type); + virtual void attackDownSmash(byte type); + virtual void attackFinalSmash(); + }; +} \ No newline at end of file diff --git a/SmashBros/MenuBar.cpp b/SmashBros/MenuBar.cpp new file mode 100755 index 0000000..0d7ac6e --- /dev/null +++ b/SmashBros/MenuBar.cpp @@ -0,0 +1,60 @@ +#include "MenuBar.h" + +namespace SmashBros +{ + MenuBar::MenuBar(float x1, float y1, String label) : Actor(x1,y1) + { + labelSize = 20; + xOffset = 0; + addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/options_bar.png")); + changeAnimation("normal",FORWARD); + this->label = new TextActor(label,AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 20),Color::BLACK); + this->label->setAlignment(TextActor::ALIGN_CENTER); + } + + MenuBar::~MenuBar() + { + delete label; + } + + void MenuBar::Update(long gameTime) + { + Actor::Update(gameTime); + label->Update(gameTime); + } + + void MenuBar::Draw(Graphics2D&g, long gameTime) + { + Actor::Draw(g,gameTime); + + label->x = (x - 100 * Scale); + label->y = (y - 2 * Scale); + label->x += xOffset*Scale; + if(((int)(labelSize*Scale)) != label->getSize()) + { + label->setSize((int)(labelSize*Scale)); + } + + label->Draw(g, gameTime); + } + + void MenuBar::setTextOffsetX(float x1) + { + xOffset = x1; + } + + float MenuBar::getTextOffsetX() + { + return xOffset; + } + + void MenuBar::setLabel(String str) + { + label->setText(str); + } + + String MenuBar::getLabel() + { + return label->getText(); + } +} \ No newline at end of file diff --git a/SmashBros/MenuBar.h b/SmashBros/MenuBar.h new file mode 100755 index 0000000..2f9452b --- /dev/null +++ b/SmashBros/MenuBar.h @@ -0,0 +1,26 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class MenuBar : public Actor + { + private: + TextActor*label; + int labelSize; + float xOffset; + + public: + MenuBar(float x1, float y1, String label); + virtual ~MenuBar(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + void setTextOffsetX(float x1); + float getTextOffsetX(); + void setLabel(String str); + String getLabel(); + }; +} \ No newline at end of file diff --git a/SmashBros/MenuBarSmall.cpp b/SmashBros/MenuBarSmall.cpp new file mode 100755 index 0000000..1fde704 --- /dev/null +++ b/SmashBros/MenuBarSmall.cpp @@ -0,0 +1,65 @@ +#include "MenuBarSmall.h" + +namespace SmashBros +{ + MenuBarSmall::MenuBarSmall(float x1, float y1, String label) : Actor(x1,y1) + { + labelSize = 16; + xOffset = 0; + addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/options_bar_small.png")); + changeAnimation("normal",FORWARD); + this->label = new TextActor(label,AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, labelSize),Color::BLACK); + this->label->setAlignment(TextActor::ALIGN_CENTER); + } + + MenuBarSmall::~MenuBarSmall() + { + delete label; + } + + void MenuBarSmall::Update(long gameTime) + { + Actor::Update(gameTime); + label->Update(gameTime); + } + + void MenuBarSmall::Draw(Graphics2D&g, long gameTime) + { + Actor::Draw(g,gameTime); + + label->x = (x - 10 * Scale); + label->y = (y - 2 * Scale); + label->x += xOffset*Scale; + if(((int)(labelSize*Scale)) != label->getSize()) + { + label->setSize((int)(labelSize*Scale)); + } + + label->Draw(g, gameTime); + } + + void MenuBarSmall::setTextOffsetX(float x1) + { + xOffset = x1; + } + + float MenuBarSmall::getTextOffsetX() + { + return xOffset; + } + + void MenuBarSmall::setLabel(String str) + { + label->setText(str); + } + + String MenuBarSmall::getLabel() + { + return label->getText(); + } + + void MenuBarSmall::setLabelSize(int size) + { + labelSize = size; + } +} \ No newline at end of file diff --git a/SmashBros/MenuBarSmall.h b/SmashBros/MenuBarSmall.h new file mode 100755 index 0000000..4dee915 --- /dev/null +++ b/SmashBros/MenuBarSmall.h @@ -0,0 +1,27 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class MenuBarSmall : public Actor + { + private: + TextActor*label; + int labelSize; + float xOffset; + + public: + MenuBarSmall(float x1, float y1, String label); + virtual ~MenuBarSmall(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + void setTextOffsetX(float x1); + float getTextOffsetX(); + void setLabel(String str); + String getLabel(); + void setLabelSize(int size); + }; +} \ No newline at end of file diff --git a/SmashBros/MenuBarSmallButton.cpp b/SmashBros/MenuBarSmallButton.cpp new file mode 100755 index 0000000..12efef2 --- /dev/null +++ b/SmashBros/MenuBarSmallButton.cpp @@ -0,0 +1,40 @@ +#include "MenuBarSmallButton.h" + +namespace SmashBros +{ + MenuBarSmallButton::MenuBarSmallButton(float x1, float y1, String label) : MenuBarSmall(x1,y1,label) + { + hasTarget = false; + addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/options_bar_small_selected.png")); + } + + MenuBarSmallButton::MenuBarSmallButton(float x1, float y1, String label, String target) : MenuBarSmall(x1,y1,label) + { + hasTarget = true; + this->target = target; + this->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/options_bar_small_selected.png")); + } + + MenuBarSmallButton::~MenuBarSmallButton() + { + // + } + + void MenuBarSmallButton::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void MenuBarSmallButton::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void MenuBarSmallButton::onRelease() + { + if(hasTarget) + { + ScreenManager::GoToScreen(target); + } + } +} \ No newline at end of file diff --git a/SmashBros/MenuBarSmallButton.h b/SmashBros/MenuBarSmallButton.h new file mode 100755 index 0000000..bbc460d --- /dev/null +++ b/SmashBros/MenuBarSmallButton.h @@ -0,0 +1,22 @@ +#include "MenuBarSmall.h" + +#pragma once + +namespace SmashBros +{ + class MenuBarSmallButton : public MenuBarSmall + { + private: + boolean hasTarget; + String target; + + public: + MenuBarSmallButton(float x1, float y1, String label); + MenuBarSmallButton(float x1, float y1, String label, String target); + virtual ~MenuBarSmallButton(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; +} \ No newline at end of file diff --git a/SmashBros/MenuBarToggle.cpp b/SmashBros/MenuBarToggle.cpp new file mode 100755 index 0000000..427509e --- /dev/null +++ b/SmashBros/MenuBarToggle.cpp @@ -0,0 +1,67 @@ +#include "MenuBarToggle.h" + +namespace SmashBros +{ + MenuBarToggle::MenuBarToggleButton::MenuBarToggleButton(MenuBarToggle*menuBar,float x1, float y1, boolean toggle) : ToggleButton(x1,y1,toggle) + { + this->menuBar = menuBar; + } + + MenuBarToggle::MenuBarToggleButton::~MenuBarToggleButton() + { + // + } + + void MenuBarToggle::MenuBarToggleButton::onToggle(boolean toggle) + { + menuBar->whenToggled(toggle); + } + + MenuBarToggle::MenuBarToggle(float x1, float y1, String label, boolean toggle) : MenuBar(x1,y1,label) + { + toggleButton = new MenuBarToggleButton(this,0,0,toggle); + this->toggle = toggle; + } + + MenuBarToggle::~MenuBarToggle() + { + delete toggleButton; + } + + void MenuBarToggle::Update(long gameTime) + { + MenuBar::Update(gameTime); + toggleButton->Update(gameTime); + } + + void MenuBarToggle::Draw(Graphics2D&g, long gameTime) + { + MenuBar::Draw(g, gameTime); + toggleButton->x = (x + 94 * Scale); + toggleButton->y = (y + 0 * Scale); + toggleButton->Scale = Scale; + toggleButton->Draw(g, gameTime); + } + + void MenuBarToggle::setToggle(boolean toggle) + { + this->toggle = toggle; + toggleButton->setToggle(toggle); + } + + boolean MenuBarToggle::getToggle() + { + return toggle; + } + + void MenuBarToggle::whenToggled(boolean toggle) + { + this->toggle = toggle; + onToggle(toggle); + } + + void MenuBarToggle::onToggle(boolean toggle) + { + //Open for implementation + } +} \ No newline at end of file diff --git a/SmashBros/MenuBarToggle.h b/SmashBros/MenuBarToggle.h new file mode 100755 index 0000000..2336b8e --- /dev/null +++ b/SmashBros/MenuBarToggle.h @@ -0,0 +1,37 @@ +#include "MenuBar.h" +#include "ToggleButton.h" + +#pragma once + +namespace SmashBros +{ + class MenuBarToggle : public MenuBar + { + private: + class MenuBarToggleButton : public ToggleButton + { + private: + MenuBarToggle*menuBar; + public: + MenuBarToggleButton(MenuBarToggle*menuBar, float x1, float y1, boolean toggle=false); + virtual ~MenuBarToggleButton(); + + virtual void onToggle(boolean toggle); + }; + + MenuBarToggleButton*toggleButton; + boolean toggle; + void whenToggled(boolean toggle); + + public: + MenuBarToggle(float x1, float y1, String label, boolean toggle=false); + virtual ~MenuBarToggle(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + virtual void onToggle(boolean toggle); + + void setToggle(boolean toggle); + boolean getToggle(); + }; +} \ No newline at end of file diff --git a/SmashBros/MenuBarValue.cpp b/SmashBros/MenuBarValue.cpp new file mode 100755 index 0000000..7690f7b --- /dev/null +++ b/SmashBros/MenuBarValue.cpp @@ -0,0 +1,181 @@ +#include "MenuBarValue.h" + +namespace SmashBros +{ + MenuBarValue::LeftArrow::LeftArrow(MenuBarValue*menuBar, float x1, float y1) : Actor(x1,y1) + { + this->menuBar = menuBar; + } + + MenuBarValue::LeftArrow::~LeftArrow() + { + // + } + + void MenuBarValue::LeftArrow::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void MenuBarValue::LeftArrow::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void MenuBarValue::LeftArrow::onRelease() + { + menuBar->value -= menuBar->incr; + if(menuBar->value < menuBar->minValue) + { + menuBar->value = menuBar->maxValue; + } + } + + MenuBarValue::RightArrow::RightArrow(MenuBarValue*menuBar, float x1, float y1) : Actor(x1,y1) + { + this->menuBar = menuBar; + } + + MenuBarValue::RightArrow::~RightArrow() + { + // + } + + void MenuBarValue::RightArrow::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void MenuBarValue::RightArrow::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void MenuBarValue::RightArrow::onRelease() + { + menuBar->value += menuBar->incr; + if(menuBar->value > menuBar->maxValue) + { + menuBar->value = menuBar->minValue; + } + } + + MenuBarValue::MenuBarValue(float x1, float y1, String label) : MenuBar(x1,y1,label) + { + label2Size = 15; + valueActorSize = 18; + createMenuBar(); + numLabel = false; + } + + MenuBarValue::MenuBarValue(float x1, float y1, String label,String label2) : MenuBar(x1,y1,label) + { + label2Size = 15; + valueActorSize = 18; + createMenuBar(); + this->label2 = new TextActor(label2,AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, label2Size),Color::BLACK); + this->label2->setAlignment(TextActor::ALIGN_CENTER); + numLabel = true; + } + + MenuBarValue::~MenuBarValue() + { + delete valueActor; + delete leftArrow; + delete rightArrow; + if(label2!=null) + { + delete label2; + } + } + + void MenuBarValue::createMenuBar() + { + valueActor = new TextActor("0",AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, valueActorSize),Color::BLACK); + + leftArrow = new LeftArrow(this,0,0); + Animation*normal = new Animation("normal",1,"Images/Menus/Buttons/Generic/arrow.png"); + Animation*hover = new Animation("hover",1,"Images/Menus/Buttons/Generic/arrow_selected.png"); + leftArrow->addAnimation(normal); + leftArrow->addAnimation(hover); + leftArrow->changeAnimation("normal", FORWARD); + + rightArrow = new RightArrow(this,0,0); + normal = new Animation("normal",1,"Images/Menus/Buttons/Generic/arrow.png"); + normal->mirror(true); + hover = new Animation("hover",1,"Images/Menus/Buttons/Generic/arrow_selected.png"); + hover->mirror(true); + rightArrow->addAnimation(normal); + rightArrow->addAnimation(hover); + rightArrow->changeAnimation("normal", FORWARD); + } + + int MenuBarValue::getValue() + { + return value; + } + + void MenuBarValue::setValue(int value) + { + this->value = value; + } + + void MenuBarValue::setProperties(int min, int max, int increment) + { + minValue = min; + maxValue = max; + incr = increment; + } + + void MenuBarValue::Update(long gameTime) + { + MenuBar::Update(gameTime); + if(numLabel) + { + label2->Update(gameTime); + } + leftArrow->Update(gameTime); + rightArrow->Update(gameTime); + valueActor->setText((String)"" + value); + valueActor->Update(gameTime); + } + + void MenuBarValue::Draw(Graphics2D&g, long gameTime) + { + MenuBar::Draw(g, gameTime); + if(numLabel) + { + label2->x = (x + 106 * Scale); + label2->y = (y - 1.5f * Scale); + if(((int)(label2Size*Scale))!=label2->getSize()) + { + label2->setSize((int)(label2Size*Scale)); + } + valueActor->x = (x + 64 * Scale); + valueActor->y = (y + 6 * Scale); + label2->Draw(g, gameTime); + } + else + { + valueActor->x = (x + 83 * Scale); + valueActor->y = (y + 6 * Scale); + } + + leftArrow->x = (x + 50 * Scale); + leftArrow->y = (y); + leftArrow->Scale = Scale; + + rightArrow->x = (x + 136 * Scale); + rightArrow->y = (y); + rightArrow->Scale = Scale; + + if(((int)(valueActorSize*Scale))!=valueActor->getSize()) + { + valueActor->setSize((int)(valueActorSize*Scale)); + } + + valueActor->Draw(g, gameTime); + leftArrow->Draw(g, gameTime); + rightArrow->Draw(g, gameTime); + } +} \ No newline at end of file diff --git a/SmashBros/MenuBarValue.h b/SmashBros/MenuBarValue.h new file mode 100755 index 0000000..3a6c63c --- /dev/null +++ b/SmashBros/MenuBarValue.h @@ -0,0 +1,64 @@ +#include "MenuBar.h" + +#pragma once + +namespace SmashBros +{ + class MenuBarValue : public MenuBar + { + private: + class LeftArrow : public Actor + { + private: + MenuBarValue*menuBar; + public: + LeftArrow(MenuBarValue*menuBar, float x1, float y1); + virtual ~LeftArrow(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + class RightArrow : public Actor + { + private: + MenuBarValue*menuBar; + public: + RightArrow(MenuBarValue*menuBar, float x1, float y1); + virtual ~RightArrow(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + LeftArrow*leftArrow; + RightArrow*rightArrow; + + TextActor*label2; + int label2Size; + + TextActor*valueActor; + int valueActorSize; + boolean numLabel; + + int value; + int minValue, maxValue; + int incr; + + void createMenuBar(); + + public: + MenuBarValue(float x1, float y1, String label); + MenuBarValue(float x1, float y1, String label, String label2); + virtual ~MenuBarValue(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + int getValue(); + void setValue(int value); + void setProperties(int min, int max, int increment); + }; +} \ No newline at end of file diff --git a/SmashBros/MenuClasses.cpp b/SmashBros/MenuClasses.cpp new file mode 100644 index 0000000..51b071c --- /dev/null +++ b/SmashBros/MenuClasses.cpp @@ -0,0 +1,2176 @@ +#include "Global.h" +#include "MenuClasses.h" +#include "Preferences.h" +#include "Menus.h" +#include "Controls.h" +#include "MusicManager.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + TitleScreen::TitleScreenActor::TitleScreenActor(TitleScreen*screen, float x1, float y1) : Actor(x1,y1) + { + this->screen = screen; + } + + TitleScreen::TitleScreenActor::~TitleScreenActor() + { + // + } + + void TitleScreen::TitleScreenActor::onRelease() + { + eventDisable(Actor::EVENT_MOUSERELEASE); + screen->changing = true; + screen->changeTime = Game::getGameTime() + 1600; + MusicManager::stop(); + Menus::playSound("titlescreen click"); + } + + TitleScreen::TitleScreen(const String&name) : Screen(name) + { + titleScreen = null; + changeTime = 0; + changing = false; + } + + TitleScreen::~TitleScreen() + { + if(titleScreen!=null) + { + delete titleScreen; + } + } + + void TitleScreen::Initialize() + { + titleScreen = new TitleScreenActor(this, (float)View::ScaleWidth()/2,(float)View::ScaleHeight()/2); + } + + void TitleScreen::LoadContent() + { + MusicManager::loadSong("Main Theme"); + Menus::playSong("Main Theme"); + titleScreen->eventEnable(Actor::EVENT_MOUSERELEASE); + Game::showBackground(false); + Menus::menuNo = MENU_TITLESCREEN; + Animation*anim = new Animation("title",1); + anim->addFrame("Images/Menus/titlescreen.png"); + titleScreen->addAnimation(anim); + titleScreen->changeAnimation("title", FORWARD); + titleScreen->Scale = 1.876f; + } + + void TitleScreen::Update(long gameTime) + { + titleScreen->Update(gameTime); + if(changing && changeTime<=gameTime) + { + MusicManager::loadSong("Menu Theme"); + ScreenManager::GoToScreen("MainMenu"); + changeTime = 0; + changing = false; + } + } + + void TitleScreen::Draw(Graphics2D&g, long gameTime) + { + if(changing) + { + g.setColor(Color::WHITE); + g.fillRect(0, 0, (float)View::ScaleWidth(), (float)View::ScaleHeight()); + } + else + { + titleScreen->Draw(g, gameTime); + } + } + + MainMenu::MainMenu(const String&name) : MenuScreen(name) + { + // + } + + MainMenu::~MainMenu() + { + // + } + + void MainMenu::Initialize() + { + addItem(260, 180, "Images/Menus/Buttons/Group/group.png", "Images/Menus/Buttons/Group/group_selected.png", "GroupMenu"); + setItemScale(0,1.15f); + setItemSound(0, Menus::soundMgr->getSound("select menu item")); + addItem(630, 215, "Images/Menus/Buttons/Solo/solo.png", "Images/Menus/Buttons/Solo/solo_selected.png", "SoloMenu"); + setItemScale(1,1.15f); + setItemSound(1, Menus::soundMgr->getSound("select menu item")); + addItem(700, 395, "Images/Menus/Buttons/Options/options.png", "Images/Menus/Buttons/Options/options_selected.png", "OptionsMenu"); + setItemScale(2,1.25f); + setItemSound(2, Menus::soundMgr->getSound("select menu item")); + addItem(200, 400, "Images/Menus/Buttons/Bluetooth/Bluetooth.png", "Images/Menus/Buttons/Bluetooth/Bluetooth_selected.png", "BluetoothMenu"); + setItemSound(3, Menus::soundMgr->getSound("select menu item")); + } + + void MainMenu::LoadContent() + { + if(Menus::menuNo==MENU_TITLESCREEN) + { + MusicManager::loadSong("Menu Theme"); + Menus::playSong("Menu Theme"); + } + Menus::menuNo = MENU_MAINMENU; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + if(Preferences::menuSoundFXOn()) + { + this->enableSound(true); + } + else + { + this->enableSound(false); + } + + } + + void MainMenu::Update(long gameTime) + { + MenuScreen::Update(gameTime); + Menus::button_back->Update(gameTime); + Menus::description->Update(gameTime); + + switch(selectedIndex) + { + default: + Menus::description->setText(""); + break; + + case 0: + Menus::description->setText("Play a variety of Smash modes with multiple players"); + break; + + case 1: + Menus::description->setText("Play this mode solo or challenge it coopertively"); + break; + + case 2: + Menus::description->setText("Choose and save your own personal Smash settings"); + break; + } + } + + void MainMenu::Draw(Graphics2D&g, long gameTime) + { + MenuScreen::Draw(g,gameTime); + Menus::button_back->Draw(g, gameTime); + Menus::description->Draw(g,gameTime); + } + + GroupMenu::GroupMenu(const String&name) : MenuScreen(name) + { + // + } + + GroupMenu::~GroupMenu() + { + // + } + + void GroupMenu::Initialize() + { + addItem(280, 200, "Images/Menus/Buttons/Group/brawl.png", "Images/Menus/Buttons/Group/brawl_selected.png", "BrawlCharSelect"); + setItemSound(0, Menus::soundMgr->getSound("select menu item")); + addItem(680, 220, "Images/Menus/Buttons/Group/rules.png", "Images/Menus/Buttons/Group/rules_selected.png", "RulesMenu"); + setItemScale(1, 2); + setItemSound(1, Menus::soundMgr->getSound("select menu item")); + } + + void GroupMenu::LoadContent() + { + Menus::menuNo = MENU_GROUPMENU; + if(Global::gameMode == 0) + { + Global::gameMode = Global::MODE_TIME_LIMIT; + } + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + if(Preferences::menuSoundFXOn()) + { + this->enableSound(true); + } + else + { + this->enableSound(false); + } + } + + void GroupMenu::Update(long gameTime) + { + MenuScreen::Update(gameTime); + Menus::button_back->Update(gameTime); + switch(selectedIndex) + { + default: + Menus::description->setText(""); + break; + + case 0: + Menus::description->setText("Jump right in and start brawling with your friends!"); + break; + } + Menus::description->Update(gameTime); + } + + void GroupMenu::Draw(Graphics2D&g, long gameTime) + { + MenuScreen::Draw(g, gameTime); + Menus::button_back->Draw(g, gameTime); + Menus::description->Draw(g, gameTime); + } + + SoloMenu::SoloMenu(const String&name) : MenuScreen(name) + { + // + } + + SoloMenu::~SoloMenu() + { + // + } + + void SoloMenu::Initialize() + { + addItem(700, 380, "Images/Menus/Buttons/Solo/training.png", "Images/Menus/Buttons/Solo/training_selected.png", "TrainingCharSelect"); + //setItemScale(0, 1.6f); + setItemSound(0, Menus::soundMgr->getSound("select menu item")); + } + + void SoloMenu::LoadContent() + { + Menus::menuNo = MENU_SOLOMENU; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + if(Preferences::menuSoundFXOn()) + { + this->enableSound(true); + } + else + { + this->enableSound(false); + } + } + + void SoloMenu::Update(long gameTime) + { + MenuScreen::Update(gameTime); + Menus::button_back->Update(gameTime); + } + + void SoloMenu::Draw(Graphics2D&g, long gameTime) + { + MenuScreen::Draw(g, gameTime); + Menus::button_back->Draw(g, gameTime); + } + + BrawlCharSelect::RulesBar::RulesBar(float x1, float y1) : Actor(x1,y1) + { + // + } + + BrawlCharSelect::RulesBar::~RulesBar() + { + // + } + + void BrawlCharSelect::RulesBar::onMouseEnter() + { + changeAnimation("hover", FORWARD); + } + + void BrawlCharSelect::RulesBar::onMouseLeave() + { + changeAnimation("normal", FORWARD); + } + + void BrawlCharSelect::RulesBar::onRelease() + { + ScreenManager::GoToScreen("RulesMenu"); + changeAnimation("normal",FORWARD); + } + + BrawlCharSelect::ReadyToFightBar::ReadyToFightBar(float x1, float y1) : Actor(x1,y1) + { + // + } + + BrawlCharSelect::ReadyToFightBar::~ReadyToFightBar() + { + // + } + + void BrawlCharSelect::ReadyToFightBar::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void BrawlCharSelect::ReadyToFightBar::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void BrawlCharSelect::ReadyToFightBar::onRelease() + { + ScreenManager::GoToScreen("BrawlStageSelect"); + } + + BrawlCharSelect::TeamsButton::TeamsButton(float x1, float y1) : Actor(x1, y1) + { + // + } + + BrawlCharSelect::TeamsButton::~TeamsButton() + { + // + } + + void BrawlCharSelect::TeamsButton::onMouseEnter() + { + if(Global::teamBattle) + { + changeAnimation("team_hover", FORWARD); + } + else + { + changeAnimation("hover", FORWARD); + } + } + + void BrawlCharSelect::TeamsButton::onMouseLeave() + { + if(Global::teamBattle) + { + changeAnimation("team_normal", FORWARD); + } + else + { + changeAnimation("normal", FORWARD); + } + } + + void BrawlCharSelect::TeamsButton::onRelease() + { + if(Global::teamBattle) + { + Global::teamBattle = false; + if(mouseOver()) + { + changeAnimation("hover", FORWARD); + } + else + { + changeAnimation("normal", FORWARD); + } + } + else + { + Global::teamBattle = true; + if(mouseOver()) + { + changeAnimation("team_hover", FORWARD); + } + else + { + changeAnimation("team_normal", FORWARD); + } + } + } + + BrawlCharSelect::BrawlCharSelect(const String&name) : CharSelectScreen(name) + { + wasReadyToFight = false; + } + + BrawlCharSelect::~BrawlCharSelect() + { + if(rules_bar!=null) + { + delete rules_bar; + } + if(rules_bar_text!=null) + { + delete rules_bar_text; + } + if(rules_bar_value!=null) + { + delete rules_bar_value; + } + if(rules_arrows!=null) + { + delete rules_arrows; + } + if(readyToFight!=null) + { + delete readyToFight; + } + if(teams_button!=null) + { + delete teams_button; + } + } + + void BrawlCharSelect::Initialize() + { + ArrayList cardTypes; + cardTypes.add(0); cardTypes.add(2); cardTypes.add(2); cardTypes.add(2); + createCards(cardTypes); + createCharIcons(); + + ArrayList resetTypes; + resetTypes.add(1); resetTypes.add(0); resetTypes.add(0); resetTypes.add(0); + resetCards(resetTypes); + + Animation*normal = new Animation("normal",1,"Images/Menus/Buttons/Generic/rules_bar.png"); + Animation*hover = new Animation("hover",1,"Images/Menus/Buttons/Generic/rules_bar_selected.png"); + rules_bar = new RulesBar(684,50); + rules_bar->addAnimation(normal); + rules_bar->addAnimation(hover); + rules_bar->changeAnimation("normal", FORWARD); + rules_bar->Scale = 1.8f; + rules_bar_value = new TextActor(510,60,"02",AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 30),Color::BLACK); + rules_bar_value->setAlignment(TextActor::ALIGN_BOTTOMLEFT); + rules_bar_text = new TextActor(560,60,"",AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 26),Color::BLACK); + rules_bar_text->setAlignment(TextActor::ALIGN_BOTTOMLEFT); + + readyToFight = new ReadyToFightBar(View::ScaleWidth()/2, 380); + readyToFight->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/readytofight.png")); + readyToFight->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/readytofight_selected.png")); + readyToFight->changeAnimation("normal", FORWARD); + readyToFight->Scale = 1.845f; + readyToFight->mouseOverUsesPixel(true); + + rules_arrows = new Arrows(530,22,530,72); + switch(Global::gameMode) + { + case Global::MODE_STOCK: + rules_arrows->setValue(Global::stockAmount); + rules_arrows->setProperties(Global::minLives, Global::maxLives, 1); + break; + + case Global::MODE_TIME_LIMIT: + rules_arrows->setValue(Global::timeLimit); + rules_arrows->setProperties(Global::minTime, Global::maxTime, 1); + break; + } + rules_arrows->setScale(1.5f); + + teams_button = new TeamsButton(260,35); + teams_button->Scale = 1.7f; + + teams_button->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Group/freeforall.png")); + teams_button->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Group/freeforall_selected.png")); + teams_button->addAnimation(new Animation("team_normal",1,"Images/Menus/Buttons/Group/teambattle.png")); + teams_button->addAnimation(new Animation("team_hover",1,"Images/Menus/Buttons/Group/teambattle_selected.png")); + teams_button->changeAnimation("normal", FORWARD); + } + + void BrawlCharSelect::LoadContent() + { + if(Menus::menuNo==MENU_GROUPMENU) + { + ArrayList resetType; + resetType.add(1); resetType.add(0); resetType.add(0); resetType.add(0); + resetCards(resetType); + + for(int i=0; i<4; i++) + { + hideCoin(i, false); + enableCardChange(i); + } + wasReadyToFight = false; + } + else if(Menus::menuNo==MENU_P2PMENU) + { + ArrayList resetType; + resetType.add(1); resetType.add(1); + resetCards(resetType); + for(int i=0; i<4; i++) + { + disableCardChange(i); + } + for(int i=1; i<4; i++) + { + hideCoin(i, true); + } + wasReadyToFight = false; + } + + if(Menus::menuNo == MENU_P2PMENU || Menus::menuNo == MENU_RULESMENU_P2PCHARSELECT || Menus::menuNo == MENU_P2PSTAGESELECT) + { + Menus::menuNo=MENU_P2PCHARSELECT; + } + else + { + Menus::menuNo=MENU_BRAWLCHARSELECT; + } + switch(Global::gameMode) + { + case Global::MODE_STOCK: + rules_arrows->setProperties(Global::minLives, Global::maxLives, 1); + rules_arrows->setValue(Global::stockAmount); + break; + + case Global::MODE_TIME_LIMIT: + rules_arrows->setProperties(Global::minTime, Global::maxTime, 1); + rules_arrows->setValue(Global::timeLimit); + break; + } + if(Global::teamBattle) + { + teams_button->changeAnimation("team_normal", FORWARD); + } + else + { + teams_button->changeAnimation("normal", FORWARD); + } + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + } + + void BrawlCharSelect::Update(long gameTime) + { + P2PDataManager::updateGame(gameTime); + switch(Global::gameMode) + { + case Global::MODE_STOCK: + rules_arrows->setValue(Global::stockAmount); + rules_arrows->setProperties(Global::minLives, Global::maxLives, 1); + break; + + case Global::MODE_TIME_LIMIT: + rules_arrows->setValue(Global::timeLimit); + rules_arrows->setProperties(Global::minTime, Global::maxTime, 1); + break; + } + if(Menus::menuNo==MENU_P2PCHARSELECT) + { + selectCharacter(2, Global::selectedChar[1]); //TODO: fix for multiple peers + } + CharSelectScreen::Update(gameTime); + rules_arrows->Update(gameTime); + if(rules_arrows->wasClicked()) + { + rules_bar->eventDisable(Actor::EVENT_MOUSERELEASE); + } + else + { + rules_bar->eventEnable(Actor::EVENT_MOUSERELEASE); + } + rules_bar->Update(gameTime); + int prevValue; + switch(Global::gameMode) + { + case Global::MODE_STOCK: + prevValue = Global::stockAmount; + Global::stockAmount = rules_arrows->getValue(); + if(prevValue!=Global::stockAmount) + { + P2PDataManager::toggleSetting("stockAmount", 0); + } + if(Global::stockAmount<10) + { + rules_bar_value->setText((String)"0" + Global::stockAmount); + } + else + { + rules_bar_value->setText((String)"" + Global::stockAmount); + } + rules_bar_text->setText("- Man Survival Test!"); + break; + + case Global::MODE_TIME_LIMIT: + prevValue = Global::timeLimit; + Global::timeLimit = rules_arrows->getValue(); + if(prevValue != Global::timeLimit) + { + P2PDataManager::toggleSetting("timeLimit", 0); + } + if(Global::timeLimit<10) + { + rules_bar_value->setText((String)"0" + Global::timeLimit); + } + else + { + rules_bar_value->setText((String)"" + Global::timeLimit); + } + rules_bar_text->setText("- Minute Survival Match!"); + break; + } + rules_bar_value->Update(gameTime); + rules_bar_text->Update(gameTime); + if(!P2PDataManager::isEnabled()) + { + teams_button->Update(gameTime); + } + if(checkReadyToFight(2) && !coinsClicked()) + { + if(!wasReadyToFight) + { + wasReadyToFight = true; + Menus::playSound("ready to fight"); + } + readyToFight->Update(gameTime); + } + else + { + wasReadyToFight = false; + } + } + + void BrawlCharSelect::Draw(Graphics2D&g, long gameTime) + { + rules_bar->Draw(g, gameTime); + rules_bar_value->Draw(g, gameTime); + rules_bar_text->Draw(g, gameTime); + rules_arrows->Draw(g, gameTime); + if(!P2PDataManager::isEnabled()) + { + teams_button->Draw(g, gameTime); + } + CharSelectScreen::Draw(g,gameTime); + if(checkReadyToFight(2) && !coinsClicked()) + { + readyToFight->Draw(g, gameTime); + } + } + + void BrawlCharSelect::onSelectCharacter(int player, int character) + { + if(P2PManager::isConnected() && player==1) + { + DataVoid data; + byte type = P2PDataManager::DATA_CHARSELECT; + data.add(&type, sizeof(byte)); + data.add(&character, sizeof(character)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + } + + BrawlStageSelect::BrawlStageSelect(const String&name) : StageSelectScreen(name) + { + // + } + + BrawlStageSelect::~BrawlStageSelect() + { + // + } + + void BrawlStageSelect::LoadContent() + { + StageSelectScreen::LoadContent(); + if(Menus::menuNo == MENU_BRAWLCHARSELECT) + { + Menus::menuNo = MENU_BRAWLSTAGESELECT; + } + else if(Menus::menuNo == MENU_P2PCHARSELECT) + { + Menus::menuNo = MENU_P2PSTAGESELECT; + } + Global::gameType = Global::TYPE_GROUPBRAWL; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + } + + void BrawlStageSelect::Update(long gameTime) + { + StageSelectScreen::Update(gameTime); + } + + void BrawlStageSelect::onSelect(int stageNo) + { + if(Menus::menuNo==MENU_P2PSTAGESELECT) + { + Global::stageVotes.add(stageNo); + + Global::selfReadyToPlay = true; + DataVoid data; + byte type = P2PDataManager::DATA_STARTGAME; + data.add(&type, sizeof(type)); + data.add(&stageNo, sizeof(stageNo)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + } + + void BrawlStageSelect::onLoad() + { + if(Menus::menuNo==MENU_P2PSTAGESELECT) + { + Console::WriteLine("going to P2PWaitScreen"); + ScreenManager::GoToScreen("P2PWaitScreen"); + } + else + { + StageSelectScreen::onLoad(); + } + } + + OptionsMenu::OptionsMenu(const String&name) : MenuScreen(name) + { + // + } + + OptionsMenu::~OptionsMenu() + { + // + } + + void OptionsMenu::Initialize() + { + addItem(140, 270, "Images/Menus/Buttons/Options/controls.png", "Images/Menus/Buttons/Options/controls_selected.png", "ControlOptions"); + setItemScale(0, 1.6f); + setItemSound(0, Menus::soundMgr->getSound("select menu item")); + addItem(346, 270, "Images/Menus/Buttons/Options/sound.png", "Images/Menus/Buttons/Options/sound_selected.png", "AudioOptions"); + setItemScale(1, 1.6f); + setItemSound(1, Menus::soundMgr->getSound("select menu item")); + addItem(554, 270, "Images/Menus/Buttons/Options/display.png", "Images/Menus/Buttons/Options/display_selected.png", "DisplayOptions"); + setItemScale(2, 1.6f); + setItemSound(2, Menus::soundMgr->getSound("select menu item")); + addItem(760, 270, "Images/Menus/Buttons/Options/other.png", "Images/Menus/Buttons/Options/other_selected.png", "OtherOptions"); + setItemScale(3, 1.6f); + setItemSound(3, Menus::soundMgr->getSound("select menu item")); + } + + void OptionsMenu::LoadContent() + { + Menus::menuNo = MENU_OPTIONSMENU; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + if(Preferences::menuSoundFXOn()) + { + this->enableSound(true); + } + else + { + this->enableSound(false); + } + } + + void OptionsMenu::Update(long gameTime) + { + MenuScreen::Update(gameTime); + Menus::button_back->Update(gameTime); + switch(selectedIndex) + { + default: + Menus::description->setText(""); + break; + + case 0: + Menus::description->setText("Customize your controls to fit your preference"); + break; + + case 1: + Menus::description->setText("Change sound/music volume and behavior"); + break; + + case 2: + Menus::description->setText("Change window to full screen and other display settings"); + break; + + case 3: + Menus::description->setText("Miscellaneous settings"); + break; + } + Menus::description->Update(gameTime); + } + + void OptionsMenu::Draw(Graphics2D&g, long gameTime) + { + MenuScreen::Draw(g, gameTime); + Menus::button_back->Draw(g, gameTime); + Menus::description->Draw(g, gameTime); + } + + ControlOptions::ControlOptions(const String&name) : Screen(name) + { + joystickLabel = new MenuBarSmall(200,140,"Joystick"); + joystickLabel->Scale = 2; + dpadLabel = new MenuBarSmall(600,140,"D-Pad"); + dpadLabel->Scale = 2; + toggles = new ToggleButtons(390,140, 790,140); + toggles->setScale(1.6f); + + button_a = new Actor(820, 450); + button_a->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_a.png")); + button_a->changeAnimation("normal", FORWARD); + button_a->relativeToView(false); + button_a->Scale = 2; + button_a->setAlpha(0.2f); + + button_b = new Actor(707.5f, 525); + button_b->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_b.png")); + button_b->changeAnimation("normal", FORWARD); + button_b->relativeToView(false); + button_b->Scale = 2; + button_b->setAlpha(0.2f); + + button_x = new Actor(820, 337.5f); + button_x->addAnimation(new Animation("normal", 1, "Images/Game/Controls/button_xy.png")); + button_x->changeAnimation("normal", FORWARD); + button_x->relativeToView(false); + button_x->Scale = 2; + button_x->setAlpha(0.2f); + + arrow_up = new Actor(150, 375); + arrow_up->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_up.png")); + arrow_up->changeAnimation("normal", FORWARD); + arrow_up->relativeToView(false); + arrow_up->Scale = 2; + arrow_up->setAlpha(0.5f); + + arrow_down = new Actor(150, 525); + arrow_down->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_down.png")); + arrow_down->changeAnimation("normal", FORWARD); + arrow_down->relativeToView(false); + arrow_down->Scale = 2; + arrow_down->setAlpha(0.5f); + + arrow_left = new Actor(75, 450); + arrow_left->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_left.png")); + arrow_left->changeAnimation("normal", FORWARD); + arrow_left->relativeToView(false); + arrow_left->Scale = 2; + arrow_left->setAlpha(0.5f); + + arrow_right = new Actor(225, 450); + arrow_right->addAnimation(new Animation("normal", 1, "Images/Game/Controls/arrow_right.png")); + arrow_right->changeAnimation("normal", FORWARD); + arrow_right->relativeToView(false); + arrow_right->Scale = 2; + arrow_right->setAlpha(0.5f); + + joystickArea = new WireframeActor(0,0,View::ScaleWidth()/2, View::ScaleHeight()); + joystickArea->relativeToView(false); + + joystick = new Actor(150, 450); + joystick->addAnimation(new Animation("center", 1, "Images/Game/Controls/joystick_center.png")); + joystick->addAnimation(new Animation("up", 1, "Images/Game/Controls/joystick_up.png")); + joystick->addAnimation(new Animation("up2", 1, "Images/Game/Controls/joystick_up2.png")); + joystick->addAnimation(new Animation("down", 1, "Images/Game/Controls/joystick_down.png")); + joystick->addAnimation(new Animation("down2", 1, "Images/Game/Controls/joystick_down2.png")); + joystick->addAnimation(new Animation("left", 1, "Images/Game/Controls/joystick_left.png")); + joystick->addAnimation(new Animation("left2", 1, "Images/Game/Controls/joystick_left2.png")); + joystick->addAnimation(new Animation("right", 1, "Images/Game/Controls/joystick_right.png")); + joystick->addAnimation(new Animation("right2", 1, "Images/Game/Controls/joystick_right2.png")); + joystick->addAnimation(new Animation("up_left", 1, "Images/Game/Controls/joystick_up_left.png")); + joystick->addAnimation(new Animation("up_left2", 1, "Images/Game/Controls/joystick_up_left2.png")); + joystick->addAnimation(new Animation("up_right", 1, "Images/Game/Controls/joystick_up_right.png")); + joystick->addAnimation(new Animation("up_right2", 1, "Images/Game/Controls/joystick_up_right2.png")); + joystick->addAnimation(new Animation("down_left", 1, "Images/Game/Controls/joystick_down_left.png")); + joystick->addAnimation(new Animation("down_left2", 1, "Images/Game/Controls/joystick_down_left2.png")); + joystick->addAnimation(new Animation("down_right", 1, "Images/Game/Controls/joystick_down_right.png")); + joystick->addAnimation(new Animation("down_right2", 1, "Images/Game/Controls/joystick_down_right2.png")); + joystick->changeAnimation("center", FORWARD); + joystick->relativeToView(false); + joystick->Scale = 2; + joystick->setAlpha(0.5f); + + joystickDir = 0; + joystickFar = false; + joystickDown = false; + joystickEnabled = true; + } + + ControlOptions::~ControlOptions() + { + delete button_a; + delete button_b; + delete button_x; + delete arrow_up; + delete arrow_down; + delete arrow_left; + delete arrow_right; + delete joystick; + delete joystickArea; + } + + void ControlOptions::Initialize() + { + // + } + + void ControlOptions::LoadContent() + { + Menus::menuNo = MENU_CONTROLOPTIONS; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + if(Controls::isJoystickActive()) + { + joystickEnabled = true; + toggles->setToggle(1); + } + else + { + joystickEnabled = false; + toggles->setToggle(2); + } + + } + + void ControlOptions::UnloadContent() + { + Preferences::save(); + } + + void ControlOptions::Update(long gameTime) + { + Menus::button_back->Update(gameTime); + joystickLabel->Update(gameTime); + dpadLabel->Update(gameTime); + toggles->Update(gameTime); + if(toggles->getToggle()==1) + { + joystickEnabled = true; + } + else if(toggles->getToggle()==2) + { + joystickEnabled = false; + } + + joystickArea->Update(gameTime); + joystick->Update(gameTime); + button_a->Update(gameTime); + button_b->Update(gameTime); + button_x->Update(gameTime); + arrow_up->Update(gameTime); + arrow_down->Update(gameTime); + arrow_left->Update(gameTime); + arrow_right->Update(gameTime); + + if(!Menus::button_back->isClicked() && !toggles->isClicked()) + { + if(button_a->isClicked() && !button_a->wasClicked()) + { + button_a->setColor(Color::BLUE); + } + else if(!button_a->isClicked() && button_a->wasClicked()) + { + button_a->setColor(Color::WHITE); + } + else if(button_b->isClicked() && !button_b->wasClicked()) + { + button_b->setColor(Color::GREEN); + } + else if(!button_b->isClicked() && button_b->wasClicked()) + { + button_b->setColor(Color::WHITE); + } + else if(button_x->isClicked() && !button_x->wasClicked()) + { + button_x->setColor(Color::YELLOW); + } + else if(!button_x->isClicked() && button_x->wasClicked()) + { + button_x->setColor(Color::WHITE); + } + + if(joystickEnabled) + { + if(joystickArea->isClicked()) + { + long touchId = joystickArea->getTouchId(); + int mousex = Game::TouchX(touchId); + int mousey = Game::TouchY(touchId); + byte dir = PrimitiveActor::getDir(joystick->x, joystick->y, (float)mousex, (float)mousey); + float dist = (float)PrimitiveActor::distanceUnSqr(joystick->x, joystick->y, (float)mousex, (float)mousey); + if(dist<=centerDist) + { + if(joystickDir!=0) + { + joystick->changeAnimation("center", NO_CHANGE); + joystickDown = true; + joystickFar = false; + joystickDir = 0; + } + } + else if(distchangeAnimation("up", NO_CHANGE); + break; + + case PrimitiveActor::DIR_UPLEFT: + joystick->changeAnimation("up_left", NO_CHANGE); + break; + + case PrimitiveActor::DIR_UPRIGHT: + joystick->changeAnimation("up_right", NO_CHANGE); + break; + + case PrimitiveActor::DIR_LEFT: + joystick->changeAnimation("left", NO_CHANGE); + break; + + case PrimitiveActor::DIR_RIGHT: + joystick->changeAnimation("right", NO_CHANGE); + break; + + case PrimitiveActor::DIR_DOWNLEFT: + joystick->changeAnimation("down_left", NO_CHANGE); + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + joystick->changeAnimation("down_right", NO_CHANGE); + break; + + case PrimitiveActor::DIR_DOWN: + joystick->changeAnimation("down", NO_CHANGE); + break; + } + } + } + else + { + if(!(joystickDir==dir && joystickFar)) + { + joystickDir = dir; + joystickDown = true; + joystickFar = true; + switch(dir) + { + case PrimitiveActor::DIR_UP: + joystick->changeAnimation("up2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_UPLEFT: + joystick->changeAnimation("up_left2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_UPRIGHT: + joystick->changeAnimation("up_right2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_LEFT: + joystick->changeAnimation("left2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_RIGHT: + joystick->changeAnimation("right2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_DOWNLEFT: + joystick->changeAnimation("down_left2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_DOWNRIGHT: + joystick->changeAnimation("down_right2", NO_CHANGE); + break; + + case PrimitiveActor::DIR_DOWN: + joystick->changeAnimation("down2", NO_CHANGE); + break; + } + } + } + } + else + { + if(joystickDown) + { + joystick->changeAnimation("center", NO_CHANGE); + joystickDir = 0; + joystickDown = false; + joystickFar = false; + } + } + } + else + { + if(arrow_up->isClicked() && !arrow_up->wasClicked()) + { + arrow_up->setColor(Color::YELLOW); + } + else if(!arrow_up->isClicked() && arrow_up->wasClicked()) + { + arrow_up->setColor(Color::WHITE); + } + if(arrow_down->isClicked() && !arrow_down->wasClicked()) + { + arrow_down->setColor(Color::YELLOW); + } + else if(!arrow_down->isClicked() && arrow_down->wasClicked()) + { + arrow_down->setColor(Color::WHITE); + } + if(arrow_left->isClicked() && !arrow_left->wasClicked()) + { + arrow_left->setColor(Color::YELLOW); + } + else if(!arrow_left->isClicked() && arrow_left->wasClicked()) + { + arrow_left->setColor(Color::WHITE); + } + if(arrow_right->isClicked() && !arrow_right->wasClicked()) + { + arrow_right->setColor(Color::YELLOW); + } + else if(!arrow_right->isClicked() && arrow_right->wasClicked()) + { + arrow_right->setColor(Color::WHITE); + } + } + } + Controls::setJoystickActive(joystickEnabled); + } + + void ControlOptions::Draw(Graphics2D&g, long gameTime) + { + Menus::button_back->Draw(g, gameTime); + joystickLabel->Draw(g, gameTime); + dpadLabel->Draw(g, gameTime); + toggles->Draw(g, gameTime); + + button_a->Draw(g, gameTime); + button_b->Draw(g, gameTime); + button_x->Draw(g, gameTime); + if(joystickEnabled) + { + joystickArea->Draw(g, gameTime); + joystick->Draw(g, gameTime); + } + else + { + arrow_up->Draw(g, gameTime); + arrow_down->Draw(g, gameTime); + arrow_left->Draw(g, gameTime); + arrow_right->Draw(g, gameTime); + } + } + + AudioOptions::AudioOptions(const String&name) : Screen(name) + { + menumusic = null; + menusoundfx = null; + ingamemusic = null; + } + + AudioOptions::~AudioOptions() + { + if(menumusic!=null) + { + delete menumusic; + } + if(menusoundfx!=null) + { + delete menusoundfx; + } + if(ingamemusic!=null) + { + delete ingamemusic; + } + } + + void AudioOptions::onSettingToggle(String setting, boolean toggle) + { + if(setting.equals("menumusic")) + { + Preferences::toggleMenuMusic(toggle); + if(toggle) + { + MusicManager::play(); + } + else + { + MusicManager::stop(); + } + } + else if(setting.equals("menusoundfx")) + { + Preferences::toggleMenuSoundFX(toggle); + } + else if(setting.equals("ingamemusic")) + { + Preferences::toggleInGameMusic(toggle); + } + } + + void AudioOptions::Initialize() + { + prevMenumusic = Preferences::menuMusicOn(); + prevMenusoundfx = Preferences::menuSoundFXOn(); + prevIngamemusic = Preferences::ingameMusicOn(); + + menumusic = new MenuBarToggle(300,130,"Menu Music",prevMenumusic); + menumusic->Scale = 1.6f; + + menusoundfx = new MenuBarToggle(300,200,"Menu SoundFX",prevMenusoundfx); + menusoundfx->Scale = 1.6f; + menusoundfx->setTextOffsetX(18); + + ingamemusic = new MenuBarToggle(300,270,"In-Game Music",prevIngamemusic); + ingamemusic->Scale = 1.6f; + ingamemusic->setTextOffsetX(20); + } + + void AudioOptions::LoadContent() + { + Menus::menuNo = MENU_AUDIOOPTIONS; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + } + + void AudioOptions::UnloadContent() + { + Preferences::save(); + } + + void AudioOptions::Update(long gameTime) + { + menumusic->Update(gameTime); + if(menumusic->getToggle() != prevMenumusic) + { + onSettingToggle("menumusic", menumusic->getToggle()); + } + prevMenumusic = menumusic->getToggle(); + + menusoundfx->Update(gameTime); + if(menusoundfx->getToggle() != prevMenusoundfx) + { + onSettingToggle("menusoundfx", menusoundfx->getToggle()); + } + prevMenusoundfx = menusoundfx->getToggle(); + + ingamemusic->Update(gameTime); + if(ingamemusic->getToggle() != prevIngamemusic) + { + onSettingToggle("ingamemusic", ingamemusic->getToggle()); + } + prevIngamemusic = ingamemusic->getToggle(); + + Menus::button_back->Update(gameTime); + } + + void AudioOptions::Draw(Graphics2D&g, long gameTime) + { + menumusic->Draw(g, gameTime); + menusoundfx->Draw(g, gameTime); + ingamemusic->Draw(g, gameTime); + Menus::button_back->Draw(g, gameTime); + } + + DisplayOptions::DisplayOptions(const String&name) : Screen(name) + { + // + } + + DisplayOptions::~DisplayOptions() + { + if(fullScreen!=null) + { + delete fullScreen; + } + if(fps!=null) + { + delete fps; + } + } + + void DisplayOptions::onSettingToggle(String setting, boolean toggle) + { + if(setting.equals("fullscreen")) + { + //TODO: add fullscreen + //Game::setFullScreen(toggle); + } + } + + void DisplayOptions::Initialize() + { + /*fullScreen = new MenuBarToggle(300,130,"Full Screen"); + fullScreen->Scale = 1.6f; + prevFullscreen = fullScreen->getToggle();*/ + + fps = new MenuBarValue(300, 130/*200*/, "Frame Rate"); + if(Preferences::highFPS()) + { + fps->setValue(60); + } + else + { + fps->setValue(30); + } + fps->setProperties(30, 60, 30); + fps->Scale = 1.6f; + } + + void DisplayOptions::LoadContent() + { + Menus::menuNo = MENU_DISPLAYOPTIONS; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + if(Preferences::highFPS()) + { + fps->setValue(60); + } + else + { + fps->setValue(30); + } + } + + void DisplayOptions::UnloadContent() + { + Preferences::save(); + } + + void DisplayOptions::Update(long gameTime) + { + /*fullScreen->Update(gameTime); + if(prevFullscreen != fullScreen->getToggle()) + { + onSettingToggle("fullscreen",fullScreen->getToggle()); + } + prevFullscreen = fullScreen->getToggle();*/ + + fps->Update(gameTime); + if(fps->getValue()==60) + { + Preferences::setHighFPS(true); + } + else if(fps->getValue()==30) + { + Preferences::setHighFPS(false); + } + Menus::button_back->Update(gameTime); + } + + void DisplayOptions::Draw(Graphics2D&g, long gameTime) + { + //fullScreen->Draw(g, gameTime); + fps->Draw(g, gameTime); + Menus::button_back->Draw(g, gameTime); + } + + OtherOptions::FacebookButton::FacebookButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) + { + // + } + + OtherOptions::FacebookButton::~FacebookButton() + { + // + } + + void OtherOptions::FacebookButton::onRelease() + { + openURL("https://www.facebook.com/BrokenPhysicsStudios/"); + } + + OtherOptions::ContactDeveloperButton::ContactDeveloperButton(float x1, float y1, const String&label) : MenuBarSmallButton(x1,y1,label) + { + // + } + + OtherOptions::ContactDeveloperButton::~ContactDeveloperButton() + { + // + } + + void OtherOptions::ContactDeveloperButton::onRelease() + { + writeEmail(Game::getWindow(), "luisfinke@gmail.com", "iSSB", ""); + } + + OtherOptions::OtherOptions(const String&name) : Screen(name) + { + facebook = NULL; + contactDev = NULL; + } + + OtherOptions::~OtherOptions() + { + if(facebook!=NULL) + { + delete facebook; + } + if(contactDev!=NULL) + { + delete contactDev; + } + } + + void OtherOptions::Initialize() + { + facebook = new FacebookButton(200,140, "Our Facebook"); + facebook->Scale = 2.0f; + facebook->setLabelSize(14); + contactDev = new ContactDeveloperButton(200,200, "Email Developer"); + contactDev->Scale = 2.0f; + contactDev->setLabelSize(14); + contactDev->setTextOffsetX(8); + } + + void OtherOptions::LoadContent() + { + Menus::menuNo = MENU_OTHEROPTIONS; + } + + void OtherOptions::Update(long gameTime) + { + Menus::button_back->Update(gameTime); + facebook->Update(gameTime); + contactDev->Update(gameTime); + } + + void OtherOptions::Draw(Graphics2D&g, long gameTime) + { + Menus::button_back->Draw(g, gameTime); + facebook->Draw(g, gameTime); + contactDev->Draw(g, gameTime); + } + + TrainingCharSelect::ReadyToFightBar::ReadyToFightBar(float x1, float y1) : Actor(x1,y1) + { + // + } + + TrainingCharSelect::ReadyToFightBar::~ReadyToFightBar() + { + // + } + + void TrainingCharSelect::ReadyToFightBar::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void TrainingCharSelect::ReadyToFightBar::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void TrainingCharSelect::ReadyToFightBar::onRelease() + { + ScreenManager::GoToScreen("TrainingStageSelect"); + } + + TrainingCharSelect::TrainingCharSelect(String name) : CharSelectScreen(name) + { + readyToFight = null; + trainingBanner = null; + wasReadyToFight = false; + } + + TrainingCharSelect::~TrainingCharSelect() + { + if(readyToFight!=null) + { + delete readyToFight; + } + if(trainingBanner!=null) + { + delete trainingBanner; + } + } + + void TrainingCharSelect::Initialize() + { + ArrayList types; + types.add(1); types.add(3); + createCards(types); + createCharIcons(); + resetCards(types); + trainingBanner = new Actor(260,35); + trainingBanner->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Solo/training_mode.png")); + trainingBanner->changeAnimation("normal",FORWARD); + trainingBanner->Scale = 1.8f; + + readyToFight = new ReadyToFightBar(450, 380); + readyToFight->addAnimation(new Animation("normal",1,"Images/Menus/Buttons/Generic/readytofight.png")); + readyToFight->addAnimation(new Animation("hover",1,"Images/Menus/Buttons/Generic/readytofight_selected.png")); + readyToFight->changeAnimation("normal", FORWARD); + readyToFight->Scale = 1.845f; + } + + void TrainingCharSelect::LoadContent() + { + if(Menus::menuNo==MENU_SOLOMENU) + { + for(int i=0; i types; + types.add(1); types.add(3); + resetCards(types); + selectRandomCharacter(2); + wasReadyToFight = false; + } + Menus::menuNo=MENU_TRAININGCHARSELECT; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + } + + void TrainingCharSelect::Update(long gameTime) + { + trainingBanner->Update(gameTime); + CharSelectScreen::Update(gameTime); + if(checkReadyToFight(2) && !coinsClicked()) + { + if(!wasReadyToFight) + { + wasReadyToFight = true; + Menus::playSound("ready to fight"); + } + readyToFight->Update(gameTime); + } + else + { + wasReadyToFight = false; + } + + } + + void TrainingCharSelect::Draw(Graphics2D&g, long gameTime) + { + trainingBanner->Draw(g, gameTime); + CharSelectScreen::Draw(g, gameTime); + if(checkReadyToFight(2) && !coinsClicked()) + { + readyToFight->Draw(g, gameTime); + } + } + + TrainingStageSelect::TrainingStageSelect(const String&name) : StageSelectScreen(name) + { + // + } + + TrainingStageSelect::~TrainingStageSelect() + { + // + } + + void TrainingStageSelect::LoadContent() + { + Menus::menuNo = MENU_TRAININGSTAGESELECT; + Global::gameType = Global::TYPE_TRAINING; + Global::gameMode = Global::MODE_FREEFORALL; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + } + + RulesMenu::RulesMenu(const String&name) : Screen(name) + { + // + } + + RulesMenu::~RulesMenu() + { + if(button_items!=null) + { + delete button_items; + } + if(stocks!=null) + { + delete stocks; + } + if(time!=null) + { + delete time; + } + if(gameMode!=null) + { + delete gameMode; + } + } + + void RulesMenu::Initialize() + { + gameMode = new ToggleButtons(615,131,645,201); + gameMode->setScale(1.4f); + + time = new MenuBarValue(300,130,"Time Limit","min"); + time->setProperties(Global::minTime, Global::maxTime, 1); + time->setValue(Global::timeLimit); + time->Scale = 1.6f; + + stocks = new MenuBarValue(330,200,"Stock"); + stocks->setProperties(Global::minLives, Global::maxLives, 1); + stocks->setValue(Global::stockAmount); + stocks->Scale = 1.6f; + + button_items = new MenuBarSmallButton(660,500,"Item Switch","ItemsMenu"); + button_items->Scale = 1.8f; + } + + void RulesMenu::LoadContent() + { + if(Menus::menuNo==MENU_BRAWLCHARSELECT) + { + Menus::menuNo=MENU_RULESMENU_BRAWLCHARSELECT; + } + else if(Menus::menuNo==MENU_GROUPMENU) + { + Menus::menuNo=MENU_RULESMENU_GROUPMENU; + } + else if(Menus::menuNo==MENU_P2PCHARSELECT) + { + Menus::menuNo=MENU_RULESMENU_P2PCHARSELECT; + } + else if(Menus::menuNo==MENU_ITEMMENU_BRAWLCHARSELECT) + { + Menus::menuNo=MENU_RULESMENU_BRAWLCHARSELECT; + } + else if(Menus::menuNo==MENU_ITEMMENU_GROUPMENU) + { + Menus::menuNo=MENU_RULESMENU_GROUPMENU; + } + else if(Menus::menuNo==MENU_ITEMMENU_P2PCHARSELECT) + { + Menus::menuNo=MENU_RULESMENU_P2PCHARSELECT; + } + time->setValue(Global::timeLimit); + stocks->setValue(Global::stockAmount); + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + } + + void RulesMenu::Update(long gameTime) + { + P2PDataManager::updateGame(gameTime); + time->setValue(Global::timeLimit); + stocks->setValue(Global::stockAmount); + Menus::button_back->Update(gameTime); + stocks->Update(gameTime); + time->Update(gameTime); + gameMode->setToggle(Global::gameMode); + gameMode->Update(gameTime); + button_items->Update(gameTime); + + int prevValue = Global::gameMode; + byte gamemode = gameMode->getToggle(); + if(gamemode == 1) + { + Global::gameMode = Global::MODE_TIME_LIMIT; + } + else if(gamemode == 2) + { + Global::gameMode = Global::MODE_STOCK; + } + if(prevValue!=Global::gameMode) + { + P2PDataManager::toggleSetting("gameMode", 0); + } + + prevValue = Global::stockAmount; + Global::stockAmount = stocks->getValue(); + if(prevValue!=Global::stockAmount) + { + P2PDataManager::toggleSetting("stockAmount", 0); + } + + prevValue = Global::timeLimit; + Global::timeLimit = time->getValue(); + if(prevValue!=Global::timeLimit) + { + P2PDataManager::toggleSetting("timeLimit", 0); + } + } + + void RulesMenu::Draw(Graphics2D&g, long gameTime) + { + Menus::button_back->Draw(g, gameTime); + stocks->Draw(g, gameTime); + time->Draw(g, gameTime); + gameMode->Draw(g, gameTime); + button_items->Draw(g, gameTime); + } + + boolean ItemsMenu::updatingGrid = false; + + ItemsMenu::ItemPane::ItemPane(ItemsMenu*menu, int id, float x1, float y1, boolean toggle) : TogglePane(x1,y1,toggle) + { + this->id = id; + this->menu = menu; + } + + ItemsMenu::ItemPane::~ItemPane() + { + // + } + + void ItemsMenu::ItemPane::onToggle(boolean toggle) + { + if(!updatingGrid) + { + Global::itemsOn[id] = toggle; + P2PDataManager::toggleSetting("item", id); + } + } + + ItemsMenu::ItemsMenu(const String&name) : Screen(name) + { + // + } + + ItemsMenu::~ItemsMenu() + { + delete paneGrid; + delete itemGrid; + } + + void ItemsMenu::addActorsToGrid() + { + for(int i=0; i<30; i++) + { + ItemPane*pane = new ItemPane(this,i,0,0,false); + paneGrid->add((Actor*)pane); + } + for(int i=1; i<=Global::totalItems; i++) + { + Actor*a = new Actor(0,0); + + String name = ""; + + switch(i) //TODO: add items + { + case Global::ITEM_SMASHBALL: + name = "Images/Menus/Rules/Items/smashball.png"; + break; + + case Global::ITEM_RAYGUN: + name = "Images/Menus/Rules/Items/raygun.png"; + break; + + case Global::ITEM_HEARTCONTAINER: + name = "Images/Menus/Rules/Items/heart_container.png"; + break; + + case Global::ITEM_BEAMSWORD: + name = "Images/Menus/Rules/Items/beamsword.png"; + break; + + case Global::ITEM_SUPERMUSHROOM: + name = "Images/Menus/Rules/Items/mushroom.png"; + break; + + case Global::ITEM_POISONMUSHROOM: + name = "Images/Menus/Rules/Items/poison_mushroom.png"; + break; + } + + if(!name.equals("")) + { + a->addAnimation(new Animation("normal", 1, name)); + a->changeAnimation("normal", FORWARD); + ((TogglePane*)paneGrid->get(i-1))->setToggle(Global::itemsOn[i-1]); + itemGrid->add(a); + } + else + { + itemGrid->add(null); + } + } + } + + void ItemsMenu::Initialize() + { + paneGrid = new ActorGrid(110,120, 5, 6); + paneGrid->setSpacing(140, 60); + paneGrid->setScale(1.8f); + + itemGrid = new ActorGrid(80,120, 5, 6); + itemGrid->setSpacing(140, 60); + itemGrid->setScale(1.6f); + + addActorsToGrid(); + } + + void ItemsMenu::LoadContent() + { + if(Menus::menuNo==MENU_RULESMENU_BRAWLCHARSELECT) + { + Menus::menuNo=MENU_ITEMMENU_BRAWLCHARSELECT; + } + else if(Menus::menuNo==MENU_RULESMENU_GROUPMENU) + { + Menus::menuNo=MENU_ITEMMENU_GROUPMENU; + } + else if(Menus::menuNo==MENU_RULESMENU_P2PCHARSELECT) + { + Menus::menuNo=MENU_ITEMMENU_P2PCHARSELECT; + } + Game::setBackgroundImage("Images/Menus/Backgrounds/bg2.png"); + for(int i=0; iget(i))->setToggle(Global::itemsOn[i]); + } + } + + void ItemsMenu::UnloadContent() + { + Preferences::save(); + } + + void ItemsMenu::Update(long gameTime) + { + P2PDataManager::updateGame(gameTime); + updatingGrid = true; + for(int i=0; iget(i))->setToggle(Global::itemsOn[i]); + } + updatingGrid = false; + Menus::button_back->Update(gameTime); + paneGrid->Update(gameTime); + itemGrid->Update(gameTime); + switch((paneGrid->getHoveredIndex()+1)) //TODO: add items + { + default: + Menus::description->setText(""); + break; + case Global::ITEM_SMASHBALL: + Menus::description->setText("Smash Ball - Allows you to use your Final Smash"); + break; + case Global::ITEM_RAYGUN: + Menus::description->setText("Ray Gun - Fires a laser bullet at your opponent"); + break; + case Global::ITEM_HEARTCONTAINER: + Menus::description->setText("Heart Container - Replenishes 100% damage"); + break; + case Global::ITEM_BEAMSWORD: + Menus::description->setText("Beam Sword - Saber of pure energy. Hits hard!"); + break; + case Global::ITEM_SUPERMUSHROOM: + Menus::description->setText("Super Mushroom - Makes you become giant-sized"); + break; + case Global::ITEM_POISONMUSHROOM: + Menus::description->setText("Poison Mushroom - Shrinks your characters to mini-size."); + break; + } + Menus::description->Update(gameTime); + } + + void ItemsMenu::Draw(Graphics2D&g, long gameTime) + { + Menus::button_back->Draw(g, gameTime); + paneGrid->Draw(g, gameTime); + itemGrid->Draw(g, gameTime); + Menus::description->Draw(g, gameTime); + } + + BluetoothMenu::PeerCard::PeerCard(const String&name, const String&id) + { + x = 0; + y = 0; + displayName = name; + peerID = id; + device = ""; + card = new Actor(x,y); + card->Scale = 0.5f; + card->addAnimation(new Animation("empty", 1, "Images/Menus/Buttons/Bluetooth/no_peer.png")); + card->addAnimation(new Animation("iPod Touch", 1, "Images/Menus/Buttons/Bluetooth/iPod_Touch.png")); + card->addAnimation(new Animation("iPhone", 1, "Images/Menus/Buttons/Bluetooth/iPhone.png")); + card->changeAnimation("empty", FORWARD); + textDisplay = new TextActor("Click to connect", AssetManager::getFont("Fonts/arial.ttf", Font::PLAIN, 18), Color::BLACK); + textDisplay->x = x; + textDisplay->y = y+190; + textDisplay->setAlignment(TextActor::ALIGN_CENTER); + } + + BluetoothMenu::PeerCard::~PeerCard() + { + delete card; + delete textDisplay; + } + + void BluetoothMenu::PeerCard::Update(long gameTime) + { + card->x = x; + card->y = y; + textDisplay->x = x; + textDisplay->y = y + 190; + + if(!displayName.equals("")) + { + String text = ""; + if(device.equals("iPod Touch") || device.equals("iPod touch")) + { + card->changeAnimation("iPod Touch", FORWARD); + } + else if(device.equals("iPhone")) + { + card->changeAnimation("iPhone", FORWARD); + } + else if(device.equals("iPhone Simulator")) + { + card->changeAnimation("iPhone", FORWARD); + } + else + { + card->changeAnimation("iPod Touch", FORWARD); + } + text += (String)"Device: " + device + '\n'; + text += (String)"Display Name: " + displayName + '\n'; + if(peerID.equals("")) + { + text += (String)"PeerID: NULL"; + } + else + { + text += (String)"PeerID: " + peerID; + } + + textDisplay->setText(text); + } + else + { + card->changeAnimation("empty", FORWARD); + textDisplay->setText("Click to connect"); + } + + card->Update(gameTime); + textDisplay->Update(gameTime); + } + + void BluetoothMenu::PeerCard::Draw(Graphics2D&g, long gameTime) + { + card->x = x; + card->y = y; + textDisplay->x = x; + textDisplay->y = y + 190; + card->Draw(g, gameTime); + textDisplay->Draw(g, gameTime); + } + + boolean BluetoothMenu::PeerCard::isClicked() + { + return card->isClicked(); + } + + boolean BluetoothMenu::PeerCard::wasClicked() + { + return card->wasClicked(); + } + + boolean BluetoothMenu::PeerCard::mouseOver() + { + return card->mouseOver(); + } + + void BluetoothMenu::PeerCard::setDisplayName(const String&name) + { + displayName = name; + } + + void BluetoothMenu::PeerCard::setPeerID(const String&id) + { + peerID = id; + } + + void BluetoothMenu::PeerCard::setDevice(const String&dev) + { + device = dev; + } + + String BluetoothMenu::PeerCard::getDisplayName() + { + return displayName; + } + + String BluetoothMenu::PeerCard::getPeerID() + { + return peerID; + } + + String BluetoothMenu::PeerCard::getDevice() + { + return device; + } + + BluetoothMenu::BluetoothMenu(const String&name) : Screen(name) + { + selfCard = NULL; + peerCard = NULL; + brawl = NULL; + wasConnected = false; + } + + BluetoothMenu::~BluetoothMenu() + { + if(selfCard!=NULL) + { + delete selfCard; + selfCard = NULL; + } + if(peerCard!=NULL) + { + delete peerCard; + peerCard = NULL; + } + if(brawl!=NULL) + { + delete brawl; + brawl = NULL; + } + } + + void BluetoothMenu::Initialize() + { + char buffer[40]; + getDeviceName(buffer); + selfCard = new PeerCard(buffer,""); + getDeviceModel(buffer); + selfCard->setDevice(buffer); + + peerCard = new PeerCard("", ""); + + brawl = new Actor(View::ScaleWidth()/2, 540); + brawl->Scale = 0.5f; + brawl->addAnimation(new Animation("disabled", 1, "Images/Menus/Buttons/Bluetooth/Brawl_disabled.png")); + brawl->addAnimation(new Animation("enabled", 1, "Images/Menus/Buttons/Bluetooth/Brawl.png")); + brawl->addAnimation(new Animation("selected", 1, "Images/Menus/Buttons/Bluetooth/Brawl_selected.png")); + brawl->changeAnimation("disabled", FORWARD); + } + + void BluetoothMenu::LoadContent() + { + P2PDataManager::enabled = true; + Menus::menuNo = MENU_P2PMENU; + Game::setBackgroundImage("Images/Menus/Backgrounds/bg1.png"); + if(!P2PManager::isConnected()) + { + for(int i=0; iUpdate(gameTime); + selfCard->Update(gameTime); + peerCard->Update(gameTime); + brawl->Update(gameTime); + if(P2PManager::isConnected()) + { + if(brawl->wasClicked() && !brawl->isClicked()) + { + brawl->changeAnimation("enabled", FORWARD); + ScreenManager::GoToScreen("BrawlCharSelect"); + } + else if(brawl->isClicked() && !brawl->wasClicked()) + { + brawl->changeAnimation("selected", FORWARD); + } + else if(!brawl->isClicked()) + { + brawl->changeAnimation("enabled", FORWARD); + } + if(!wasConnected) + { + P2PDataManager::sendInitial(); + } + peerCard->setDevice(P2PDataManager::getPeerDevice()); + String peerID = P2PDataManager::getPeerID(); + peerCard->setPeerID(peerID); + peerCard->setDisplayName(P2PManager::getPeerDisplayName(peerID)); + selfCard->setPeerID(P2PManager::getID()); + selfCard->setDisplayName(P2PManager::getDisplayName()); + wasConnected = true; + } + else + { + brawl->changeAnimation("disabled", FORWARD); + if(wasConnected) + { + peerCard->setDevice(""); + peerCard->setDisplayName(""); + peerCard->setPeerID(""); + selfCard->setPeerID("NULL"); + wasConnected = false; + } + else + { + if(peerCard->wasClicked() && !peerCard->isClicked()) + { + P2PDataManager::connectToPeers(); + } + } + } + } + + void BluetoothMenu::Draw(Graphics2D&g, long gameTime) + { + int totalPeers = 2; + + float width = ((float)View::ScaleWidth())/(totalPeers+1); + + Menus::button_back->Draw(g, gameTime); + + selfCard->x = width; + selfCard->y = 250; + peerCard->x = width*2; + peerCard->y = 250; + + selfCard->Draw(g, gameTime); + peerCard->Draw(g, gameTime); + brawl->Draw(g, gameTime); + } + + P2PWaitScreen::P2PWaitScreen(const String&name) : Screen(name) + { + message = new TextActor("Waiting for peer...\n", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 18), Color::BLACK); + message->setAlignment(TextActor::ALIGN_TOPLEFT); + message->x = 100; + message->y = 100; + } + + P2PWaitScreen::~P2PWaitScreen() + { + delete message; + } + + void P2PWaitScreen::LoadContent() + { + Global::P2PMessage = "Waiting for peer...\n"; + Game::showBackground(false); + Game::setBackgroundColor(Color::WHITE); + } + + void P2PWaitScreen::Update(long gameTime) + { + message->Update(gameTime); + + P2PDataManager::updateGame(gameTime); + + if(Global::selfReadyToPlay && Global::peerReadyToPlay) + { + if(P2PDataManager::isServer()) + { + P2PDataManager::serverHandleStart(); + } + } + + if(Global::selfLoaded && Global::peerLoaded) + { + P2PDataManager::handleLoaded(); + } + } + + void P2PWaitScreen::Draw(Graphics2D&g, long gameTime) + { + message->setText(Global::P2PMessage); + message->Draw(g, gameTime); + } +} \ No newline at end of file diff --git a/SmashBros/MenuClasses.h b/SmashBros/MenuClasses.h new file mode 100755 index 0000000..4adb932 --- /dev/null +++ b/SmashBros/MenuClasses.h @@ -0,0 +1,446 @@ +#include "CharSelectScreen.h" +#include "StageSelectScreen.h" +#include "Arrows.h" +#include "MenuBarSmallButton.h" +#include "MenuBarToggle.h" +#include "MenuBarValue.h" +#include "ToggleButtons.h" +#include "TogglePane.h" + +#pragma once + +namespace SmashBros +{ + class TitleScreen; + class MainMenu; + class GroupMenu; + class SoloMenu; + class BrawlCharSelect; + class BrawlStageSelect; + class OptionsMenu; + class ControlOptions; + class AudioOptions; + class DisplayOptions; + class OtherOptions; + class TrainingCharSelect; + class TrainingStageSelect; + class RulesMenu; + class ItemsMenu; + class BluetoothMenu; + + class TitleScreen : public Screen + { + private: + class TitleScreenActor : public Actor + { + public: + TitleScreenActor(TitleScreen*screen, float x1, float y1); + virtual ~TitleScreenActor(); + virtual void onRelease(); + + private: + TitleScreen*screen; + }; + + TitleScreenActor*titleScreen; + + long changeTime; + boolean changing; + + public: + TitleScreen(const String&name); + virtual ~TitleScreen(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class MainMenu : public MenuScreen + { + public: + MainMenu(const String&name); + virtual ~MainMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class GroupMenu : public MenuScreen + { + public: + GroupMenu(const String&name); + virtual ~GroupMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class SoloMenu : public MenuScreen + { + public: + SoloMenu(const String&name); + virtual ~SoloMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class BrawlCharSelect : public CharSelectScreen + { + private: + class RulesBar : public Actor + { + public: + RulesBar(float x1, float y1); + virtual ~RulesBar(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + class ReadyToFightBar : public Actor + { + public: + ReadyToFightBar(float x1, float y1); + virtual ~ReadyToFightBar(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + class TeamsButton : public Actor + { + public: + TeamsButton(float x1, float y1); + virtual ~TeamsButton(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + RulesBar*rules_bar; + TextActor*rules_bar_text; + TextActor*rules_bar_value; + Arrows*rules_arrows; + + ReadyToFightBar*readyToFight; + TeamsButton*teams_button; + + boolean wasReadyToFight; + + public: + BrawlCharSelect(const String&name); + virtual ~BrawlCharSelect(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void onSelectCharacter(int player, int character); + }; + + class BrawlStageSelect : public StageSelectScreen + { + public: + BrawlStageSelect(const String&name); + virtual ~BrawlStageSelect(); + + virtual void LoadContent(); + virtual void Update(long gameTime); + + virtual void onSelect(int stageNo); + virtual void onLoad(); + }; + + class OptionsMenu : public MenuScreen + { + public: + OptionsMenu(const String&name); + virtual ~OptionsMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class ControlOptions : public Screen + { + private: + MenuBarSmall*joystickLabel; + MenuBarSmall*dpadLabel; + ToggleButtons*toggles; + + static const float farDist = 10000; + static const float centerDist = 625; + + Actor*button_a; + Actor*button_b; + Actor*button_x; + + Actor*arrow_up; + Actor*arrow_down; + Actor*arrow_left; + Actor*arrow_right; + + WireframeActor*joystickArea; + Actor*joystick; + + byte joystickDir; + bool joystickFar; + bool joystickDown; + + bool joystickEnabled; + + public: + ControlOptions(const String&name); + virtual ~ControlOptions(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class AudioOptions : public Screen + { + private: + MenuBarToggle*menumusic; + boolean prevMenumusic; + MenuBarToggle*menusoundfx; + boolean prevMenusoundfx; + MenuBarToggle*ingamemusic; + boolean prevIngamemusic; + + void onSettingToggle(String setting, boolean toggle); + public: + AudioOptions(const String&name); + virtual ~AudioOptions(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class DisplayOptions : public Screen + { + private: + MenuBarToggle*fullScreen; + boolean prevFullscreen; + + MenuBarValue*fps; + void onSettingToggle(String setting, boolean toggle); + + public: + DisplayOptions(const String&name); + virtual ~DisplayOptions(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class OtherOptions : public Screen + { + private: + class FacebookButton : public MenuBarSmallButton + { + public: + FacebookButton(float x1, float y1, const String&label); + virtual ~FacebookButton(); + + virtual void onRelease(); + }; + + class ContactDeveloperButton : public MenuBarSmallButton + { + public: + ContactDeveloperButton(float x1, float y1, const String&label); + virtual ~ContactDeveloperButton(); + + virtual void onRelease(); + }; + + FacebookButton*facebook; + ContactDeveloperButton*contactDev; + public: + OtherOptions(const String&name); + virtual ~OtherOptions(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class TrainingCharSelect : public CharSelectScreen + { + private: + class ReadyToFightBar : public Actor + { + public: + ReadyToFightBar(float x1, float y1); + virtual ~ReadyToFightBar(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + ReadyToFightBar*readyToFight; + Actor*trainingBanner; + + boolean wasReadyToFight; + + public: + TrainingCharSelect(String name); + virtual ~TrainingCharSelect(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class TrainingStageSelect : public StageSelectScreen + { + public: + TrainingStageSelect(const String&name); + virtual ~TrainingStageSelect(); + + virtual void LoadContent(); + }; + + class RulesMenu : public Screen + { + private: + MenuBarSmallButton*button_items; + MenuBarValue*stocks; + MenuBarValue*time; + ToggleButtons*gameMode; + + public: + RulesMenu(const String&name); + virtual ~RulesMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class ItemsMenu : public Screen + { + private: + ActorGrid*paneGrid; + ActorGrid*itemGrid; + + static boolean updatingGrid; + + class ItemPane : public TogglePane + { + private: + int id; + ItemsMenu*menu; + + public: + ItemPane(ItemsMenu*menu, int id, float x1, float y1, boolean toggle); + virtual ~ItemPane(); + + virtual void onToggle(boolean toggle); + }; + + void addActorsToGrid(); + + public: + ItemsMenu(const String&name); + virtual ~ItemsMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class BluetoothMenu : public Screen + { + private: + class PeerCard + { + private: + Actor*card; + TextActor*textDisplay; + String displayName; + String peerID; + String device; + + public: + float x, y; + + PeerCard(const String&name, const String&id); + ~PeerCard(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + boolean isClicked(); + boolean wasClicked(); + boolean mouseOver(); + + void setDisplayName(const String&name); + void setPeerID(const String&id); + void setDevice(const String&dev); + String getDisplayName(); + String getPeerID(); + String getDevice(); + }; + + PeerCard*selfCard; + PeerCard*peerCard; + + Actor*brawl; + + boolean wasConnected; + + public: + BluetoothMenu(const String&name); + virtual ~BluetoothMenu(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; + + class P2PWaitScreen : public Screen + { + private: + TextActor*message; + public: + P2PWaitScreen(const String&name); + virtual ~P2PWaitScreen(); + + virtual void LoadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/Menus.cpp b/SmashBros/Menus.cpp new file mode 100755 index 0000000..b807851 --- /dev/null +++ b/SmashBros/Menus.cpp @@ -0,0 +1,345 @@ +#include "Menus.h" +#include "Preferences.h" +#include "WinnerScreen.h" +#include "MenuClasses.h" +#include "Game.h" +#include "MusicManager.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + Actor*Menus::button_back = null; + TextActor*Menus::description = null; + int Menus::menuNo = 0; + SoundManager*Menus::soundMgr = new SoundManager(); + + void Menus::playSound(const String&name) + { + if(Preferences::menuSoundFXOn()) + { + soundMgr->playSound(name); + } + } + + void Menus::playSong(const String&name) + { + if(Preferences::menuMusicOn()) + { + MusicManager::loadSong(name); + MusicManager::play(); + } + } + + Menus::BackButton::BackButton(float x1, float y1) : Actor(x1,y1) + { + // + } + + Menus::BackButton::~BackButton() + { + // + } + + void Menus::BackButton::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void Menus::BackButton::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void Menus::BackButton::onRelease() + { + switch(Menus::menuNo) + { + case MENU_MAINMENU: + //main menu > title screen + ScreenManager::GoToScreen("TitleScreen"); + break; + + case MENU_GROUPMENU: + //group menu > main menu + ScreenManager::GoToScreen("MainMenu"); + break; + + case MENU_SOLOMENU: + //solo menu > main menu + ScreenManager::GoToScreen("MainMenu"); + break; + + case MENU_P2PMENU: + //p2p menu > group menu + { + if(P2PManager::isConnected()) + { + ArrayList options; + options.add("OK"); + options.add("Cancel"); + String message = "Exiting this menu will disconnect you from all connected peers. Are you sure you want to continue?"; + if(Application::showMessage("Warning", message, options)==0) + { + P2PManager::endSession(); + P2PDataManager::enabled = false; + ScreenManager::GoToScreen("MainMenu"); + } + } + else + { + P2PDataManager::enabled = false; + ScreenManager::GoToScreen("MainMenu"); + } + } + break; + + case MENU_BRAWLCHARSELECT: + //brawl character select > group menu + ScreenManager::GoToScreen("GroupMenu"); + break; + + case MENU_BRAWLSTAGESELECT: + //brawl stage select > brawl character select + ScreenManager::GoToScreen("BrawlCharSelect"); + break; + + case MENU_RULESMENU_BRAWLCHARSELECT: + //rules screen > brawl character select + ScreenManager::GoToScreen("BrawlCharSelect"); + break; + + case MENU_RULESMENU_GROUPMENU: + //rules screen > group menu + ScreenManager::GoToScreen("GroupMenu"); + break; + + case MENU_RULESMENU_P2PCHARSELECT: + //rules screen > p2p character select + ScreenManager::GoToScreen("BrawlCharSelect"); + break; + + case MENU_ITEMMENU_BRAWLCHARSELECT: + //item screen from brawl menu > rules screen from brawl menu + ScreenManager::GoToScreen("RulesMenu"); + break; + + case MENU_ITEMMENU_GROUPMENU: + //item screen from group menu > rules screen from group menu + ScreenManager::GoToScreen("RulesMenu"); + break; + + case MENU_ITEMMENU_P2PCHARSELECT: + //item screen from p2p character select > rules screen from p2p character select + ScreenManager::GoToScreen("RulesMenu"); + break; + + case MENU_P2PCHARSELECT: + //p2p character select > p2p menu + ScreenManager::GoToScreen("BluetoothMenu"); + break; + + case MENU_P2PSTAGESELECT: + //p2p stage select > p2p character select + ScreenManager::GoToScreen("BrawlCharSelect"); + break; + + case MENU_OPTIONSMENU: + //options menu > main menu + ScreenManager::GoToScreen("MainMenu"); + break; + + case MENU_AUDIOOPTIONS: + //sound_options > options menu + ScreenManager::GoToScreen("OptionsMenu"); + break; + + case MENU_CONTROLOPTIONS: + //control_options > options menu + ScreenManager::GoToScreen("OptionsMenu"); + break; + + case MENU_DISPLAYOPTIONS: + //display_options > options menu + ScreenManager::GoToScreen("OptionsMenu"); + break; + + case MENU_OTHEROPTIONS: + //other_options > options menu + ScreenManager::GoToScreen("OptionsMenu"); + break; + + case MENU_TRAININGCHARSELECT: + //Training character select > solo menu + ScreenManager::GoToScreen("SoloMenu"); + break; + + case MENU_TRAININGSTAGESELECT: + //training stage select > training character select + ScreenManager::GoToScreen("TrainingCharSelect"); + break; + } + Menus::playSound("back button"); + } + + //MP3*Menus::menutheme = null; + + void Menus::loadAssets() + { + Game::setLoadBar(0, 588, 900, 12, Color::RED); + + //Creating Music List + MusicManager::addSong("Main Theme", "Music/Smash Bros Brawl/Main Theme.ogg"); + MusicManager::addSong("Main Theme Remix", "Music/Smash Bros Brawl/Main Theme Remix.ogg"); + MusicManager::addSong("Menu Theme", "Music/Smash Bros Brawl/Menu Theme.ogg"); + MusicManager::addSong("Battlefield v2", "Music/Smash Bros Brawl/Battlefield v2.ogg"); + MusicManager::addSong("Final Destination", "Music/Smash Bros Brawl/Final Destination.ogg"); + + MusicManager::addSong("Zelda Theme", "Music/Legend of Zelda/Main Theme.ogg"); + MusicManager::addSong("Zelda Theme Remix", "Music/Legend of Zelda/Main Theme Remix.ogg"); + + MusicManager::loadSong("Main Theme"); + + //Loading sounds + soundMgr->loadSound("back button", "Sounds/Menus/ButtonBack.ogg"); + soundMgr->loadSound("titlescreen click", "Sounds/Menus/TitleScreen_click.ogg"); + soundMgr->loadSound("select menu item", "Sounds/Menus/menu_select.ogg"); + soundMgr->loadSound("ready to fight", "Sounds/Menus/ready_to_fight.ogg"); + + //Loading Images + BatchLoader::addImage("Images/Menus/titlescreen.png"); + BatchLoader::addImage("Images/Menus/Backgrounds/bg1.png"); + BatchLoader::addImage("Images/Menus/Backgrounds/bg2.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/back.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/back_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/rules_bar.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/rules_bar_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/toggle_on.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/toggle_off.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/options_bar.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/options_bar_small.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/options_bar_small_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/arrow.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/arrow_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/arrow_up.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/arrow_up_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/arrow_down.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/arrow_down_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/readytofight.png"); + BatchLoader::addImage("Images/Menus/Buttons/Generic/readytofight_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Solo/solo.png"); + BatchLoader::addImage("Images/Menus/Buttons/Solo/solo_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Solo/training.png"); + BatchLoader::addImage("Images/Menus/Buttons/Solo/training_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Solo/training_mode.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/group.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/group_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/brawl.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/brawl_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/rules.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/rules_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/options.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/options_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/controls.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/controls_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/sound.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/sound_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/display.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/display_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/other.png"); + BatchLoader::addImage("Images/Menus/Buttons/Options/other_selected.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/cards/na.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/cards/cpu.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/cards/p1_red.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/cards/p2_blue.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/cards/p3_yellow.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/cards/p4_green.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/icons/mario.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/icons/ichigo.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/icons/fox.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/icons/sonic.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/icons/pikachu.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/icons/bowser.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/coins/coin.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/coins/coin1.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/coins/coin2.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/coins/coin3.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/coins/coin4.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/flags/red.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/flags/blue.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/flags/green.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/freeforall.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/freeforall_selected.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/teambattle.png"); + BatchLoader::addImage("Images/Menus/Buttons/Group/teambattle_selected.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/previews/mario.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/previews/ichigo.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/previews/sonic.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/previews/fox.png"); + BatchLoader::addImage("Images/Menus/CharacterSelect/previews/pikachu.png"); + BatchLoader::addImage("Images/Menus/StageSelect/test.png"); + BatchLoader::addImage("Images/Menus/StageSelect/hillside_battleground.png"); + BatchLoader::addImage("Images/Menus/StageSelect/battlefield.png"); + BatchLoader::addImage("Images/Menus/StageSelect/final_destination.png"); + BatchLoader::addImage("Images/Menus/StageSelect/hyruletemple.png"); + BatchLoader::addImage("Images/Menus/StageSelect/greatbay.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/smashball.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/mushroom.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/poison_mushroom.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/raygun.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/heart_container.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/beamsword.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/toggle_on.png"); + BatchLoader::addImage("Images/Menus/Rules/Items/toggle_off.png"); + BatchLoader::addImage("Images/Game/WinnerScreen/bg.png"); + BatchLoader::addImage("Images/Game/WinnerScreen/continue.png"); + BatchLoader::addImage("Images/Game/WinnerScreen/continue_selected.png"); + //Loading Fonts + BatchLoader::addFont("Fonts/comic.ttf"); + BatchLoader::addFont("Fonts/arial.ttf"); + //Load Everything + BatchLoader::loadAll(); + } + + void Menus::loadMenus() + { + description = new TextActor(235,578,"", AssetManager::getFont("Fonts/arial.ttf", Font::BOLD,20),Color::BLACK); + description->setAlignment(TextActor::ALIGN_BOTTOMLEFT); + + //backclick = new WAV("Sounds/Menus/ButtonBack.wav"); + //backclick.open(); + + //menutheme = new MP3("Music/MainMenu.mp3"); + //menutheme.open(); + + button_back = new BackButton(63,35); + + Animation*anim = new Animation("normal",1); + anim->addFrame("Images/Menus/Buttons/Generic/back.png"); + button_back->addAnimation(anim); + anim = new Animation("hover",1); + anim->addFrame("Images/Menus/Buttons/Generic/back_selected.png"); + button_back->addAnimation(anim); + button_back->changeAnimation("normal", FORWARD); + button_back->Scale = 1.875f; + + ScreenManager::Add(new WinnerScreen("Winners")); + + ScreenManager::Add(new TitleScreen("TitleScreen")); + ScreenManager::Add(new MainMenu("MainMenu")); + ScreenManager::Add(new GroupMenu("GroupMenu")); + ScreenManager::Add(new SoloMenu("SoloMenu")); + ScreenManager::Add(new BrawlCharSelect("BrawlCharSelect")); + ScreenManager::Add(new BrawlStageSelect("BrawlStageSelect")); + ScreenManager::Add(new OptionsMenu("OptionsMenu")); + ScreenManager::Add(new ControlOptions("ControlOptions")); + ScreenManager::Add(new AudioOptions("AudioOptions")); + ScreenManager::Add(new DisplayOptions("DisplayOptions")); + ScreenManager::Add(new OtherOptions("OtherOptions")); + ScreenManager::Add(new TrainingCharSelect("TrainingCharSelect")); + ScreenManager::Add(new TrainingStageSelect("TrainingStageSelect")); + ScreenManager::Add(new RulesMenu("RulesMenu")); + ScreenManager::Add(new ItemsMenu("ItemsMenu")); + ScreenManager::Add(new BluetoothMenu("BluetoothMenu")); + ScreenManager::Add(new P2PWaitScreen("P2PWaitScreen")); + } +} \ No newline at end of file diff --git a/SmashBros/Menus.h b/SmashBros/Menus.h new file mode 100755 index 0000000..a06e5e5 --- /dev/null +++ b/SmashBros/Menus.h @@ -0,0 +1,78 @@ +#include "GameEngine/GameEngine.h" +#include "SoundManager.h" + +#pragma once + +//menuNo + //-1 TitleScreen + //0 MainMenu + //1 GroupMenu + //2 SoloMenu + //3 BrawlCharSelect + //4 BrawlStageSelect + //5 RulesMenu from BrawlCharSelect + //6 RulesMenu from GroupMenu + //7 ItemMenu from BrawCharSelect + //8 ItemMenu from GroupMenu + //9 OptionsMenu + //10 AudioOptions + //11 ControlOptions + //12 DisplayOptions + //13 OtherOptions + //14 TrainingCharSelect + //15 TrainingStageSelect + +namespace SmashBros +{ + static const byte MENU_TITLESCREEN = -1; + static const byte MENU_MAINMENU = 0; + static const byte MENU_GROUPMENU = 1; + static const byte MENU_SOLOMENU = 2; + static const byte MENU_P2PMENU = 3; + static const byte MENU_BRAWLCHARSELECT = 4; + static const byte MENU_BRAWLSTAGESELECT = 5; + static const byte MENU_RULESMENU_BRAWLCHARSELECT = 6; + static const byte MENU_RULESMENU_GROUPMENU = 7; + static const byte MENU_RULESMENU_P2PCHARSELECT = 8; + static const byte MENU_ITEMMENU_BRAWLCHARSELECT = 9; + static const byte MENU_ITEMMENU_GROUPMENU = 10; + static const byte MENU_ITEMMENU_P2PCHARSELECT = 11; + static const byte MENU_OPTIONSMENU = 12; + static const byte MENU_AUDIOOPTIONS = 13; + static const byte MENU_CONTROLOPTIONS = 14; + static const byte MENU_DISPLAYOPTIONS = 15; + static const byte MENU_OTHEROPTIONS = 16; + static const byte MENU_TRAININGCHARSELECT = 17; + static const byte MENU_TRAININGSTAGESELECT = 18; + static const byte MENU_P2PCHARSELECT = 19; + static const byte MENU_P2PSTAGESELECT = 20; + + class Menus + { + private: + //static WAV*backclick; + + class BackButton : public Actor + { + public: + BackButton(float x1, float y1); + virtual ~BackButton(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + public: + static Actor*button_back; + static TextActor*description; + static int menuNo; + + static SoundManager*soundMgr; + static void playSound(const String&name); + static void playSong(const String&name); + + static void loadAssets(); + static void loadMenus(); + }; +} \ No newline at end of file diff --git a/SmashBros/MusicManager.cpp b/SmashBros/MusicManager.cpp new file mode 100644 index 0000000..c1fe303 --- /dev/null +++ b/SmashBros/MusicManager.cpp @@ -0,0 +1,96 @@ + +#include "MusicManager.h" +#include "Preferences.h" +#include "Console.h" + +namespace SmashBros +{ + Music*MusicManager::music = NULL; + String MusicManager::currentSong = ""; + ArrayList MusicManager::songs = ArrayList(); + + void MusicManager::addSong(const String&name, const String&filePath) + { + for(int i=0; iisStopped()) + { + music->stop(); + } + + String path = getFilePath(name); + + if(path.equals("")) + { + return false; + } + + Console::WriteLine((String)"Loading song " + path); + + bool success = music->loadFromFile(path); + + if(success) + { + currentSong = name; + return true; + } + Console::WriteLine((String)"Error loading song " + name + " from path " + path); + return false; + } + return true; + } + + void MusicManager::play() + { + if(music!=NULL && music->isLoaded()) + { + Console::WriteLine((String)"Playing song " + currentSong); + music->loop(); + } + } + + void MusicManager::stop() + { + if(music!=NULL && music->isLoaded() && !music->isStopped()) + { + Console::WriteLine((String)"Stopping song " + currentSong); + music->stop(); + } + } +} \ No newline at end of file diff --git a/SmashBros/MusicManager.h b/SmashBros/MusicManager.h new file mode 100644 index 0000000..2b96894 --- /dev/null +++ b/SmashBros/MusicManager.h @@ -0,0 +1,29 @@ + +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class MusicManager + { + private: + typedef struct + { + String name; + String filePath; + } MusicDict; + + static Music*music; + static String currentSong; + static ArrayList songs; + + public: + static void addSong(const String&name, const String&filePath); + static String getFilePath(const String&name); + + static bool loadSong(const String&name); + static void play(); + static void stop(); + }; +} \ No newline at end of file diff --git a/SmashBros/OffScreenExplode.cpp b/SmashBros/OffScreenExplode.cpp new file mode 100755 index 0000000..261f9bc --- /dev/null +++ b/SmashBros/OffScreenExplode.cpp @@ -0,0 +1,52 @@ +#include "OffScreenExplode.h" +#include "Global.h" + +namespace SmashBros +{ + OffScreenExplode::OffScreenExplode(int playerNo) : GameElement(0,0) + { + this->playerNo = playerNo; + active = false; + addAnimation(new Animation("normal",1,"Images/Game/Misc/offscreen_explode.png")); + changeAnimation("normal", FORWARD); + Scale = 1.1f; + } + + OffScreenExplode::~OffScreenExplode() + { + // + } + + void OffScreenExplode::setActive() + { + active = true; + setAlpha(0); + changeAnimation("normal", FORWARD); + Console::WriteLine("setting OffScreenExplode Active"); + } + + void OffScreenExplode::Update(long gameTime) + { + if(active) + { + GameElement::Update(gameTime); + setAlpha(getAlpha()+0.02f); + if(getAlpha()>=1) + { + active = false; + if(Global::characters[playerNo]->getStock() > 0) + { + Global::characters[playerNo]->respawn(); + } + } + } + } + + void OffScreenExplode::Draw(Graphics2D&g, long gameTime) + { + if(active) + { + GameElement::Draw(g, gameTime); + } + } +} \ No newline at end of file diff --git a/SmashBros/OffScreenExplode.h b/SmashBros/OffScreenExplode.h new file mode 100755 index 0000000..37ff626 --- /dev/null +++ b/SmashBros/OffScreenExplode.h @@ -0,0 +1,22 @@ +#include "GameElement.h" + +#pragma once + +namespace SmashBros +{ + class OffScreenExplode : public GameElement + { + private: + boolean active; + int playerNo; + + public: + OffScreenExplode(int playerNo); + virtual ~OffScreenExplode(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + void setActive(); + }; +} \ No newline at end of file diff --git a/SmashBros/P2PDataManager.cpp b/SmashBros/P2PDataManager.cpp new file mode 100644 index 0000000..debf4c3 --- /dev/null +++ b/SmashBros/P2PDataManager.cpp @@ -0,0 +1,761 @@ + +#include "P2PDataManager.h" +#include "CPPBridge.h" +#include "Global.h" +#include "Camera.h" +#include "ItemManager.h" +#include "ProjectileManager.h" +#include "Controls.h" +#include "Player.h" +#include "Menus.h" + +namespace SmashBros +{ + P2PDataManager::P2PEvents::P2PEvents() + { + // + } + + P2PDataManager::P2PEvents::~P2PEvents() + { + // + } + + void P2PDataManager::P2PEvents::peerDidConnect(String peerID) + { + needInfo = true; + P2PDataManager::peerID = peerID; + } + + void P2PDataManager::P2PEvents::peerDidDisconnect(String peerID) + { + Application::showMessage((String)"Peer " + P2PManager::getPeerDisplayName(peerID) + " disconnected"); + server = false; + needInfo = true; + P2PDataManager::peerID = ""; + enabled = false; + P2PDataManager::peerDevice = ""; + dataQueue.clear(); + if(Menus::menuNo == MENU_P2PSTAGESELECT) + { + Global::UnloadGame(); + ScreenManager::GoToScreen("BrawlCharSelect"); + ScreenManager::GoToScreen("BluetoothMenu"); + ScreenManager::GoToScreen("MainMenu"); + } + else + { + ScreenManager::GoToScreen("BluetoothMenu"); + ScreenManager::GoToScreen("MainMenu"); + } + } + + void P2PDataManager::P2PEvents::peerDidRequestConnection(P2PRequest*request) + { + server = true; + } + + void P2PDataManager::P2PEvents::pickerDidCancel() + { + server = false; + needInfo = true; + P2PDataManager::peerID = peerID; + } + + void P2PDataManager::P2PEvents::didRecieveData(String peerID, void*data, unsigned int size) + { + DataVoid*recieved = new DataVoid(data,size); + while(lockDataList); + lockDataList = true; + P2PDataManager::dataQueue.add(recieved); + lockDataList = false; + } + + boolean P2PDataManager::needInfo = true; + boolean P2PDataManager::server = false; + boolean P2PDataManager::enabled = false; + String P2PDataManager::peerID = ""; + String P2PDataManager::peerDevice = ""; + boolean P2PDataManager::reliable = false; + boolean P2PDataManager::errorstate = false; + long P2PDataManager::lastRecieveTime = 0; + + boolean P2PDataManager::lockDataList = false; + ArrayList P2PDataManager::dataQueue = ArrayList(); + P2PDataManager::P2PEvents* P2PDataManager::listener = NULL; + + boolean P2PDataManager::connectToPeers() + { + if(listener == NULL) + { + listener = new P2PEvents(); + } + P2PManager::setEventListener(listener); + needInfo = true; + P2PManager::setSessionID("com.brokenphysics.issb"); + boolean result = P2PManager::searchForPeers(); + /*if(result) + { + char buffer[40]; + getDeviceModel(buffer); + int length = strlen(buffer) + 1; + P2PManager::sendData(buffer, length, P2PManager::SENDDATA_RELIABLE); + while(needInfo) + { + SDL_Delay(30); + updateAppEvents(); + } + }*/ + return result; + } + + boolean P2PDataManager::pollDataQueue(DataVoid*data) + { + while(lockDataList); + lockDataList = true; + if(dataQueue.size()>0) + { + DataVoid*poll = dataQueue.get(0); + dataQueue.remove(0); + data->setData(poll->getData(), poll->length()); + delete poll; + lockDataList = false; + return true; + } + else + { + lockDataList = false; + return false; + } + } + + String P2PDataManager::getPeerDevice() + { + return peerDevice; + } + + String P2PDataManager::getPeerID() + { + return peerID; + } + + boolean P2PDataManager::isServer() + { + return server; + } + + boolean P2PDataManager::isEnabled() + { + return enabled; + } + + void P2PDataManager::setReliable() + { + reliable = true; + } + + void P2PDataManager::setErrorState() + { + errorstate = true; + } + + void P2PDataManager::toggleSetting(const String&setting, int value1) + { + if(P2PManager::isConnected()) + { + if(setting.equals("item")) + { + DataVoid data; + byte type = DATA_RULES; + data.add(&type, sizeof(type)); + byte ruleType = RULES_ITEM; + data.add(&ruleType, sizeof(ruleType)); + int index = value1; + data.add(&index, sizeof(index)); + bool toggle = Global::itemsOn[index]; + data.add(&toggle, sizeof(toggle)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + else if(setting.equals("gameMode")) + { + DataVoid data; + byte type = DATA_RULES; + data.add(&type, sizeof(type)); + byte ruleType = RULES_MODE; + data.add(&ruleType, sizeof(ruleType)); + int mode = Global::gameMode; + data.add(&mode, sizeof(mode)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + else if(setting.equals("timeLimit")) + { + DataVoid data; + byte type = DATA_RULES; + data.add(&type, sizeof(type)); + byte ruleType = RULES_TIMELIMIT; + data.add(&ruleType, sizeof(type)); + int timelimit = Global::timeLimit; + data.add(&timelimit, sizeof(timelimit)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + else if(setting.equals("stockAmount")) + { + DataVoid data; + byte type = DATA_RULES; + data.add(&type, sizeof(type)); + byte ruleType = RULES_STOCK; + data.add(&ruleType, sizeof(type)); + int stock = Global::stockAmount; + data.add(&stock, sizeof(stock)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + } + } + + void P2PDataManager::sendInitial() + { + DataVoid data; + byte type = DATA_INITIAL; + data.add(&type, sizeof(type)); + + char buffer[40]; + getDeviceModel(buffer); + int length = strlen(buffer) + 1; + data.add(&length, sizeof(length)); + data.add(buffer, (unsigned int)length); + + for(int i=0; iswitchDirection(); + Global::characters[2]->switchDirection(); + + Global::selfLoaded = true; + + data.clear(); + byte type = DATA_LOADED; + data.add(&type, sizeof(type)); + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + + Global::P2PMessage += "Got selected stage from server... loaded...\n"; + } + break; + + case DATA_LOADED: + { + Global::peerLoaded = true; + + if(Global::selfLoaded && Global::peerLoaded) + { + handleLoaded(); + } + } + break; + + case DATA_READYGO: + { + dataBytes += sizeof(byte); + + byte readygoType = dataBytes[0]; + dataBytes += sizeof(byte); + + switch(readygoType) + { + case READYGO_GO: + { + Global::gamePlaying = true; + Global::hud->startGameTime = 0; + Global::hud->ReadyGo->changeAnimation("go", FORWARD); + } + break; + + case READYGO_GAME: + { + Global::finishBrawl(); + } + break; + } + } + break; + + case DATA_GAMEDATA: + { + dataBytes += sizeof(byte); + + //gameTime + long time = DataVoid::toLong(dataBytes); + dataBytes += sizeof(long); + //if(time>=lastRecieveTime) + { + Game::setGameTime(time); + lastRecieveTime = time; + + //worldTime + long worldtime = DataVoid::toLong(dataBytes); + dataBytes += sizeof(long); + Global::worldTime = worldtime; + + //timeAmount + long timeamount = DataVoid::toLong(dataBytes); + dataBytes += sizeof(long); + Global::timeAmount = timeamount; + + //characters + Global::characters[2]->handleSetP2PData(dataBytes); + Global::characters[1]->handleSetP2PData(dataBytes); + + //projectiles + ProjectileManager::handleSetP2PData(dataBytes); + if(errorstate) + { + return; + } + + //items + ItemManager::handleSetP2PData(dataBytes); + if(errorstate) + { + return; + } + + if(Global::gamePlaying) + { + Camera::Update(); + } + } + } + break; + + case DATA_JOYSTICK: + { + dataBytes += sizeof(byte); + Controls::handleP2PData(dataBytes); + } + break; + + case DATA_UPDATESCORE: + { + dataBytes += sizeof(byte); + + //playerNo + byte playerNo = dataBytes[0]; + if(playerNo==1) + { + playerNo = 2; + } + else if(playerNo==2) + { + playerNo = 1; + } + dataBytes += sizeof(byte); + + //stock + Global::characters[2]->stock = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + Global::characters[1]->stock = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + + //scores + Global::scores[2] = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + Global::scores[1] = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + + //deaths + Global::deaths[2] = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + Global::deaths[1] = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + + //KOs + Global::KOs[2] = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + Global::KOs[1] = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + + //Winners + int winner = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + if(winner==1) + { + winner=2; + } + else if(winner==2) + { + winner=1; + } + Global::winners[1] = winner; + winner = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + if(winner==1) + { + winner=2; + } + else if(winner==2) + { + winner=1; + } + Global::winners[2] = winner; + + //bools + bool wasHit = false; + Global::suddenDeath = false; + bool finishedGame = false; + byte boolsByte = dataBytes[0]; + Bitset bools(boolsByte); + if(bools.get(0)) + { + wasHit = true; + } + if(bools.get(1)) + { + Global::suddenDeath = true; + } + if(bools.get(2)) + { + finishedGame = true; + } + dataBytes += sizeof(byte); + + //finish game time + if(finishedGame) + { + Global::hud->showFinishGame = true; + } + + if(wasHit) + { + Global::hud->showScore(playerNo, -1); + if(playerNo==1) + { + Global::hud->showScore(2, 1); + } + else if(playerNo==2) + { + Global::hud->showScore(1, 1); + } + } + else if(playerNo!=0) + { + Global::hud->showScore(playerNo, -1); + } + + //sudden death players + if(Global::suddenDeath) + { + Global::suddenDeathPlayers.clear(); + int total = DataVoid::toInt(dataBytes); + dataBytes += sizeof(int); + Console::WriteLine((String)"recieved sudden death players: " + total); + for(int i=0; ihandleAddP2PData(data); + Global::characters[2]->handleAddP2PData(data); + + //projectiles + ProjectileManager::handleAddP2PData(data); + + //items + ItemManager::handleAddP2PData(data); + + //if(reliable) + { + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_RELIABLE); + } + /*else + { + P2PManager::sendData(data.getData(), data.length(), P2PManager::SENDDATA_UNRELIABLE); + }*/ + + reliable = false; + } + + void P2PDataManager::sendScore(Player*playr, bool finished) + { + DataVoid data; + + //type + byte type = P2PDataManager::DATA_UPDATESCORE; + data.add(&type, sizeof(type)); + + //playerNo + byte playerNo = 0; + if(playr!=NULL) + { + playerNo = playr->getPlayerNo(); + } + data.add(&playerNo, sizeof(playerNo)); + + //stock + data.add(&(Global::characters[1]->stock), sizeof(Global::characters[1]->stock)); + data.add(&(Global::characters[2]->stock), sizeof(Global::characters[2]->stock)); + + //scores + data.add(&Global::scores[1], sizeof(Global::scores[1])); + data.add(&Global::scores[2], sizeof(Global::scores[2])); + + //deaths + data.add(&Global::deaths[1], sizeof(Global::deaths[1])); + data.add(&Global::deaths[2], sizeof(Global::deaths[2])); + + //KOs + data.add(&Global::KOs[1], sizeof(Global::KOs[1])); + data.add(&Global::KOs[2], sizeof(Global::KOs[2])); + + //Winners + data.add(&Global::winners[1], sizeof(Global::winners[1])); + data.add(&Global::winners[2], sizeof(Global::winners[2])); + + //bools + bool wasHit = false; + if(playr!=NULL) + { + if(playr->lastHit>0) + { + wasHit = true; + } + } + + Bitset bools; + bools.set(0, wasHit); + bools.set(1, Global::suddenDeath); + bools.set(2, finished); + + byte boolsByte = bools.getByte(); + data.add(&boolsByte, sizeof(boolsByte)); + + //sudden death players + if(Global::suddenDeath) + { + int total = Global::suddenDeathPlayers.size(); + data.add(&total, sizeof(total)); + Console::WriteLine((String)"sudden death players: " + total); + for(int i=0; i dataQueue; + static P2PEvents*listener; + + static boolean enabled; + + static boolean reliable; + static boolean errorstate; + + static long lastRecieveTime; + + public: + static const byte DATA_INITIAL = 1; + static const byte DATA_CHARSELECT = 2; + static const byte DATA_RULES = 3; + static const byte DATA_STARTGAME = 4; + static const byte DATA_SELECTSTAGE = 5; + static const byte DATA_LOADED = 6; + static const byte DATA_READYGO = 7; + static const byte DATA_GAMEDATA = 8; + static const byte DATA_JOYSTICK = 9; + static const byte DATA_UPDATESCORE = 10; + + static const byte RULES_ITEM = 0; + static const byte RULES_TIMELIMIT = 1; + static const byte RULES_STOCK = 2; + static const byte RULES_MODE = 3; + + static const byte READYGO_GO = 0; + static const byte READYGO_GAME = 1; + + static boolean connectToPeers(); + static boolean pollDataQueue(DataVoid*data); + + static String getPeerDevice(); + static String getPeerID(); + + static boolean isServer(); + static boolean isEnabled(); + + static void setReliable(); + static void setErrorState(); + + static void toggleSetting(const String&setting, int value1); + + static void sendInitial(); + static void updateGame(long gameTime); + + static void sendScore(Player*playr, bool finished); + + static void serverHandleStart(); + static void handleLoaded(); + static void sendGameData(); + }; +} \ No newline at end of file diff --git a/SmashBros/Platform.cpp b/SmashBros/Platform.cpp new file mode 100755 index 0000000..be0c502 --- /dev/null +++ b/SmashBros/Platform.cpp @@ -0,0 +1,153 @@ +#include "Platform.h" +#include "Camera.h" +#include "Player.h" + +namespace SmashBros +{ + Platform::WireframeElement::WireframeElement(float x1, float y1, int width, int height) : WireframeActor(x1,y1,width,height) + { + // + } + + Platform::WireframeElement::~WireframeElement() + { + // + } + + void Platform::WireframeElement::Draw(Graphics2D&g, long gameTime) + { + drawActor(g, gameTime, (float)(x*Camera::Zoom), (float)(y*Camera::Zoom), Camera::Zoom); + } + + Platform::Platform(byte type, float x1, float y1) : GameElement(x1,y1) + { + box = null; + ground = null; + this->type = type; + this->collideType = COLLIDE_SOLID; + } + + Platform::Platform(byte type, float x1, float y1, int width, int height) : GameElement(x1,y1) + { + this->type = type; + this->collideType = COLLIDE_BOX; + box = new WireframeElement(x1,y1,width,height); + ground = new WireframeElement(x1,y1-5,width, 6); + + this->width = width; + this->height = height; + } + + Platform::~Platform() + { + if(box!=null) + { + delete box; + } + if(ground!=null) + { + delete ground; + } + } + + void Platform::Update(long gameTime) + { + GameElement::Update(gameTime); + if(collideType == COLLIDE_BOX) + { + box->x = x; + box->y = y; + } + } + + void Platform::Draw(Graphics2D&g, long gameTime) + { + switch(collideType) + { + case COLLIDE_SOLID: + GameElement::Draw(g, gameTime); + break; + + case COLLIDE_BOX: + box->x = x; + box->y = y; + box->Draw(g, gameTime); + width = box->width; + height = box->height; + break; + } + } + + boolean Platform::checkGroundCollision(SmashBros::Player*playr) + { + if(collideType == COLLIDE_BOX) + { + if(playr->hitboxRectsColliding(ground)) + { + return true; + } + return false; + } + return false; + } + + byte Platform::getType() + { + return type; + } + + byte Platform::getBoxDirection(GameElement*collide) + { + byte dir = PrimitiveActor::getDir(box, collide); + if(dir==PrimitiveActor::DIR_UPLEFT || dir==PrimitiveActor::DIR_UPRIGHT) + { + dir = PrimitiveActor::DIR_UP; + } + else if(dir==PrimitiveActor::DIR_DOWNLEFT) + { + dir = PrimitiveActor::DIR_LEFT; + } + else if(dir==PrimitiveActor::DIR_DOWNRIGHT) + { + dir = PrimitiveActor::DIR_RIGHT; + } + return dir; + } + + WireframeActor*Platform::getBox() + { + return (WireframeActor*)box; + } + + byte Platform::getCollideType() + { + return collideType; + } + + void Platform::setVisible(boolean toggle) + { + if(collideType == COLLIDE_BOX) + { + box->setVisible(toggle); + } + else + { + showWireframe(toggle); + } + } + + void Platform::onPlayerCollide(SmashBros::Player*collide, byte dir) + { + //Open for implementation + } + + void Platform::whilePlayerColliding(SmashBros::Player*collide, byte dir) + { + //Open for implementation + } + + void Platform::finishPlayerCollide(SmashBros::Player*collide, byte dir) + { + //Open for implementation + } +} \ No newline at end of file diff --git a/SmashBros/Platform.h b/SmashBros/Platform.h new file mode 100755 index 0000000..4303c28 --- /dev/null +++ b/SmashBros/Platform.h @@ -0,0 +1,53 @@ +#include "GameElement.h" +#include "SmashForwards.h" + +#pragma once + +namespace SmashBros +{ + class Platform : public GameElement + { + friend class Player; + private: + class WireframeElement : public WireframeActor + { + public: + WireframeElement(float x1, float y1, int width, int height); + ~WireframeElement(); + + virtual void Draw(Graphics2D&g, long gameTime); + }; + + WireframeElement*box; + WireframeElement*ground; + + protected: + byte type; + byte collideType; + + public: + static const byte TYPE_NORMAL = 1; + static const byte TYPE_GOTHROUGH = 2; + + static const byte COLLIDE_BOX = 1; + static const byte COLLIDE_SOLID = 2; + + Platform(byte type, float x1, float y1); + Platform(byte type, float x1, float y1, int width, int height); + virtual ~Platform(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + boolean checkGroundCollision(SmashBros::Player*playr); + byte getType(); + byte getCollideType(); + WireframeActor*getBox(); + byte getBoxDirection(GameElement*collide); + void setVisible(boolean toggle); + + virtual void onPlayerCollide(Player*collide, byte dir); + virtual void whilePlayerColliding(Player*collide, byte dir); + virtual void finishPlayerCollide(Player*collide, byte dir); + }; +} \ No newline at end of file diff --git a/SmashBros/Player.cpp b/SmashBros/Player.cpp new file mode 100755 index 0000000..7d37b0a --- /dev/null +++ b/SmashBros/Player.cpp @@ -0,0 +1,6169 @@ +#include "Player.h" +#include "Global.h" +#include "Stage.h" +#include "Item.h" +#include "Projectile.h" +#include "ProjectileManager.h" +#include "Camera.h" +#include "AttackTemplates.h" +#include "ItemManager.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + const float Player::jumpXBoost = 0.8f; + + Player::Player(float x1, float y1, byte playerNo, byte team) : GameElement(x1,y1) + { + aiType = AI_NORMAL; + firstUpdate = true; + folderPath = "/"; + playerColor = Color::WHITE; + stock = 3; + chargebar = null; + lastGroundPlat = null; + lastGroundX = 0; + groundCollidedFrame = false; + //collideQueue = ArrayList(); + itemCollidingIndex = -1; + itemHolding = null; + itemWearing = null; + itemHatting = null; + itemWielding = null; + hangColliding = false; + prevHangColliding = false; + groundColliding = false; + prevGroundColliding = false; + groundCheck = false; + hurtFrame = 0; + //hitboxPoint = RectangleF(); + moveLeft = 0; + moveRight = 0; + up = false; + upKey = false; + down = false; + runTime = 0; + smashTime = 0; + moveTime = 0; + buttondir = 0; + name = "unknown"; + charNo = 0; + alive = false; + weight = 0.1; + lastHit = 0; + percent = 0; + onGround = false; + landing = false; + jumping = false; + hurt = 0; + hurtTime = 0; + invincible = false; + deflectState = false; + dropping = false; + canDropThrough = false; + dropTime = 0; + canDo = false; + xVel = 0; + yVel = 0; + cpu = false; + comboTime = 0; + standardCombo = 0; + hitAmount = 0; + attackTime = 0; + grabbed = false; + hasgrabbed = false; + grabbing = false; + attacksHolder = -1; + attacksPriority = 0; + chargeSmash = 0; + chargingAttack = false; + smashPower = 0; + canFinalsmash = false; + bUp = false; + doubleJump = 0; + hanging = false; + + walkSpeed = 2; + runSpeed = 3; + fallWalk = 1; + fallRun = 2; + flyTime = 4; + flyRunTime = 4; + recoverAmount = 7/8; + recoverRunAmount = 6/7; + + this->playerNo = playerNo; + Console::WriteLine((String)"successfully created player " + playerNo); + + this->team=team; + Console::WriteLine(((String)"player" + playerNo) + ((String)" is on team " + team)); + + offScreenExplosion = new OffScreenExplode(playerNo); + + indicator = new Actor(0,0); + setIndicatorColor(); + switch(playerNo) + { + default: + indicator->addAnimation(new Animation("normal",1,"Images/Game/Indicators/p0_down.png")); + break; + + case 1: + indicator->addAnimation(new Animation("normal",1,"Images/Game/Indicators/p1_down.png")); + break; + + case 2: + indicator->addAnimation(new Animation("normal",1,"Images/Game/Indicators/p2_down.png")); + break; + + case 3: + indicator->addAnimation(new Animation("normal",1,"Images/Game/Indicators/p3_down.png")); + break; + + case 4: + indicator->addAnimation(new Animation("normal",1,"Images/Game/Indicators/p4_down.png")); + break; + } + indicator->changeAnimation("normal", FORWARD); + + indicX = 0; + indicY = 0; + setIndic = false; + + weight=0.2; + hangPoint = Vector2i(15,20); + itemOffsetX = 0; + itemOffsetY = 0; + + charNo = Global::selectedChar[playerNo-1]; + + alive = true; + + stock = Global::stockAmount; + + percent = 0; + + onGround = false; + groundCheck = false; + down = false; + + //canDo=1; + //runTime=-5; + + hitbox = new HitBox(playerNo, x,y,1,1); + setHitbox(-10, -10, 20, 20); + setHangPoint(8, 16); + + attacksHolder=-1; + grabbed = false; + hasgrabbed = false; + grabbing = false; + } + + Player::~Player() + { + if(indicator!=null) + { + delete indicator; + } + if(offScreenExplosion!=null) + { + delete offScreenExplosion; + } + if(chargebar!=null) + { + delete chargebar; + } + if(itemHolding!=null) + { + delete itemHolding; + } + if(itemWearing!=null) + { + delete itemWearing; + } + if(itemHatting!=null) + { + delete itemHatting; + } + if(itemWielding!=null) + { + delete itemWielding; + } + if(hitbox!=null) + { + delete hitbox; + } + } + + void Player::whenCreated() + { + Console::WriteLine((String)"loading player " + playerNo + "'s animations"); + + this->Load(); + + //randomizer = AttackRandomizer(playerNo); + randomizer.setPlayerNo(playerNo); + + LoadAttackTypes(); + + if(x <= Global::currentStage->x) + { + playerdir = 2; + changeAnimation("stand_right",FORWARD); + } + else + { + playerdir = 1; + changeAnimation("stand_left",FORWARD); + } + + cpu = Global::CPU[playerNo-1]; + + currentEnemy = null; + + if(Global::suddenDeath) + { + percent=300; + } + + for(int i=0; i<8; i++) + { + prevCollidePlatform[i]=false; + } + + //attackMgr = AttackManager(); + //playerCollisions = CollisionManager(); + //playerRectCollisions = CollisionManager(); + + if(cpu) + { + setInitialCPUTarget(); + //currentTarget=initCheckTarget(playerNo); + if(currentEnemy!=null) + { + Console::WriteLine((String)"player " + playerNo + (String)" created with currentTarget " + currentEnemy->playerNo); + } + else + { + Console::WriteLine((String)"player " + playerNo + (String)" created with no currentTarget"); + } + } + else + { + currentEnemy = null; + } + + onCreate(); + } + + void Player::onCreate() + { + //Open for implementation + } + + void Player::reset() + { + if(attacksPriority==7 || canFinalsmash) + { + Global::playerHasSmashBall = false; + Global::smashBallOnField = false; + canFinalsmash = false; + } + xvelocity = 0; + yvelocity = 0; + alive = true; + for(int i=0; i<8; i++) + { + prevCollidePlatform[i] = false; + currentCollidePlatform[i] = false; + currentCollidePlatformActor[i] = null; + } + playerCollisions.clear(); + playerRectCollisions.clear(); + if(itemHolding!=null) + { + itemHolding->destroy(); + itemHolding->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemHolding->itemNo)); + delete itemHolding; + itemHolding = null; + } + if(itemWearing!=null) + { + itemWearing->destroy(); + itemWearing->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemWearing->itemNo)); + delete itemWearing; + itemWearing = null; + } + if(itemHatting!=null) + { + itemHatting->destroy(); + itemHatting->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemHatting->itemNo)); + delete itemHatting; + itemHatting = null; + } + if(itemWielding!=null) + { + itemWielding->destroy(); + itemWielding->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemWielding->itemNo)); + delete itemWielding; + itemWielding = null; + } + currentHangPoint = null; + hangColliding = false; + prevHangColliding = false; + groundColliding = false; + prevGroundColliding = false; + hurtFrame = 0; + moveLeft = 0; + moveRight = 0; + up = false; + upKey = false; + down = false; + runTime = 0; + smashTime = 0; + moveTime = 0; + buttondir = 0; + playerdir = 2; + lastHit = 0; + percent = 00; + onGround = false; + landing = false; + jumping = false; + hurt = 0; + hurtTime = 0; + dropping = false; + canDropThrough = false; + dropTime = 0; + canDo = true; + xVel = 0; + yVel = 0; + currentEnemy = null; + grabbed = false; + hasgrabbed = false; + grabbing = false; + attacksHolder = -1; + attacksPriority = 0; + chargeSmash = 0; + smashPower = 0; + bUp = false; + doubleJump = 0; + hitAmount=0; + deflectState = false; + //canFinalsmash = false; + hanging = false; + //invincible = false; + setToDefaultValues(); + onDestroy(); + } + + void Player::respawn() + { + reset(); + Vector2i pnt = Global::currentStage->getSpawnPoint(playerNo); + x = (float)pnt.x; + y = (float)pnt.y; + animFinish(); + setInitialCPUTarget(); + Console::WriteLine((String)"respawning player " + playerNo); + } + + /** Loads all of the animations for the character. Should be overridden. + * Animations can be added using {@link #addSingleAnimation(String, String, int, int, int)} + * and {@link #addTwoSidedAnimation(String, String, int, int, int)} */ + void Player::Load() + { + // + } + + void Player::Unload() + { + for(int i=0; igetCurrentFrame(); + int animIndex = getAnimIndex(); + Bitset bools; + //hurt color + if(hurtFrame>0) + { + bools.set(0, true); + } + else + { + bools.set(0, false); + } + //charge color + if(chargeSmash>0) + { + bools.set(1, true); + } + else + { + bools.set(1, false); + } + //visible + if(isVisible()) + { + bools.set(2, true); + } + else + { + bools.set(2, false); + } + //alive + if(alive) + { + bools.set(3, true); + } + else + { + bools.set(3, false); + } + byte boolsByte = bools.getByte(); + + data.add(&x, sizeof(x)); + data.add(&y, sizeof(y)); + data.add(&animIndex, sizeof(animIndex)); + data.add(&frame, sizeof(frame)); + data.add(&percent, sizeof(percent)); + data.add(&Scale, sizeof(Scale)); + data.add(&boolsByte, sizeof(boolsByte)); + + addP2PData(data); + } + + void Player::handleSetP2PData(byte*&data) + { + //x + x = DataVoid::toFloat(data); + data += sizeof(float); + + //y + y = DataVoid::toFloat(data); + data += sizeof(float); + + //animIndex + int animIndex = DataVoid::toInt(data); + changeAnimation(animIndex, STOPPED); + data += sizeof(int); + + //frame + int frame = DataVoid::toInt(data); + getAnimation()->setCurrentFrame(frame); + data += sizeof(int); + + //percent + percent = DataVoid::toInt(data); + data += sizeof(int); + + Scale = DataVoid::toFloat(data); + data += sizeof(float); + + //bools + byte boolsByte = data[0]; + Bitset bools(boolsByte); + //hurtColor and charge color + if(bools.get(0)) + { + Actor::setColor(Color::RED); + } + else if(bools.get(1)) + { + Actor::setColor(Color::YELLOW); + } + else + { + Actor::setColor(playerColor); + } + //visibility + if(bools.get(2)) + { + setVisible(true); + } + else + { + setVisible(false); + } + //alive + if(bools.get(3)) + { + alive = true; + } + else + { + alive = false; + } + data += sizeof(byte); + + setP2PData(data); + } + + void Player::addP2PData(DataVoid&data) + { + //Open for implementation + } + + void Player::setP2PData(byte*&data) + { + //Open for implementation + } + + void Player::addAIAttackType(byte attack, byte attacktype, float probability, boolean charge) + { + randomizer.setAttack(attack, attacktype, probability, charge); + } + + void Player::addAnimation(Animation*a) + { + ArrayList animFiles = a->getAllFilenames(); + for(int i=0; iitemOffsetX = x1; + this->itemOffsetY = y1; + } + + byte Player::getPlayerDir() + { + return playerdir; + } + + byte Player::getDirFacing() + { + if(upKey || up) + { + if(moveLeft>0) + { + return DIR_UPLEFT; + } + else if(moveRight>0) + { + return DIR_UPRIGHT; + } + else + { + return DIR_UP; + } + } + else if(down) + { + if(moveLeft>0) + { + return DIR_DOWNLEFT; + } + else if(moveRight>0) + { + return DIR_DOWNRIGHT; + } + else + { + return DIR_DOWN; + } + } + else if(moveLeft>0) + { + return DIR_LEFT; + } + else if(moveRight>0) + { + return DIR_RIGHT; + } + return 0; + } + + byte Player::getTeam() + { + return team; + } + + boolean Player::canFinalSmash() + { + return canFinalsmash; + } + + void Player::setPlayerDir(byte dir) + { + if(dir==1 || dir==2) + { + playerdir = dir; + } + else + { + Console::WriteLine((String)"Error Player.setPlayerDir(byte): invalid argument " + dir); + } + } + + byte Player::getPlayerNo() + { + return playerNo; + } + + void Player::setCantDo() + { + canDo = false; + } + + boolean Player::CanDo() + { + checkAttacks(); + return canDo; + } + + boolean Player::checkIfAble() + { + return true; + } + + boolean Player::isGrabbed() + { + return grabbed; + } + + int Player::getStock() + { + return stock; + } + + boolean Player::hasGrabbed() + { + return hasgrabbed; + } + + boolean Player::isGrabbing() + { + return grabbing; + } + + boolean Player::isJumping() + { + return jumping; + } + + boolean Player::isHanging() + { + return hanging; + } + + void Player::setHanging(boolean toggle) + { + hanging = toggle; + } + + void Player::setJumping(boolean toggle) + { + jumping = toggle; + } + + void Player::finishDeflect() + { + deflectState = false; + } + + void Player::resetAttackCollisions() + { + playerCollisions.clear(); + } + + int Player::getSmashPower() + { + if(chargebar!=null) + { + smashPower = (int)chargebar->currentPower; + } + else + { + smashPower = 0; + } + return smashPower; + } + + byte Player::getMoveLeft() + { + return moveLeft; + } + + byte Player::getMoveRight() + { + return moveRight; + } + + /** Sets the hitbox coordinates relative to the center of the character. Default value is -10, -10, 20, 20 */ + void Player::setHitbox(float x1, float y1, int w, int h) + { + hitboxPoint.x = x1; + hitboxPoint.y = y1; + hitboxPoint.width = (float)w; + hitboxPoint.height = (float)h; + hitbox->x = x + x1; + hitbox->y = y + y1; + hitbox->width = w; + hitbox->height = h; + } + + WireframeActor*Player::getHitbox() + { + updateHitbox(); + return hitbox; + } + + void Player::showHitboxWireframe(boolean toggle) + { + hitbox->setVisible(toggle); + } + + void Player::setHitboxColor(Color c) + { + hitbox->setColor(c); + } + + void Player::updateHitbox() + { + hitbox->x = x + (float)((float)hitboxPoint.x*this->Scale); + hitbox->y = y + (float)((float)hitboxPoint.y*this->Scale); + hitbox->width = (int)((float)hitboxPoint.width*this->Scale); + hitbox->height = (int)((float)hitboxPoint.height*this->Scale); + } + + void Player::setIndicatorOffset(float x1, float y1) + { + setIndic = true; + indicX = x1; + indicY = y1; + } + + void Player::setIndicatorColor() + { + switch(team) + { + default: + switch(playerNo) + { + default: + indicator->setColor(Color(64,64,64)); + break; + + case 1: + indicator->setColor(Color::RED); + break; + + case 2: + indicator->setColor(Color::BLUE); + break; + + case 3: + indicator->setColor(Color::GREEN); + break; + + case 4: + indicator->setColor(Color::YELLOW); + break; + } + break; + + case TEAM_RED: + indicator->setColor(Color::RED); + break; + + case TEAM_BLUE: + indicator->setColor(Color::BLUE); + break; + + case TEAM_GREEN: + indicator->setColor(Color::GREEN); + break; + + case TEAM_YELLOW: + indicator->setColor(Color::YELLOW); + break; + } + } + + /** Sets the folder path where all of the animations are stored. Default value is "/" */ + void Player::setFolderPath(String path) + { + this->folderPath = path; + } + + String Player::getFolderPath() + { + return this->folderPath; + } + + /** + * Adds to the character an Animation that changes depending on the direction the character is facing. + * Animations added this way can be accessed with the string of the animation name and either "_left" or "_right" depending on the direction + * the character is facing. + *

+ * @param name the name of the animation. (ex: "stand"). + * After name is input here, it becomes 2 animations for each direction. (ex: "stand_left" or "stand_right") + * @param file the file name of the animation. Only the file name needs to be given since the path is set via {@link #setFolderPath(String)} + * @param fps the frame rate of the animation in frames per second. + * @param rows the number of rows that the image file contains. + * @param cols the number of columns that the image file contains. + */ + void Player::addTwoSidedAnimation(String name, String file, int fps, int rows, int cols) + { + Animation*anim; + anim = new Animation(name + "_left",fps, rows,cols); + anim->addFrame(folderPath + file); + this->addAnimation(anim); + + anim = new Animation(name + "_right",fps, rows,cols); + anim->addFrame(folderPath + file); + anim->mirror(true); + this->addAnimation(anim); + } + + /** + * Adds to the character an Animation that stays the same regardless of the direction it is facing. + *

+ * @param name the name of the animation. (ex: "special_attack_down"). + * @param file the file name of the animation. Only the file name needs to be given since the path is set via {@link #setFolderPath(String)} + * @param fps the frame rate of the animation in frames per second. + * @param rows the number of rows that the image file contains. + * @param cols the number of columns that the image file contains. + */ + void Player::addSingleAnimation(String name, String file, int fps, int rows, int cols) + { + Animation*anim; + anim = new Animation(name,fps, rows,cols); + anim->addFrame(folderPath + file); + this->addAnimation(anim); + } + + /** Sets the point where the character hangs, relative to the top left corner of the character. Default value is 8, 16 */ + void Player::setHangPoint(int x1,int y1) + { + hangPoint.x = x1; + hangPoint.y = y1; + } + + void Player::onAnimationFinish(const String&n) + { + if(n.equals("walk_left") || n.equals("walk_right") || n.equals("run_left") || n.equals("run_right") || + n.equals("smash_charge_left") || n.equals("smash_charge_right") || n.equals("hang_left") || + n.equals("hang_right")) + { + // + } + else if(n.equals("hurt_spin_up")) + { + if(yvelocity>0) + { + switch(playerdir) + { + case 1: + changeAnimation("fall_left", NO_CHANGE); + break; + + case 2: + changeAnimation("fall_right", NO_CHANGE); + break; + } + } + } + else if(n.equals("hurt_flip_left") || n.equals("hurt_flip_right")) + { + if(onGround && yvelocity==0 && xvelocity==0) + { + animFinish(); + } + } + else if(n.equals("hurt_minor_left") || n.equals("hurt_minor_right") || n.equals("hurt_fly_left") || n.equals("hurt_fly_right") + || n.equals("hurt_spin_left") || n.equals("hurt_spin_right")) + { + if(onGround) + { + animFinish(); + } + } + else + { + animFinish(); + } + } + + void Player::checkAttacks() + { + boolean itemDo = true; + if(itemHolding!=null) + { + itemDo = itemHolding->holderCanDo(); + } + if((attacksHolder==-1) && (!grabbed) && (hurt!=2) && (!landing) && checkIfAble() && itemDo) + { + canDo=true; + } + else + { + canDo=false; + } + } + + void Player::destroyCharge() + { + chargingAttack = false; + chargeSmash = 0; + if(chargebar!=null) + { + this->smashPower = (int)chargebar->currentPower; + } + chargebar = null; + } + + void Player::animFinish() + { + switch(playerdir) + { + case 1: + if(onGround) + { + if(down) + { + changeAnimation("crouch_left", NO_CHANGE); + } + else + { + changeAnimation("stand_left", NO_CHANGE); + } + } + else + { + changeAnimation("fall_left", NO_CHANGE); + } + break; + + case 2: + if(onGround) + { + if(down) + { + changeAnimation("crouch_right", NO_CHANGE); + } + else + { + changeAnimation("stand_right", NO_CHANGE); + } + } + else + { + changeAnimation("fall_right", NO_CHANGE); + } + break; + } + playerCollisions.clear(); + landing = false; + up = false; + jumping = false; + canDo=true; + chargingAttack = false; + attacksHolder=-1; + attacksPriority=0; + chargeSmash=0; + smashPower=0; + hitAmount=0; + xVel=0; + yVel=0; + deflectState = false; + setToDefaultValues(); + } + + /** + * Used for reseting variables when Animations finish or character must be reset. Should be overridden if custom variables are used. + */ + void Player::setToDefaultValues() + { + // + } + + void Player::onDestroy() + { + // + } + + void Player::setInitialCPUTarget() + { + double closestDist = 0; + Player*closestTarget = null; + + for(int i=0; i<=Global::possPlayers; i++) //TODO: loop characters + { + Player*compareTarget = Global::characters[i]; + if(closestTarget==null) + { + if(compareTarget!=null && compareTarget->playerNo!=playerNo && compareTarget->isAlive() && !(Global::teamBattle && compareTarget->team == team) + && Global::currentStage->checkSafeArea(compareTarget)) + { + closestTarget = compareTarget; + closestDist = distanceUnSqr(x,y,compareTarget->x,compareTarget->y); + } + } + else if(compareTarget!=null && compareTarget->playerNo!=playerNo && compareTarget->isAlive() && !(Global::teamBattle && compareTarget->team == team) + && Global::currentStage->checkSafeArea(compareTarget)) + { + double dist = distanceUnSqr(x,y,compareTarget->x,compareTarget->y); + if(distteam == team) + { + closestTarget = null; + } + + currentEnemy = closestTarget; + } + + void Player::updateCPUTarget() + { + double currentDist = 0; + boolean targetNull = true; + if(currentEnemy!=null) + { + if(!(currentEnemy->playerNo!=playerNo && currentEnemy->isAlive() && !(Global::teamBattle && currentEnemy->team == team) && Global::currentStage->checkSafeArea(currentEnemy))) + { + currentEnemy=null; + } + } + if(currentEnemy!=null) + { + targetNull = false; + currentDist = distanceUnSqr(x,y,currentEnemy->x, currentEnemy->y); + } + else + { + setInitialCPUTarget(); + if(currentEnemy!=null) + { + targetNull = false; + currentDist = distanceUnSqr(x,y,currentEnemy->x, currentEnemy->y); + } + } + + ArrayList possibleTargets = ArrayList(); + + for(int i=0; i<=Global::possPlayers; i++) //TODO: loop characters + { + Player*playr = Global::characters[i]; + if(playr!=null && playr->playerNo!=playerNo && playr->isAlive() && !(Global::teamBattle && playr->team == team) && Global::currentStage->checkSafeArea(playr)) + { + possibleTargets.add(playr); + } + } + + if(possibleTargets.size()==0) + { + currentEnemy = null; + return; + } + + ArrayList priorityTargets = ArrayList(); + + for(int i=0; irectsColliding(playr->hitbox); + double dist = distanceUnSqr(x,y,playr->x,playr->y); + if((dist<10000 || hitOverlap) && ((!targetNull && distx < x) + { + if(playerdir==RIGHT) + { + priorityTargets.add(playr); + } + } + else if(playr->x > x) + { + if(playerdir==LEFT) + { + priorityTargets.add(playr); + } + } + } + } + + if(priorityTargets.size() > 0) + { + Player*newTarget = priorityTargets.get(0); + double dist = distanceUnSqr(x, y, newTarget->x, newTarget->y); + + for(int i=1; ix, cmpr->y); + + if(cmprDist108900) //330 + { + for(int i=0; ix, cmpr->y); + if(cmprDistx, currentEnemy->y); + + for(int i=1; ix, cmpr->y); + if(cmprDist0) + { + return true; + } + return false; + } + + void Player::recoverJump() + { + if(CanDo()) + { + if(doubleJump>0 || onGround) + { + jump(); + } + else if(!bUp) + { + randomizer.doAttack(ATTACKTYPE_UPMOVE); + } + } + } + + boolean Player::checkTrappedUnder(Platform*plat) + { + updateHitbox(); + if(plat->getType() == Platform::TYPE_NORMAL) + { + float platX = plat->x; + float platY = plat->y; + if(plat->getCollideType() == Platform::COLLIDE_SOLID) + { + platX = plat->x - plat->width/2; + platY = plat->y - plat->height/2; + } + if(y > (platY + plat->height/2)) + { + if((hitbox->x + hitbox->width)>=(platX-2) && hitbox->x<=(platX + plat->width+2)) + { + return true; + } + } + } + return false; + } + + boolean Player::checkTrappedUnder(Rectangle plat) + { + updateHitbox(); + if(y > (plat.y + plat.height/2)) + { + if((hitbox->x + hitbox->width)>=(plat.x-2) && hitbox->x<=(plat.x + plat.width+2)) + { + return true; + } + } + return false; + } + + boolean Player::checkTrappedOver(Rectangle plat) + { + updateHitbox(); + if(y < (plat.y + plat.height/2)) + { + if((hitbox->x + hitbox->width)>=(plat.x-2) && hitbox->x<=(plat.x + plat.width+2)) + { + return true; + } + } + return false; + } + + boolean Player::isObstacle(Platform*plat) + { + if(plat==null) + { + return false; + } + if(plat->getType()==Platform::TYPE_GOTHROUGH) + { + return false; + } + return true; + } + + float Player::getMinAmountTrappedUnder(Platform*plat) + { + updateHitbox(); + if(plat->getType() == Platform::TYPE_NORMAL) + { + float platX = plat->x; + float platY = plat->y; + if(plat->getCollideType() == Platform::COLLIDE_SOLID) + { + platX = plat->x - plat->width/2; + platY = plat->y - plat->height/2; + } + if(y < (platY + plat->height/2)) + { + if(hitbox->x>platX && (hitbox->x + hitbox->width)<(platX + plat->width)) + { + float d1 = (hitbox->x + hitbox->width) - platX; + float d2 = (platX + plat->width) - hitbox->x; + if(d1hangs.size(); i++) //check for best hangpoints (closest) + { + HangPoint*hang = Global::currentStage->hangs.get(i); + float hangX = hang->x; + if(hang->getHangSide()==HangPoint::RIGHT) + { + hangX = hang->x + hang->width; + } + if(hangX<=x) + { + switch(hang->getHangSide()) + { + case HangPoint::LEFT: + if(lHangLeft==null) + { + lHangLeft = hang; + lHldist = distanceUnSqr(x, y, hangX, hang->y); + } + else + { + double newDist = distanceUnSqr(x, y, hangX, hang->y); + if(newDisty); + } + else + { + double newDist = distanceUnSqr(x, y, hangX, hang->y); + if(newDistthis->x + { + switch(hang->getHangSide()) + { + case HangPoint::LEFT: + if(rHangLeft==null) + { + rHangLeft = hang; + rHldist = distanceUnSqr(x, y, hangX, hang->y); + } + else + { + double newDist = distanceUnSqr(x, y, hangX, hang->y); + if(newDisty); + } + else + { + double newDist = distanceUnSqr(x, y, hangX, hang->y); + if(newDistplatforms.size(); i++) //check for best platforms (closest) + { + Platform*plat = Global::currentStage->platforms.get(i); + float platX; + float platY; + if(plat->getCollideType()==Platform::COLLIDE_BOX) + { + platX = plat->x + (plat->width/2); + platY = plat->y; + } + else + { + platX = plat->x; + platY = plat->y - (plat->height/2); + } + if(platX<=this->x) + { + switch(plat->getType()) + { + case Platform::TYPE_NORMAL: + if(lPlat==null) + { + lPlat = plat; + lPlatdist = distanceUnSqr(x, y, platX, platY); + } + else + { + double newDist = distanceUnSqr(x, y, platX, platY); + if(newDistx + { + switch(plat->getType()) + { + case Platform::TYPE_NORMAL: + if(rPlat==null) + { + rPlat = plat; + rPlatdist = distanceUnSqr(x, y, platX, platY); + } + else + { + double newDist = distanceUnSqr(x, y, platX, platY); + if(newDist10000 && y>lHangLeft->y)) //100 + { + if(lHldist0 || checkbUpRecovery() || (y<=lHangRight->y && lHrdist<2500)))//50 + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + else + { + bestHang = lHangLeft; + bestHangDist = lHldist; + } + } + else + { + if(rHangLeft!=null && rHldist0 || checkbUpRecovery() || (y<=rHangLeft->y && rHldist<2500)))//50 + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + else + { + bestHang = rHangRight; + bestHangDist = rHrdist; + } + } + } + else + { + if(rHangLeft!=null && rHldist0 || checkbUpRecovery() || (y<=rHangLeft->y && rHldist<2500)))//50 + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + else + { + bestHang = lHangLeft; + bestHangDist = lHldist; + } + } + } + else + { + if(rHangRight!=null) + { + if(rHangLeft!=null && rHldist0 || checkbUpRecovery() || (y<=rHangLeft->y && rHldist<2500)))//50 + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + else + { + if(lHangRight!=null && lHrdist0 || checkbUpRecovery() || (y<=lHangRight->y && lHrdist<2500)))//50 + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + else + { + bestHang = rHangRight; + bestHangDist = rHrdist; + } + } + } + else + { + if(lHangRight!=null) + { + if(rHangLeft!=null && rHldist0 || checkbUpRecovery() || (y<=rHangLeft->y && rHldist<2500)))//50 + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + else + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + } + else + { + if(rHangLeft!=null) + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + } + } + } + } + else if(playerdir==RIGHT) + { + if(rHangRight!=null) + { + if(lHangLeft!=null && (lHldist>10000 && y>lHangLeft->y)) + { + if(rHrdist0 || checkbUpRecovery() || (y<=rHangLeft->y && rHldist<2500)))//50 + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + else + { + bestHang = rHangRight; + bestHangDist = rHrdist; + } + } + else + { + if(lHangRight!=null && lHrdist0 || checkbUpRecovery() || (y<=lHangRight->y && lHrdist<2500)))//50 + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + else + { + bestHang = lHangLeft; + bestHangDist = lHldist; + } + } + } + else + { + if(lHangRight!=null && lHrdist0 || checkbUpRecovery() || (y<=lHangRight->y && lHrdist<2500)))//50 + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + else + { + bestHang = rHangRight; + bestHangDist = rHrdist; + } + } + } + else + { + if(lHangLeft!=null) + { + if(lHangRight!=null && lHrdist0 || checkbUpRecovery() || (y<=lHangRight->y && lHrdist<2500)))//50 + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + else + { + if(rHangLeft!=null && rHldist0 || checkbUpRecovery() || (y<=rHangLeft->y && rHldist<2500)))//50 + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + else + { + bestHang = lHangLeft; + bestHangDist = lHldist; + } + } + } + else + { + if(rHangLeft!=null) + { + if(lHangRight!=null && lHrdist0 || checkbUpRecovery() || (y<=lHangRight->y && lHrdist<2500)))//50 + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + else + { + bestHang = rHangLeft; + bestHangDist = rHldist; + } + } + else + { + if(lHangRight!=null) + { + bestHang = lHangRight; + bestHangDist = lHrdist; + } + } + } + } + } + + //checking best platform + if(playerdir==LEFT) + { + ArrayList plats = ArrayList(); + ArrayList platDists = ArrayList(); + if(lPlat!=null) + { + plats.add(lPlat); + platDists.add(lPlatdist); + } + if(rPlat!=null) + { + plats.add(rPlat); + platDists.add(rPlatdist); + } + if(lGTPlat!=null) + { + plats.add(lGTPlat); + platDists.add(lgtPlatdist); + } + if(rGTPlat!=null) + { + plats.add(rGTPlat); + platDists.add(rgtPlatdist); + } + + for(int i=0; ix; + if(plat->getCollideType()==Platform::COLLIDE_BOX) + { + platX = plat->x + plat->width/2; + } + float plat2X = bestPlat->x; + if(plat->getCollideType()==Platform::COLLIDE_BOX) + { + plat2X = bestPlat->x + bestPlat->width/2; + } + if(platX <= x) + { + if(plat2X > x) + { + if(bestPlatDist >= 10000 && (doubleJump==0 || !checkbUpRecovery()) && platDist x) + { + if(plat2X <= x) + { + if(!checkTrappedUnder(plat)) + { + if(checkTrappedUnder(bestPlat)) + { + bestPlat = plat; + bestPlatDist = platDist; + } + else + { + if(platDist x) + { + if(checkTrappedUnder(plat)) + { + if(checkTrappedUnder(bestPlat)) + { + if(getMinAmountTrappedUnder(plat) plats = ArrayList(); + ArrayList platDists = ArrayList(); + if(lPlat!=null) + { + plats.add(lPlat); + platDists.add(lPlatdist); + } + if(rPlat!=null) + { + plats.add(rPlat); + platDists.add(rPlatdist); + } + if(lGTPlat!=null) + { + plats.add(lGTPlat); + platDists.add(lgtPlatdist); + } + if(rGTPlat!=null) + { + plats.add(rGTPlat); + platDists.add(rgtPlatdist); + } + + for(int i=0; ix; + if(plat->getCollideType()==Platform::COLLIDE_BOX) + { + platX = plat->x + plat->width/2; + } + float plat2X = bestPlat->x; + if(plat->getCollideType()==Platform::COLLIDE_BOX) + { + plat2X = bestPlat->x + bestPlat->width/2; + } + if(platX >= x) + { + if(plat2X < x) + { + if(bestPlatDist >= 10000 && (doubleJump==0 || !checkbUpRecovery()) && platDist= x) + { + if(!checkTrappedUnder(plat)) + { + if(checkTrappedUnder(bestPlat)) + { + bestPlat = plat; + bestPlatDist = platDist; + } + else + { + if(platDistx + bestHang->width/2; + float hangY = bestHang->y; + return Vector2f(hangX,hangY); + } + } + else if(bestHang==null) + { + float platX; + float platY; + if(bestPlat->getCollideType()==Platform::COLLIDE_BOX) + { + platX = bestPlat->x + bestPlat->width/2; + platY = bestPlat->y; + } + else + { + platX = bestPlat->x; + platY = bestPlat->y-bestPlat->height/2; + } + return Vector2f(platX,platY); + } + else if(checkTrappedUnder(bestPlat) || bestHangDistx + bestHang->width/2; + float hangY = bestHang->y; + return Vector2f(hangX,hangY); + } + else + { + float platX; + float platY; + if(bestPlat->getCollideType()==Platform::COLLIDE_BOX) + { + platX = bestPlat->x + bestPlat->width/2; + platY = bestPlat->y; + } + else + { + platX = bestPlat->x; + platY = bestPlat->y-bestPlat->height/2; + } + return Vector2f(platX,platY); + } + } + + void Player::getToRecoveryTarget(Vector2f target) + { + byte dir = getDir2(x,y,target.x,target.y); + + double dist = distanceUnSqr(x,y,target.x,target.y); + + ArrayList obstacles = ArrayList(); + + //find obstacles and adjust target to avoid + for(int i=0; iplatforms.size(); i++) + { + Platform*plat = Global::currentStage->platforms.get(i); + if(plat->getType() == Platform::TYPE_NORMAL) + { + RectangleF obstRect = RectangleF(); + if(plat->getCollideType() == Platform::COLLIDE_SOLID) + { + obstRect.x = plat->x - plat->width/2; + obstRect.y = plat->y - plat->height/2; + obstRect.width = (float)plat->width; + obstRect.height = (float)plat->height; + } + else + { + obstRect.x = plat->x; + obstRect.y = plat->y; + obstRect.width = (float)plat->width; + obstRect.height = (float)plat->height; + } + + + + if(checkObstacleDir(obstRect, dir)) + { + if(distanceUnSqr(x,y,obstRect.x+obstRect.width/2, obstRect.y+obstRect.height/2)0) + { + float left = 0; + float right = 0; + float top = 0; + float bottom = 0; + for(int i=0; iright) + { + right = rect.x+rect.width; + } + if(rect.ybottom) + { + bottom = rect.y + rect.height; + } + } + } + + byte obstDir = getDir2(x,y,(left+right)/2,(bottom+top)/2); + if(obstDir==DIR_UP) + { + double distBottomLeft = distanceUnSqr(x,y,bottom,left); + double distBottomRight = distanceUnSqr(x,y,bottom,right); + if(distBottomLeft=1) + { + moveLeft=1; + moveRight=0; + playerdir=LEFT; + } + else if(x=1) + { + moveLeft=0; + moveRight=1; + playerdir=RIGHT; + } + else + { + moveLeft=0; + moveRight=0; + } + if(yvelocity>=-2) + { + recoverJump(); + } + } + else if(targetDir==DIR_LEFT) + { + moveLeft=1; + moveRight=0; + playerdir=LEFT; + if((target.y<(y+60)) && (xvelocity<=1 || (y-target.y)>60)) + { + if(yvelocity>=-2) + { + recoverJump(); + } + } + else if(target.y>y+60) + { + if(CanDo()) + { + double randNum = GameEngine::random()*100; + if(randNum>90) + { + randomizer.doAttack(ATTACKTYPE_SIDEMOVE); + } + } + } + } + else if(targetDir==DIR_RIGHT) + { + moveLeft=0; + moveRight=1; + playerdir=RIGHT; + if((target.y<(y+60)) && (xvelocity>=1 || y-target.y>60)) + { + if(yvelocity>=-2) + { + recoverJump(); + } + } + else if(target.y>y+60) + { + if(CanDo()) + { + double randNum = GameEngine::random()*100; + if(randNum>90) + { + randomizer.doAttack(ATTACKTYPE_SIDEMOVE); + } + } + } + } + else if(targetDir==DIR_DOWN) + { + if(target.x=1) + { + moveLeft=1; + moveRight=0; + playerdir=LEFT; + } + else if(x=1) + { + moveLeft=0; + moveRight=1; + playerdir=RIGHT; + } + else + { + moveLeft=0; + moveRight=0; + } + + double targetDist = distanceUnSqr(x,y,target.x,target.y); + if((targetDist>100 || yvelocity<=10)&&(abs(x - target.x)<10)) + { + randomizer.doAttack(ATTACKTYPE_DOWNMOVE); + } + } + } + + void Player::goInDirection(byte dir) + { + moveLeft = 0; + moveRight = 0; + down = false; + up = false; + upKey = false; + + switch(dir) + { + case DIR_UP: + if(isObstacle(currentCollidePlatformActor[DIR_DOWN])) + { + switch(playerdir) + { + case LEFT: + if(isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + if(!isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + else + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + } + else + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + break; + + case RIGHT: + if(isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + if(!isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + else + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + } + else + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + break; + } + } + else + { + if(yvelocity>=0) + { + recoverJump(); + } + } + break; + + case DIR_UPLEFT: + if(!isObstacle(currentCollidePlatformActor[DIR_DOWN])) + { + if(yvelocity>=0) + { + recoverJump(); + } + } + if(!isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + break; + + case DIR_UPRIGHT: + if(!isObstacle(currentCollidePlatformActor[DIR_DOWN])) + { + if(yvelocity>=0) + { + recoverJump(); + } + } + if(!isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + break; + + case DIR_LEFT: + if(!isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + else + { + if(yvelocity>=0) + { + recoverJump(); + } + } + break; + + case DIR_RIGHT: + if(!isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + else + { + if(yvelocity>=0) + { + recoverJump(); + } + } + break; + + case DIR_DOWNLEFT: + if(currentCollidePlatformActor[DIR_UP]!=null) + { + Platform*plat = currentCollidePlatformActor[DIR_UP]; + if(plat->getType() == Platform::TYPE_GOTHROUGH) + { + moveDown(); + } + else + { + if(!isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + else + { + if(yvelocity>=0) + { + recoverJump(); + } + } + } + } + else + { + if(!isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + } + break; + + case DIR_DOWNRIGHT: + if(currentCollidePlatformActor[DIR_UP]!=null) + { + Platform*plat = currentCollidePlatformActor[DIR_UP]; + if(plat->getType() == Platform::TYPE_GOTHROUGH) + { + moveDown(); + } + else + { + if(!isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + else + { + if(yvelocity>=0) + { + recoverJump(); + } + } + } + } + else + { + if(!isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + } + break; + + case DIR_DOWN: + if(currentCollidePlatformActor[DIR_UP]!=null) + { + Platform*plat = currentCollidePlatformActor[DIR_UP]; + if(plat->getType() == Platform::TYPE_GOTHROUGH) + { + moveDown(); + } + else + { + switch(playerdir) + { + case LEFT: + if(!isObstacle(currentCollidePlatformActor[DIR_RIGHT])) + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + else + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + break; + + case RIGHT: + if(!isObstacle(currentCollidePlatformActor[DIR_LEFT])) + { + moveLeft = 0; + moveRight = 1; + playerdir = RIGHT; + } + else + { + moveLeft = 1; + moveRight = 0; + playerdir = LEFT; + } + break; + } + } + } + break; + } + } + + boolean Player::checkObstacleDir(RectangleF obst, byte dir) + { + byte obstDir1 = getDir2(x,y,obst.x,obst.y); + byte obstDir2 = getDir2(x, y, obst.x + obst.width, obst.y + obst.height); + if(checkDirRelation(dir,obstDir1, obstDir2)) + { + return true; + } + return false; + } + + boolean Player::checkDirSemicircle(byte dir, byte dirCmp) + { + ArrayList dirs = ArrayList(); + dirs.add(dir); + byte newDir = (byte)(dir-1); + if(newDir<1) + { + newDir = 8; + } + dirs.add(newDir); + newDir--; + if(newDir<1) + { + newDir = 8; + } + dirs.add(newDir); + newDir = (byte)(dir+1); + if(newDir>8) + { + newDir = 1; + } + dirs.add(newDir); + newDir--; + if(newDir>8) + { + newDir = 1; + } + dirs.add(newDir); + + for(int i=0; icmp1) + { + if(dir>cmp1 && dircmp2) + { + if(dir>cmp1 || dir bottom) + { + return distanceUnSqr(self.x, self.y, left, bottom); + } + else if(self.y < top) + { + float middleY = (bottom - rect.height/2); + if(self.y > middleY) + { + return distanceUnSqr(self.x, self.y, left, middleY); + } + else + { + return distanceUnSqr(self.x, self.y, left, top); + } + } + else + { + return distanceUnSqr(self.x, self.y, left, top); + } + } + else if(self.x > right) + { + if(self.y > bottom) + { + return distanceUnSqr(self.x, self.y, right, bottom); + } + else if(self.y < top) + { + float middleY = (bottom - rect.height/2); + if(self.y > middleY) + { + return distanceUnSqr(self.x, self.y, right, middleY); + } + else + { + return distanceUnSqr(self.x, self.y, right, top); + } + } + else + { + return distanceUnSqr(self.x, self.y, right, top); + } + } + else //self is in between left and right + { + if(self.y > bottom) + { + float leftDist = self.x - left; + float rightDist = right - self.x; + if(leftDistmiddleY) + { + if(xright) + { + if(dir==DIR_UPRIGHT) + { + return Vector2f(right, middleY); + } + return Vector2f(right, top); + } + else + { + if(dir==DIR_UPRIGHT || (dir==DIR_UP && playerdir==RIGHT)) + { + return Vector2f(right, bottom); + } + else if(dir==DIR_UPLEFT || (dir==DIR_UP && playerdir==LEFT)) + { + return Vector2f(left, bottom); + } + return Vector2f((float)rect.x + (float)rect.width/2, bottom); + } + } + else + { + if(xright) + { + return Vector2f(right, top); + } + else + { + if(dir == DIR_UPRIGHT) + { + return Vector2f(right, top); + } + else if(dir == DIR_UPLEFT) + { + return Vector2f(left, top); + } + return Vector2f((float)rect.x + (float)rect.width/2, top); + } + } + + case DIR_LEFT: + if(y>middleY) + { + if(xright) + { + return Vector2f(right, top); + } + return Vector2f(left, bottom); + } + else + { + if(xright) + { + return Vector2f(right, top); + } + return Vector2f(left, middleY); + } + + case DIR_RIGHT: + if(y>middleY) + { + if(xright) + { + return Vector2f(right, top); + } + return Vector2f(right, bottom); + } + else + { + if(xright) + { + return Vector2f(right, top); + } + return Vector2f(right, middleY); + } + + case DIR_DOWNLEFT: + case DIR_DOWNRIGHT: + case DIR_DOWN: + if(yright) + { + return Vector2f(right, bottom); + } + else + { + if(dir==DIR_DOWNLEFT || (dir==DIR_DOWN && playerdir==LEFT)) + { + return Vector2f(left, middleY); + } + else if(dir==DIR_DOWNRIGHT || (dir==DIR_DOWN && playerdir==RIGHT)) + { + return Vector2f(right, middleY); + } + return Vector2f((float)rect.x + (float)rect.width/2, middleY); + } + } + else if(yright) + { + return Vector2f(right, bottom); + } + else + { + if(dir==DIR_DOWNLEFT || (dir==DIR_DOWN && playerdir==LEFT)) + { + return Vector2f(left, bottom); + } + else if(dir==DIR_DOWNRIGHT || (dir==DIR_DOWN && playerdir==RIGHT)) + { + return Vector2f(right, bottom); + } + return Vector2f((float)rect.x + (float)rect.width/2, bottom); + } + } + return Vector2f(x,y); + } + return Vector2f(x,y); + } + + //true means plat goes x way, false means y + boolean Player::getDirSeparating(Vector2f target, Rectangle rect) + { + int left = (int)hitbox->x; + int right = (int)(hitbox->x + hitbox->width); + float middlePlatY = (float)rect.y + (float)rect.height/2; + if((target.y < middlePlatY && middlePlatY < y)||(target.y > middlePlatY && middlePlatY > y)) + { + if(right rect.x) + { + return true; + } + } + else if(left>(rect.x + rect.width)) + { + if(target.x < (rect.x + rect.width)) + { + return true; + } + } + else + { + return true; + } + } + else if((target.y > rect.y && target.y < (rect.y + rect.height))||(y > rect.y && y < (rect.y + rect.height))) + { + if(x<=rect.x && target.x>=(rect.x+rect.width)) + { + return false; + } + else if(x>=(rect.x+rect.width) && target.x<=rect.x) + { + return false; + } + } + return true; + } + + Rectangle Player::getRectSeparating(Vector2f target) + { + int left = (int)hitbox->x; + int right = (int)(hitbox->x + hitbox->width); + + Rectangle separatingRect = Rectangle(-1,-1,-1,-1); + boolean hasRect = false; + float currentDist = 0; + + for(int i=0; iplatforms.size(); i++) + { + Platform*plat = Global::currentStage->platforms.get(i); + if(isObstacle(plat)) + { + Rectangle platRect; + if(plat->getCollideType()==Platform::COLLIDE_SOLID) + { + platRect = Rectangle((int)(plat->x-plat->width/2),(int)(plat->y-plat->height),plat->width,plat->height); + } + else + { + platRect = Rectangle((int)plat->x,(int)plat->y,plat->width,plat->height); + } + + if(!hasRect) + { + float middlePlatY = (float)platRect.y + (float)platRect.height/2; + if((target.y < middlePlatY && middlePlatY < y)||(target.y > middlePlatY && middlePlatY > y)) + { + if(right platRect.x) + { + separatingRect = platRect; + currentDist = (float)platRect.x - (float)right; + } + } + else if(left>(platRect.x + platRect.width)) + { + if(target.x < (platRect.x + platRect.width)) + { + separatingRect = platRect; + currentDist = (float)left - ((float)platRect.x + (float)platRect.width); + } + } + else + { + separatingRect = platRect; + currentDist = abs(y - middlePlatY); + } + } + else if((target.y > platRect.y && target.y < (platRect.y + platRect.height))||(y > platRect.y && y < (platRect.y + platRect.height))) + { + if(x<=platRect.x && target.x>=(platRect.x+platRect.width)) + { + separatingRect = platRect; + currentDist = platRect.x - x; + } + else if(x>=(platRect.x+platRect.width) && target.x<=platRect.x) + { + separatingRect = platRect; + currentDist = x - (platRect.x+platRect.width); + } + } + } + else + { + float middlePlatY = (float)platRect.y + (float)platRect.height/2; + if((target.y < middlePlatY && middlePlatY < y)||(target.y > middlePlatY && middlePlatY > y)) + { + if(right platRect.x) + { + float newDist = (float)platRect.x - (float)right; + if(newDist < currentDist) + { + separatingRect = platRect; + currentDist = newDist; + } + } + } + else if(left>(platRect.x + platRect.width)) + { + if(target.x < (platRect.x + platRect.width)) + { + float newDist = (float)left - ((float)platRect.x + (float)platRect.width); + if(newDist < currentDist) + { + separatingRect = platRect; + currentDist = newDist; + } + } + } + else + { + float newDist = abs(y - middlePlatY); + if(newDist < currentDist) + { + separatingRect = platRect; + currentDist = newDist; + } + } + } + else if((target.y > platRect.y && target.y < (platRect.y + platRect.height))||(y > platRect.y && y < (platRect.y + platRect.height))) + { + if(x<=platRect.x && target.x>=(platRect.x+platRect.width)) + { + float newDist = platRect.x - x; + if(newDist < currentDist) + { + separatingRect = platRect; + currentDist = newDist; + } + } + else if(x>=(platRect.x+platRect.width) && target.x<=platRect.x) + { + float newDist = x - (platRect.x+platRect.width); + if(newDist < currentDist) + { + separatingRect = platRect; + currentDist = newDist; + } + } + } + } + } + } + + for(int i=0; ix-(proj->width/2)),(int)(proj->y-(proj->height/2)),proj->width,proj->height); + + if(proj->getPlayerNo()!=playerNo || (Global::teamBattle && proj->getTeam()!=team)) + { + if(!hasRect) + { + float middlePlatY = (float)rect.y + (float)rect.height/2; + if((target.y < middlePlatY && middlePlatY < y)||(target.y > middlePlatY && middlePlatY > y)) + { + if(right rect.x) + { + separatingRect = rect; + currentDist = (float)rect.x - (float)right; + } + } + else if(left>(rect.x + rect.width)) + { + if(target.x < ((float)rect.x + (float)rect.width)) + { + separatingRect = rect; + currentDist = (float)left - ((float)rect.x + (float)rect.width); + } + } + else + { + separatingRect = rect; + currentDist = abs(y - middlePlatY); + } + } + else if((target.y > rect.y && target.y < (rect.y + rect.height))||(y > rect.y && y < (rect.y + rect.height))) + { + if(x<=rect.x && target.x>=(rect.x+rect.width)) + { + separatingRect = rect; + currentDist = rect.x - x; + } + else if(x>=(rect.x+rect.width) && target.x<=rect.x) + { + separatingRect = rect; + currentDist = x - (rect.x+rect.width); + } + } + } + else + { + float middlePlatY = (float)rect.y + (float)rect.height/2; + if((target.y < middlePlatY && middlePlatY < y)||(target.y > middlePlatY && middlePlatY > y)) + { + if(right rect.x) + { + float newDist = (float)rect.x - (float)right; + if(newDist < currentDist) + { + separatingRect = rect; + currentDist = newDist; + } + } + } + else if(left>(rect.x + rect.width)) + { + if(target.x < (rect.x + rect.width)) + { + float newDist = (float)left - ((float)rect.x + (float)rect.width); + if(newDist < currentDist) + { + separatingRect = rect; + currentDist = newDist; + } + } + } + else + { + float newDist = abs(y - middlePlatY); + if(newDist < currentDist) + { + separatingRect = rect; + currentDist = newDist; + } + } + } + else if((target.y > rect.y && target.y < (rect.y + rect.height))||(y > rect.y && y < (rect.y + rect.height))) + { + if(x<=rect.x && target.x>=(rect.x+rect.width)) + { + float newDist = rect.x - x; + if(newDist < currentDist) + { + separatingRect = rect; + currentDist = newDist; + } + } + else if(x>=(rect.x+rect.width) && target.x<=rect.x) + { + float newDist = x - (rect.x+rect.width); + if(newDist < currentDist) + { + separatingRect = rect; + currentDist = newDist; + } + } + } + } + } + } + return separatingRect; + } + + void Player::followEnemy(boolean canAttack, int level) + { + currentEnemy->updateHitbox(); + Vector2f enemyVect = Vector2f(currentEnemy->x, currentEnemy->y); + byte hitboxDir = getDir(hitbox,currentEnemy->hitbox); + double closeDist = 20; + switch(hitboxDir) + { + case DIR_UP: + case DIR_DOWN: + closeDist = hitbox->height/2 + currentEnemy->hitbox->height/2 + 4; + break; + + case DIR_LEFT: + case DIR_RIGHT: + closeDist = hitbox->width/2 + currentEnemy->hitbox->width/2 + 4; + break; + } + closeDist = closeDist*closeDist; + + byte enemyDir = getDir(x,y,currentEnemy->x,currentEnemy->y); + + Rectangle separatingRect = getRectSeparating(enemyVect); + if(separatingRect.x==-1) + { + goInDirection(enemyDir); + } + else + { + boolean dirSeparating = getDirSeparating(enemyVect,separatingRect); + if(dirSeparating) + { + if(y>enemyVect.y) + { + if(checkTrappedUnder(separatingRect)) + { + switch(playerdir) + { + case LEFT: + goInDirection(DIR_LEFT); + break; + + case RIGHT: + goInDirection(DIR_RIGHT); + break; + } + } + else + { + goInDirection(DIR_UP); + if(moveLeft==0 && moveRight==0) + { + if(enemyVect.x < x) + { + playerdir = LEFT; + } + else if(enemyVect.x > x) + { + playerdir = RIGHT; + } + } + } + } + else + { + if(checkTrappedOver(separatingRect) || isObstacle(currentCollidePlatformActor[DIR_UP])) + { + switch(playerdir) + { + case LEFT: + goInDirection(DIR_LEFT); + break; + + case RIGHT: + goInDirection(DIR_RIGHT); + break; + } + } + else + { + goInDirection(DIR_DOWN); + if(enemyVect.x < x) + { + playerdir = LEFT; + } + else if(enemyVect.x > x) + { + playerdir = RIGHT; + } + } + } + } + else + { + if(separatingRect.y <= y) + { + if(getClosestDistanceUnSqr(Vector2f(x,y),separatingRect)<=1000) + { + if(enemyVect.x < x) + { + goInDirection(DIR_UPLEFT); + } + else + { + goInDirection(DIR_UPRIGHT); + } + } + else + { + if(enemyVect.x < x) + { + goInDirection(DIR_LEFT); + } + else + { + goInDirection(DIR_RIGHT); + } + } + } + else + { + if(enemyVect.x < x) + { + goInDirection(DIR_LEFT); + } + else + { + goInDirection(DIR_RIGHT); + } + } + } + } + } + + boolean Player::checkEnemyHang() + { + for(int i=0; i<=Global::possPlayers; i++) //TODO: loop characters + { + Player*playr = Global::characters[i]; + + if(playr!=null) + { + switch(playerdir) + { + case LEFT: + if(playr->xy<=y && (y-playr->y)<60 && (x-playr->x)<60) + { + return true; + } + return false; + + case RIGHT: + if(playr->x>x && playr->y<=y && (y-playr->y)<60 && (playr->x-x)<60) + { + return true; + } + return false; + } + } + } + return false; + } + + boolean Player::recover(int level) + { + boolean canFollow = Global::currentStage->checkSafeArea(this); + if(!canFollow && !hanging) + { + Vector2f target = findRecoveryTarget(); + + getToRecoveryTarget(target); + + return true; + } + else if(hanging) + { + if(checkEnemyHang()) + { + climbUpAttack(); + } + else + { + climbUp(); + } + } + /*else if(onGround && CanDo()) + { + moveLeft=0; + moveRight=0; + animFinish(); + }*/ + return false; + } + + void Player::stopAI(int level) + { + boolean needToRecover = recover(level); + if(!needToRecover) + { + if(onGround) + { + moveLeft = 0; + moveRight = 0; + down = false; + up = false; + } + } + } + + void Player::walkAI(int level) + { + boolean needToRecover = recover(level); + if(!needToRecover) + { + if(onGround) + { + Platform*plat = currentCollidePlatformActor[DIR_UP]; + boolean leftSide = false; + if(currentCollidePlatformActor[DIR_RIGHT]!=null && currentCollidePlatformActor[DIR_RIGHT]!=currentCollidePlatformActor[DIR_UP]) + { + leftSide = true; + } + boolean rightSide = false; + if(currentCollidePlatformActor[DIR_LEFT]!=null && currentCollidePlatformActor[DIR_LEFT]!=currentCollidePlatformActor[DIR_UP]) + { + rightSide = true; + } + if(plat!=null) + { + Rectangle platRect; + if(plat->getCollideType() == Platform::COLLIDE_BOX) + { + platRect = Rectangle((int)plat->x,(int)plat->y,plat->width,plat->height); + } + else + { + platRect = Rectangle((int)(plat->x-plat->width/2),(int)(plat->y-plat->height/2),plat->width,plat->height); + } + + float leftX = (x - hitbox->width/2); + float rightX = (x + hitbox->width/2); + + if(leftX<=platRect.x || leftSide) + { + playerdir = RIGHT; + moveLeft = 0; + moveRight = 1; + } + else if(rightX>=(platRect.x+platRect.width) || rightSide) + { + playerdir = LEFT; + moveLeft = 1; + moveRight = 0; + } + } + } + if(moveLeft==0 && moveRight==0) + { + switch(playerdir) + { + case LEFT: + moveLeft = 1; + break; + + case RIGHT: + moveRight = 1; + break; + } + } + } + } + + void Player::runAI(int level) + { + boolean needToRecover = recover(level); + if(!needToRecover) + { + if(onGround) + { + Platform*plat = currentCollidePlatformActor[DIR_UP]; + boolean leftSide = false; + if(currentCollidePlatformActor[DIR_RIGHT]!=null && currentCollidePlatformActor[DIR_RIGHT]!=currentCollidePlatformActor[DIR_UP]) + { + leftSide = true; + } + boolean rightSide = false; + if(currentCollidePlatformActor[DIR_LEFT]!=null && currentCollidePlatformActor[DIR_LEFT]!=currentCollidePlatformActor[DIR_UP]) + { + rightSide = true; + } + if(plat!=null) + { + Rectangle platRect; + if(plat->getCollideType() == Platform::COLLIDE_BOX) + { + platRect = Rectangle((int)plat->x,(int)plat->y,plat->width,plat->height); + } + else + { + platRect = Rectangle((int)(plat->x-plat->width/2),(int)(plat->y-plat->height/2),plat->width,plat->height); + } + + float leftX = (x - hitbox->width/2); + float rightX = (x + hitbox->width/2); + + if(leftX<=platRect.x || leftSide) + { + if(moveLeft>0) + { + playerdir = RIGHT; + moveLeft = 0; + moveRight = 2; + } + } + else if(rightX>=(platRect.x+platRect.width) || rightSide) + { + if(moveRight>0) + { + playerdir = LEFT; + moveLeft = 2; + moveRight = 0; + } + } + } + } + if(moveLeft==0 && moveRight==0) + { + switch(playerdir) + { + case LEFT: + moveLeft = 2; + break; + + case RIGHT: + moveRight = 2; + break; + } + } + } + } + + void Player::jumpAI(int level) + { + boolean needToRecover = recover(level); + if(!needToRecover) + { + if(yvelocity>=0) + { + recoverJump(); + } + } + } + + void Player::followAI(int level) + { + moveLeft = 0; + moveRight = 0; + down = false; + up = false; + upKey = false; + + boolean needToRecover = recover(level); + if(!needToRecover) + { + updateCPUTarget(); + + if(currentEnemy!=null) + { + /*double enemyDist = distanceUnSqr(x, y, currentEnemy->x, currentEnemy->y); + if(enemyDist>3600) //60 + goInDirection(enemyDir);*/ + updateHitbox(); + currentEnemy->updateHitbox(); + byte hitboxDir = getDir(hitbox,currentEnemy->hitbox); + double enemyDist = distanceUnSqr(hitbox->x+hitbox->width/2, hitbox->y+hitbox->height/2,currentEnemy->hitbox->x+currentEnemy->hitbox->width/2,currentEnemy->hitbox->y+currentEnemy->hitbox->height/2); + double closeDist = 20; + switch(hitboxDir) + { + case DIR_UP: + case DIR_DOWN: + closeDist = hitbox->height/2 + currentEnemy->hitbox->height/2 + 4; + break; + + case DIR_LEFT: + case DIR_RIGHT: + closeDist = hitbox->width/2 + currentEnemy->hitbox->width/2 + 4; + break; + } + closeDist = closeDist*closeDist; + + if(enemyDist>closeDist) + { + //perform melee attacks + followEnemy(false, level); + } + } + } + } + + void Player::normalAI(int level) + { + moveLeft = 0; + moveRight = 0; + down = false; + up = false; + upKey = false; + + boolean needToRecover = recover(level); + if(!needToRecover) + { + updateCPUTarget(); + + if(currentEnemy!=null) + { + /*double enemyDist = distanceUnSqr(x, y, currentEnemy->x, currentEnemy->y); + if(enemyDist>3600) //60 + goInDirection(enemyDir);*/ + updateHitbox(); + currentEnemy->updateHitbox(); + byte hitboxDir = getDir(hitbox,currentEnemy->hitbox); + double enemyDist = distanceUnSqr(hitbox->x+hitbox->width/2, hitbox->y+hitbox->height/2,currentEnemy->hitbox->x+currentEnemy->hitbox->width/2,currentEnemy->hitbox->y+currentEnemy->hitbox->height/2); + double closeDist = 20; + switch(hitboxDir) + { + case DIR_UP: + case DIR_DOWN: + closeDist = hitbox->height/2 + currentEnemy->hitbox->height/2 + 8; + break; + + case DIR_LEFT: + case DIR_RIGHT: + closeDist = hitbox->width/2 + currentEnemy->hitbox->width/2 + 8; + break; + } + closeDist = closeDist*closeDist; + + if(enemyDist<=closeDist) + { + //perform melee attacks + double randWait = GameEngine::random()*20; + double levelCompare = (double)level; + if(randWaitxplayerdir==RIGHT) + { + enemyFacing = true; + } + } + else if(currentEnemy->x>x) + { + playerdir = RIGHT; + if(currentEnemy->playerdir==LEFT) + { + enemyFacing = true; + } + } + + if(currentEnemy->attacksPriority>0 && enemyFacing) + { + double choice = GameEngine::random()*100; + if(choice>=75) + { + randomizer.doAttack(ATTACKTYPE_STRONGMELEE); + } + else if(choice>68) + { + randomizer.doAttack(ATTACKTYPE_PROJECTILE); + } + } + else + { + randomizer.doAttack(ATTACKTYPE_MELEE); + } + } + break; + + case DIR_UP: + randomizer.doAttack(ATTACKTYPE_UPMELEE); + break; + + case DIR_DOWN: + randomizer.doAttack(ATTACKTYPE_DOWNMELEE); + break; + } + } + } + } + } + else + { + followEnemy(true, level); + } + } + } + } + + void Player::cpuAI(byte type, int level) + { + switch(type) + { + case AI_NORMAL: + normalAI(level); + break; + + case AI_STOP: + stopAI(level); + break; + + case AI_WALK: + walkAI(level); + break; + + case AI_RUN: + runAI(level); + break; + + case AI_JUMP: + jumpAI(level); + break; + + case AI_FOLLOW: + followAI(level); + break; + } + } + + void Player::Update(long gameTime) + { + if(firstUpdate) + { + changeAnimation(getAnimName(), getAnimation()->getDirection()); + } + /*if(playerNo==2 && currentCollidePlatformActor[DIR_UP]!=null) + { + Console::WriteLine("" + (currentCollidePlatformActor[DIR_UP].x + currentCollidePlatformActor[DIR_UP].width/2) + ", " + (x + hitbox->width/2)); + }*/ + //updateBooleanGrid(); + GameElement::Update(gameTime); + groundCheck = false; + collideQueue.clear(); + + groundCollidedFrame = false; + if(chargebar!=null) + { + if(chargebar->inactive) + { + delete chargebar; + chargebar = null; + } + else + { + chargebar->Update(gameTime); + } + } + if(itemHolding!=null) + { + itemHolding->Update(gameTime); + if(itemHolding->dead) + { + itemHolding->destroy(); + itemHolding->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemHolding->itemNo)); + delete itemHolding; + itemHolding = null; + } + } + if(itemWearing!=null) + { + itemWearing->Update(gameTime); + if(itemWearing->dead) + { + itemWearing->destroy(); + itemWearing->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemWearing->itemNo)); + delete itemWearing; + itemWearing = null; + } + } + if(itemHatting!=null) + { + itemHatting->Update(gameTime); + if(itemHatting->dead) + { + itemHatting->destroy(); + itemHatting->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemHatting->itemNo)); + delete itemHatting; + itemHatting = null; + } + } + if(itemWielding!=null) + { + itemWielding->Update(gameTime); + if(itemWielding->dead) + { + itemWielding->destroy(); + itemWielding->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemWielding->itemNo)); + delete itemWielding; + itemWielding = null; + } + } + if(alive) + { + if(yVel!=0) + { + y+=yVel; + yvelocity=0; + } + if(xVel!=0) + { + x += xVel; + xvelocity=0; + } + updateHitbox(); + hitbox->Update(gameTime); + indicator->Update(gameTime); + if(!firstUpdate) + { + for(int i=0; i<=Global::possPlayers; i++) //TODO: loop characters + { + if(Global::characters[i]!=null && i!=playerNo) + { + checkPlayerCollision(Global::characters[i]); + } + } + + String animname = getAnimName(); + + if(animname.equals("stand_left") && !onGround) + { + changeAnimation("fall_left",NO_CHANGE); + } + else if(animname.equals("stand_right") && !onGround) + { + changeAnimation("fall_right",NO_CHANGE); + } + } + updateHitbox(); + } + else + { + x = -10000; + y = -10000; + } + offScreenExplosion->Update(gameTime); + firstUpdate = false; + } + + void Player::updateGravity() + { + if(!grabbed && !hanging) + { + yvelocity+=(float)(Global::currentStage->getGravity()+weight); + } + } + + void Player::updateFrame() + { + if(hurtFrame>0) + { + Actor::setColor(Color::RED); + hurtFrame-=1; + } + else if(chargeSmash>0) + { + Actor::setColor(Color::YELLOW); + } + else + { + Actor::setColor(playerColor); + hurtFrame=0; + } + } + + void Player::updateMovement() + { + //(int flyD, float recS, float waterS, float fallS, float moveS, + // int flyRD,float recRS,float waterRS,float fallRS,float moveRS) + if((CanDo())&&(chargeSmash==0)&&(!chargingAttack)) + { + if(moveRight>0) + { + switch(moveRight) + { + case 1: + if(moveTime<=Game::getGameTime()) + { + moveTime=Game::getGameTime()+flyTime; + if(!onGround) + { + xvelocity=xvelocity*(recoverAmount); + } + } + hurt=0; + playerdir=2; + if(!onGround) + { + /*if(inWater==1) + { + x+=waterS; + if(jumping==0) + { + changeAnimation("Event Actor", "walk_right", NO_CHANGE); + } + } + else + {*/ + if(jumping) + { + x+=(fallWalk+jumpXBoost); + } + else + { + x+=fallWalk; + } + //} + } + + else + { + if(canDo) + { + if(!jumping) + { + changeAnimation("walk_right", NO_CHANGE); + } + x+=walkSpeed; + } + } + break; + + case 2: + if(moveTime<=Game::getGameTime()) + { + moveTime=Game::getGameTime()+flyRunTime; + if(!onGround) + { + xvelocity=xvelocity*(recoverRunAmount); + } + } + hurt=0; + playerdir=2; + if(!onGround) + { + /*if(inWater==1) + { + x+=waterRS; + if(jumping==0) + { + changeAnimation("Event Actor", "walk_right", NO_CHANGE); + } + } + else + {*/ + if(jumping) + { + x+=(fallRun+jumpXBoost); + } + else + { + x+=fallRun; + } + //} + } + + else + { + if(canDo) + { + if(!jumping) + { + changeAnimation("run_right", NO_CHANGE); + } + x+=runSpeed; + } + } + break; + } + } + + else if(moveLeft>0) + { + switch(moveLeft) + { + case 1: + if(moveTime<=Game::getGameTime()) + { + moveTime=Game::getGameTime()+flyTime; + if(!onGround) + { + xvelocity=xvelocity*(recoverAmount); + } + } + hurt=0; + playerdir=1; + if(!onGround) + { + /*if(inWater==1) + { + x-=waterS; + if(jumping==0) + { + changeAnimation("Event Actor", "walk_left", NO_CHANGE); + } + } + else + {*/ + if(jumping) + { + x-=(fallWalk+jumpXBoost); + } + else + { + x-=fallWalk; + } + //} + } + + else + { + if(canDo) + { + if(!jumping) + { + changeAnimation("walk_left", NO_CHANGE); + } + x-=walkSpeed; + } + } + break; + + case 2: + if(moveTime<=Game::getGameTime()) + { + moveTime=Game::getGameTime()+flyRunTime; + if(!onGround) + { + xvelocity=xvelocity*(recoverRunAmount); + } + } + hurt=0; + playerdir=1; + if(!onGround) + { + /*if(inWater==1) + { + x-=waterRS; + if(jumping==0) + { + changeAnimation("Event Actor", "walk_left", NO_CHANGE); + } + } + else + {*/ + if(jumping) + { + x-=(fallRun+jumpXBoost); + } + else + { + x-=fallRun; + } + //} + } + + else + { + if(canDo) + { + if(!jumping) + { + changeAnimation("run_left", NO_CHANGE); + } + x-=runSpeed; + } + } + break; + } + } + else + { + String animName = getAnimName(); + if(animName.equals("walk_left") || animName.equals("walk_right") || animName.equals("run_left") || animName.equals("run_right")) + { + animFinish(); + } + } + } + } + + void Player::updateHanging() + { + if(hanging) + { + hurt=0; + canDo=true; + attacksHolder=-1; + attacksPriority=0; + yvelocity=0; + xvelocity=0; + switch(playerdir) + { + case 1: + changeAnimation("hang_left", NO_CHANGE); + break; + + case 2: + changeAnimation("hang_right", NO_CHANGE); + break; + } + switch(currentHangPoint->getHangSide()) + { + case 1: + if(playerdir==2 || hurt==2) + { + x=(currentHangPoint->x+(currentHangPoint->width/2))-hangPoint.x; + y=currentHangPoint->y+((height/2)-hangPoint.y); + } + else + { + hanging = false; + currentHangPoint->hanging=0; + animFinish(); + } + break; + + case 2: + if(playerdir==1 || hurt==2) + { + x=currentHangPoint->x+(currentHangPoint->width/2)+hangPoint.x; + y=currentHangPoint->y+((height/2)-hangPoint.y); + } + else + { + hanging = false; + currentHangPoint->hanging=0; + animFinish(); + } + break; + } + } + updateHitbox(); + } + + void Player::updateHurt() + { + if((hurtTime>0)&&(Global::worldTime>=hurtTime)) + { + hurtTime=0; + if(hurt==2) + { + hurt=1; + xvelocity*=0.8f; + attacksHolder=-1; + } + } + } + + void Player::updateDrop() + { + if(dropTime>0) + { + if(Global::worldTime>=dropTime) + { + dropTime=0; + dropping=false; + } + else if((Global::worldTime+2)>=dropTime) + { + if(canDo && !onGround && !jumping) + { + switch(playerdir) + { + case 1: + changeAnimation("fall_left", FORWARD); + break; + + case 2: + changeAnimation("fall_right", FORWARD); + break; + } + } + } + } + } + + /*void updateChargeB() + { + if((chargeTimeB>0)&&(worldTime>=chargeTimeB)) + { + chargeTimeB=0; + charge_bdown=0; + } + }*/ + + void Player::updateAI() + { + if(this->cpu) + { + if(Global::gamePlaying) + { + //if(aiTime>0 && aiTime>=Global::getWorldTime()) + { + + if(Global::gameType == Global::TYPE_TRAINING) + { + cpuAI(aiType,1); + } + else + { + cpuAI(AI_NORMAL, 1); + } + } + updateHitbox(); + } + } + } + + void Player::Draw(Graphics2D&g, long gameTime) + { + if(alive) + { + GameElement::Draw(g, gameTime); + + if(setIndic) + { + switch(playerdir) + { + case LEFT: + indicator->x = (float)(this->x*Camera::Zoom) - (float)(indicX*Scale*Camera::Zoom); + break; + + case RIGHT: + indicator->x = (float)(this->x*Camera::Zoom) + (float)(indicX*Scale*Camera::Zoom); + break; + } + indicator->y = (float)(this->y*Camera::Zoom) + (int)(indicY*Scale*Camera::Zoom) - (int)((indicator->height)/2); + } + else + { + indicator->x = (float)(this->x*Camera::Zoom); + indicator->y = (float)(this->y*Camera::Zoom) - (float)((height/2)*Camera::Zoom) - (float)((indicator->height)/2); + } + indicator->Draw(g, gameTime); + updateHitbox(); + hitbox->Draw(g, gameTime); + } + else + { + //x = -10000; + //y = -10000; + } + if(itemHolding!=null) + { + itemHolding->Draw(g, gameTime); + } + if(itemWearing!=null) + { + itemWearing->Draw(g, gameTime); + } + if(itemHatting!=null) + { + itemHatting->Draw(g, gameTime); + } + if(itemWielding!=null) + { + itemWielding->Draw(g, gameTime); + } + offScreenExplosion->Draw(g, gameTime); + } + + void Player::createProjectile(Projectile*p) + { + ProjectileManager::AddProjectile(p); + } + + void Player::causeDamage(Player*collide, int amount) + { + AttackTemplates::causeDamage(this, collide, amount); + } + + void Player::causeHurtLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + AttackTemplates::causeHurtLaunch(this, collide, xDir, xAmount, xMult, yDir, yAmount, yMult); + } + + void Player::causeHurt(Player*collide, byte dir, int time) + { + AttackTemplates::causeHurt(this, collide, dir, time); + } + + //TODO: make these methods + + boolean Player::checkItemUse() + { + boolean pickedUp = false; + if(itemCollidingIndex>-1 && itemCollidingIndex < ItemManager::TotalItems()) + { + Item*item = ItemManager::GetItem(itemCollidingIndex); + if(!item->held && item->canPickUp()) + { + pickedUp = pickUpItem(item); + } + } + if(pickedUp) + { + return true; + } + else + { + if(itemHolding!=null) + { + return itemHolding->use(Item::ATTACK_NORMAL); + } + } + return false; + } + + boolean Player::checkItemUseSide() + { + if(itemHolding!=null) + { + return itemHolding->use(Item::ATTACK_SIDE); + } + return false; + } + + boolean Player::checkItemUseSmash(byte type) + { + if(itemHolding!=null) + { + if(type==STEP_CHARGE) + { + return itemHolding->chargeSmash(); + } + else if(type==STEP_GO) + { + return itemHolding->use(Item::ATTACK_SMASH); + } + return false; + } + return false; + } + + boolean Player::pickUpItem(Item*item) + { + if(!item->held) + { + switch(item->type) + { + case Item::TYPE_HOLD: + if(itemHolding == null) + { + itemHolding = item; + item->pickUp(this); + return true; + } + return false; + + case Item::TYPE_WEAR: + if(itemWearing == null) + { + itemWearing = item; + item->pickUp(this); + return true; + } + return false; + + case Item::TYPE_HAT: + if(itemHatting == null) + { + itemHatting = item; + item->pickUp(this); + return true; + } + return false; + + case Item::TYPE_WIELD: + if(item->getItemNo() == Global::ITEM_SMASHBALL) + { + if(itemWielding!=null) + { + itemWielding->onDestroy(); + } + delete itemWielding; + itemWielding = item; + item->pickUp(this); + return true; + } + else if(itemWielding == null) + { + itemWielding = item; + item->pickUp(this); + return true; + } + return false; + + case Item::TYPE_FOOD: + item->pickUp(this); + return true; + } + } + return false; + } + + void Player::discardItem() + { + if(this->itemHolding!=null) + { + ItemManager::AddItem(itemHolding); + itemHolding->discard(); + this->itemHolding = null; + } + } + + void Player::hitHandlerRight(Player*collide) + { + if((collide->playerNo>0)&&!((Global::teamBattle)&&(team==collide->team))) + { + if(cpu) + { + x-=(float)1; + } + else + { + collide->x+=(float)0.7; + } + } + } + + void Player::hitHandlerLeft(Player*collide) + { + if((collide->playerNo>0)&&!((Global::teamBattle)&&(team==collide->team))) + { + if(cpu) + { + x+=(float)1; + } + else + { + collide->x-=(float)0.7; + } + } + } + + boolean Player::isHittableRight(Player*collide) + { + if((collide->playerNo>0)&&!((Global::teamBattle)&&(team==collide->team))&&!(collide->attacksPriority==6) + &&!(collide->attacksPriority==7)&&(collide->attacksPriorityattacksPriority==attacksPriority) + &&!((collide->playerdir==1)&&(collide->attacksPriority==5))&&(!collide->invincible)) + { + return true; + } + return false; + } + + boolean Player::isHittableLeft(Player*collide) + { + if((collide->playerNo>0)&&!((Global::teamBattle)&&(team==collide->team))&&!(collide->attacksPriority==6) + &&!(collide->attacksPriority==7)&&(collide->attacksPriorityattacksPriority==attacksPriority) + &&!((collide->playerdir==2)&&(collide->attacksPriority==5))&&(!collide->invincible)) + { + return true; + } + return false; + } + + boolean Player::isHittableUp(Player*collide) + { + if((collide->playerNo>0)&&!((Global::teamBattle)&&(team==collide->team))&&(collide->attacksPriorityattacksPriority==6)&&!(collide->attacksPriority==7)&&(!collide->invincible)) + { + return true; + } + return false; + } + + boolean Player::isHittableDown(Player*collide) + { + if((collide->playerNo>0)&&!((Global::teamBattle)&&(team==collide->team))&&(collide->attacksPriorityattacksPriority==6)&&!(collide->attacksPriority==7)&&(!collide->invincible)) + { + return true; + } + return false; + } + + byte Player::isPlayerColliding(Player*collide) + { + RectF overlap = getOverlapArea(collide); + if(overlap.left != -1) + { + RectF overlap2 = collide->getOverlapArea(this); + + int w = (int)(overlap.right - overlap.left); + int h = (int)(overlap.bottom - overlap.top); + + float x1 = ((float)overlap.left/Scale); + float y1 = ((float)overlap.top/Scale); + float x2 = ((float)overlap2.left/collide->Scale); + float y2 = ((float)overlap2.top/collide->Scale); + + float incr1 = (float)(1/Scale); + float incr2 = (float)(1/collide->Scale); + + boolean colliding = false; + + boolean g1 = false; + + int left1 = 0; + int right1 = 0; + int top1 = 0; + int bottom1 = 0; + + PixelIterator pxlIter = PixelIterator(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)w,(int)h); + PixelIterator colPxlIter = PixelIterator(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)w,(int)h); + + for(int cntY = 0; cntYpixelAtPoint((int)pntX2, (int)pntY2); + grid1 = pxlIter.checkNextPixel(); + grid2 = colPxlIter.checkNextPixel(); + + if(grid1) + { + if(!g1) + { + left1 = cntX; + right1 = cntX; + top1 = cntY; + bottom1 = cntY; + } + else + { + if(cntX < left1) + { + left1 = cntX; + } + else if(cntX > right1) + { + right1 = cntX; + } + if(cntY < top1) + { + top1 = cntY; + } + else if(cntY > bottom1) + { + bottom1 = cntY; + } + } + g1 = true; + } + + if(grid1 && grid2) + { + colliding = true; + } + } + } + + if(colliding) + { + Rectangle r1 = Rectangle((int)(overlap.left + left1 + (x-(width/2))),(int)(overlap.top + top1 + (y-(height/2))), right1-left1, bottom1-top1); + collide->updateHitbox(); + Rectangle r2 = Rectangle((int)collide->hitbox->x, (int)collide->hitbox->y, collide->hitbox->width, collide->hitbox->height); + + byte dir = getDir(r2,r1); + + switch(dir) + { + case DIR_UP: + return DIR_DOWN; + + case DIR_UPLEFT: + return DIR_RIGHT; + + case DIR_UPRIGHT: + return DIR_LEFT; + + case DIR_LEFT: + return DIR_RIGHT; + + case DIR_RIGHT: + return DIR_LEFT; + + case DIR_DOWNLEFT: + return DIR_RIGHT; + + case DIR_DOWNRIGHT: + return DIR_LEFT; + + case DIR_DOWN: + return DIR_UP; + } + return dir; + } + } + return 0; + } + + byte Player::solidPlatformCollision(Platform*collide) + { + updateHitbox(); + RectangleF r1 = RectangleF(hitbox->x, hitbox->y, (float)hitbox->width, (float)hitbox->height); + RectangleF r2 = RectangleF((collide->x - collide->width/2),(collide->y - collide->height/2),(float)collide->width,(float)collide->height); + RectangleF collideOverlap = getOverlapRect(r2,r1); + RectangleF overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX = (int)collideOverlap.x; + int endX = (int)(collideOverlap.x + collideOverlap.width); + int startY = (int)collideOverlap.y; + int endY = (int)(collideOverlap.y + collideOverlap.height); + + float x2 = ((float)startX/collide->Scale); + float y2 = ((float)startY/collide->Scale); + float incr = (float)(1/collide->Scale); + + float pntX2 = x2; + float pntY2 = y2; + + int left=0; + int right=0; + int top=0; + int bottom=0; + boolean colliding = false; + + PixelIterator colPxlIter = PixelIterator(collide); + colPxlIter.reset(x2,y2,incr,incr,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY; cntYpixelAtPoint((int)pntX2, (int)pntY2); + + if(checker) + { + if(!colliding) + { + left = cntX; + right = cntX; + top = cntY; + bottom = cntY; + } + else + { + if(cntXright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + colliding = true; + } + pntX2+=incr; + } + pntY2+=incr; + } + + if(colliding) + { + int w = right - left; + int h = bottom - top; + Rectangle collideOverlap2 = Rectangle(left, top, w, h); + int overlapX = (int)((left - startX) + overlap.x + (w/2)); + int overlapY = (int)((top - startY) + overlap.y + (h/2)); + byte dir = getDir2((float)hitbox->width/2,(float)hitbox->height/2,(float)overlapX, (float)overlapY); + + byte type = collide->getType(); + if((type == Platform::TYPE_NORMAL)|| (type == Platform::TYPE_GOTHROUGH && dir == DIR_DOWN && (!jumping || (jumping&&yvelocity>=0)))) + { + switch(dir) + { + case DIR_DOWN: + this->y = (collideOverlap2.y + (collide->y - collide->height/2)) - (float)((float)(hitbox->height + ((float)hitboxPoint.y*Scale))) + 1; + updateHitbox(); + return DIR_UP; + + case DIR_UP: + this->y = ((collide->y - collide->height/2) + (collideOverlap2.y + collideOverlap2.height)) + this->height/2 - ((float)((float)hitboxPoint.y*Scale) + this->height/2) + 1; + updateHitbox(); + return DIR_DOWN; + + case DIR_LEFT: + this->x = ((collide->x - collide->width/2) + (collideOverlap2.x + collideOverlap2.width) + (float)((float)this->hitbox->width)/2); + updateHitbox(); + return DIR_RIGHT; + + case DIR_RIGHT: + this->x = (collideOverlap2.x + (collide->x - collide->width/2)) - (float)((float)this->hitbox->width)/2; + updateHitbox(); + return DIR_LEFT; + } + } + } + } + return 0; + } + + boolean Player::hitboxRectsColliding(HitBox*collide) + { + float left1, left2; + float right1, right2; + float top1, top2; + float bottom1, bottom2; + + Player*playr = Global::getPlayerActor(collide->playerNo); + RectangleF collidePoint = playr->hitboxPoint; + + left1 = (float)(x + (hitboxPoint.x*Scale)); + left2 = (float)(playr->x + (collidePoint.x*Scale)); + right1 = (float)(left1+(hitboxPoint.width*Scale)); + right2 = (float)(left2+(collidePoint.width*Scale)); + top1 = (float)(y + (hitboxPoint.y*Scale)); + top2 = (float)(playr->y + (collidePoint.y*Scale)); + bottom1 = (float)(top1+(hitboxPoint.height*Scale)); + bottom2 = (float)(top2+(collidePoint.height*Scale)); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + boolean Player::hitboxRectsColliding(WireframeActor*collide) + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + left1 = (int)(x + (hitboxPoint.x*Scale)); + left2 = (int)collide->x; + right1 = (int)(left1+(hitboxPoint.width*Scale)); + right2 = (int)collide->x + collide->width; + top1 = (int)(y + (hitboxPoint.y*Scale)); + top2 = (int)collide->y; + bottom1 = (int)(top1+(hitboxPoint.height*Scale)); + bottom2 = (int)collide->y + collide->height; + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + boolean Player::hitboxRectsColliding(Actor*collide) + { + int left1, left2; + int right1, right2; + int top1, top2; + int bottom1, bottom2; + + left1 = (int)(x + (hitboxPoint.x*Scale)); + left2 = (int)collide->x-(collide->width/2); + right1 = (int)(left1+(hitboxPoint.width*Scale)); + right2 = (int)collide->x+(collide->width/2); + top1 = (int)(y + (hitboxPoint.y*Scale)); + top2 = (int)collide->y-(collide->height/2); + bottom1 = (int)(top1+(hitboxPoint.height*Scale)); + bottom2 = (int)collide->y+(collide->height/2); + + if (bottom1 < top2) + { + return false; + } + if (top1 > bottom2) + { + return false; + } + + if (right1 < left2) + { + return false; + } + if (left1 > right2) + { + return false; + } + + return true; + } + + void Player::platformCollision(Platform*collide, byte dir) + { + if(dir>0) + { + if(prevCollidePlatform[dir-1]) + { + if(dir==DIR_UP) + { + if(!groundCollidedFrame) + { + if(lastGroundPlat == collide) //compare pointers + { + float dif = collide->x - lastGroundX; + if(dif!=0) + { + x += dif; + groundCollidedFrame = true; + } + } + lastGroundPlat = collide; + lastGroundX = collide->x; + } + } + whilePlatformCollide(collide, dir); + collide->whilePlayerColliding(this, dir); + } + else + { + if(dir==DIR_UP) + { + lastGroundX = collide->x; + } + onPlatformCollide(collide, dir); + collide->onPlayerCollide(this, dir); + whilePlatformCollide(collide, dir); + collide->whilePlayerColliding(this, dir); + } + } + else + { + if(prevCollidePlatform[dir-1]) + { + finishPlatformCollide(collide,dir); + collide->finishPlayerCollide(this, dir); + } + } + } + + void Player::barrierCollide(byte barrierNo) + { + float xSave = 0; + float ySave = 0; + + String collideSide = ""; + + switch(barrierNo) + { + case DIR_UP: + offScreenExplosion->setRotation(180); + collideSide = "top"; + break; + + case DIR_RIGHT: + offScreenExplosion->setRotation(270); + collideSide = "right"; + break; + + case DIR_DOWN: + offScreenExplosion->setRotation(0); + collideSide = "bottom"; + break; + + case DIR_LEFT: + offScreenExplosion->setRotation(90); + collideSide = "left"; + break; + } + bool finishedGame = false; + if(alive) + { + Console::WriteLine((String)"player " + playerNo + (String)" collided with " + collideSide + (String)"border"); + if(Global::suddenDeath) + { + Console::WriteLine((String)"player " + playerNo + (String)" lost a life"); + + stock -= 1; + + if(Global::gamePlaying) + { + Global::deaths[playerNo]++; + Global::scores[playerNo]--; + + if(lastHit>0) + { + Global::scores[lastHit]++; + Global::KOs[lastHit]++; + } + } + + if(stock == 0) + { + boolean winResult=Global::checkWinners(playerNo); + for(int i=1; i<=Global::possPlayers; i++) + { + Console::WriteLine((String)"winners[" + i + (String)"]=" + Global::winners[i] + (String)", "); + } + if(winResult) + { + Global::finishGame(); + finishedGame = true; + } + } + } + else + { + switch(Global::gameMode) + { + default: + if(Global::gamePlaying) + { + Global::scorePoint(this->getPlayerNo()); + if(lastHit>0) + { + Global::KOs[lastHit]++; + } + Global::deaths[playerNo]++; + } + break; + + case 2: + Console::WriteLine((String)"player " + playerNo + (String)" lost a life"); + + stock -= 1; + + if(Global::gamePlaying) + { + if(lastHit>0) + { + Global::scores[lastHit]++; + Global::KOs[lastHit]++; + } + Global::scores[playerNo]--; + Global::deaths[playerNo]++; + } + + Console::Write("Remaining Lives: "); + for(int i=1; i<=4; i++) + { + if(Global::characters[i]!=null) + { + Console::Write((String)"player " + i + (String)"=" + Global::characters[i]->stock + (String)"; "); + } + } + Console::WriteLine(""); + + boolean winResult=Global::checkWinners(playerNo); + for(int i=1; i<=Global::possPlayers; i++) + { + Console::WriteLine((String)"winners[" + i + (String)"]=" + Global::winners[i] + (String)", "); + } + if(winResult) + { + Global::finishGame(); + finishedGame = true; + } + break; + } + } + percent=00; + + if(P2PDataManager::isEnabled()) + { + P2PDataManager::sendScore(this, finishedGame); + } + + if(itemHolding!=null) + { + itemHolding->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemHolding->itemNo)); + delete itemHolding; + itemHolding = null; + } + if(itemWearing!=null) + { + itemWearing->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemWearing->itemNo)); + delete itemWearing; + itemWearing = null; + } + if(itemHatting!=null) + { + itemHatting->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemHatting->itemNo)); + delete itemHatting; + itemHatting = null; + } + if(itemWielding!=null) + { + itemWielding->onDestroy(); + Console::WriteLine((String)"Destroyed Item " + Global::getItemName(itemWielding->itemNo)); + delete itemWielding; + itemWielding = null; + } + + if(canFinalsmash) + { + canFinalsmash = false; + Global::smashBallOnField = false; + } + Rect borders = Global::currentStage->getViewBorders(); + switch(barrierNo) + { + case DIR_LEFT: + ySave=y; + xSave=(float)Global::currentStage->x + (float)borders.left-40; + break; + + case DIR_UP: + xSave=x; + ySave=(float)Global::currentStage->y + (float)borders.top+80; + break; + + case DIR_RIGHT: + ySave=y; + xSave=(float)Global::currentStage->x + (float)borders.right-80; + break; + + case DIR_DOWN: + xSave=x; + ySave=(float)Global::currentStage->y + (float)borders.bottom-80; + break; + } + + reset(); + + offScreenExplosion->x = xSave; + offScreenExplosion->y = ySave; + + offScreenExplosion->setActive(); + + alive = false; + + Console::WriteLine((String)"player " + playerNo + " finished collision event with " + collideSide + "border"); + } + } + + void Player::platformResponse(Platform*collide, byte dir, double multiplier) + { + switch(dir) + { + case DIR_UP: + yvelocity*=(float)multiplier; + //y = (collide->y - (hitbox->height + hitboxPoint[1])); + break; + + case DIR_DOWN: + yvelocity*=(float)multiplier; + //y=(collide->y+collide->height - hitboxPoint[1]); + break; + + case DIR_LEFT: + xvelocity*=(float)multiplier; + //x = (collide->x - (hitbox->width/2)); + break; + + case DIR_RIGHT: + xvelocity*=(float)multiplier; + //x = (collide->x + collide->width + (hitbox->width/2)); + break; + } + } + + //TODO: add actions to these events + + void Player::onPlatformCollide(Platform*collide, byte dir) + { + //Open for implementation, but call super method + if(dir==DIR_UP) + { + switch(collide->getType()) + { + default: + case Platform::TYPE_NORMAL: + checkAttacks(); + if(hurt==2) + { + hurt=1; + if(yvelocity>=0) + { + hurt=0; + } + checkAttacks(); + } + lastHit=0; + if((canDo)&&((jumping && yvelocity>=-1)||(yvelocity>16))&&!landing) + { + if(chargingAttack || chargeSmash>0) + { + destroyCharge(); + } + jumping=false; + landing=true; + switch(playerdir) + { + case 1: + changeAnimation("land_left", FORWARD); + break; + + case 2: + changeAnimation("land_right", FORWARD); + break; + } + } + else if((yvelocity>=0)&&(canDo)&&(!chargingAttack)&&(moveRight==0)&&(moveLeft==0) + &&(!hasgrabbed)&&(!grabbing)&&(chargeSmash==0)&&(!chargingAttack)) + { + if(down) + { + switch(playerdir) + { + case 1: + changeAnimation("crouch_left", NO_CHANGE); + break; + + case 2: + changeAnimation("crouch_right", NO_CHANGE); + break; + } + } + else if(chargeSmash==0 && !chargingAttack) + { + switch(playerdir) + { + case 1: + changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + changeAnimation("stand_right", NO_CHANGE); + break; + } + } + } + break; + + case Platform::TYPE_GOTHROUGH: + canDropThrough=true; + checkAttacks(); + lastHit=0; + if((canDo)&&((jumping && yvelocity>=-1)||(yvelocity>16))&&!landing) + { + jumping=false; + landing=true; + switch(playerdir) + { + case 1: + changeAnimation("land_left", FORWARD); + break; + + case 2: + changeAnimation("land_right", FORWARD); + break; + } + } + else if((yvelocity>0)&&(canDo)&&(!chargingAttack)&&(moveRight==0)&&(moveLeft==0)&&(chargeSmash==0)&&(!chargingAttack)) + { + if(down) + { + dropping=true; + canDropThrough=false; + dropTime=Global::worldTime+4; + } + else + { + switch(playerdir) + { + case 1: + changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + changeAnimation("stand_right", NO_CHANGE); + break; + } + } + } + break; + } + } + } + + void Player::whilePlatformCollide(Platform*collide, byte dir) + { + //Open for implementation, but call super method + switch(collide->getType()) + { + default: + case Platform::TYPE_NORMAL: + if((hurt>0)&&(abs(yvelocity)>6)) + { + if(hurt==2) + { + hurt=1; + canDo=true; + } + yvelocity=-(abs(yvelocity)/2); + switch(playerdir) + { + case 1: + changeAnimation("hurt_flip_left", NO_CHANGE); + break; + + case 2: + changeAnimation("hurt_flip_right", NO_CHANGE); + break; + } + } + else + { + hurt=0; + if(dir==DIR_DOWN) + { + if(yvelocity<0) + { + y+=(ceil(abs(yvelocity))); + } + } + else if(dir == DIR_UP) + { + if(yvelocity>=0 && !hanging) + { + platformResponse(collide,dir,0); + xvelocity = 0; + } + } + else + { + if(!hanging) + { + platformResponse(collide,dir,0); + xvelocity = 0; + } + } + } + break; + + case Platform::TYPE_GOTHROUGH: + if(dir == DIR_UP) + { + if(canDo && hurt==0 && yvelocity>=-0.5f && jumping && !landing) + { + jumping=false; + landing=true; + switch(playerdir) + { + case 1: + changeAnimation("land_left", FORWARD); + break; + + case 2: + changeAnimation("land_right", FORWARD); + break; + } + } + else if((hurt>0)&&(yvelocity>6)) + { + canDo=true; + if(hurt==2) + { + hurt=1; + } + yvelocity=-(abs(yvelocity)/2); + switch(playerdir) + { + case 1: + changeAnimation("hurt_flip_left", NO_CHANGE); + break; + + case 2: + changeAnimation("hurt_flip_right", NO_CHANGE); + break; + } + } + else + { + if((!dropping)&&(yvelocity>=0)) + { + canDo=true; + hurt=0; + this->platformResponse(collide, dir, 0); + xvelocity=0; + } + } + } + break; + } + } + + void Player::finishPlatformCollide(Platform*collide, byte dir) + { + //Open for implementation, but call super method + } + + void Player::onGroundCollide() + { + //Open for implementation, but call super method + if((hurt!=2)&&(!hanging)&&(!jumping)&&(!dropping)) + { + onGround=true; + doubleJump=0; + up=false; + bUp=false; + } + } + + void Player::whileGroundColliding() + { + //Open for implementation, but call super method + if((hurt!=2)&&(!hanging)&&(!jumping)&&(!dropping)) + { + onGround=true; + doubleJump=0; + up=false; + bUp=false; + } + } + + void Player::finishGroundCollide() + { + //Open for implementation, but call super method + onGround=false; + doubleJump=1; + checkAttacks(); + if((!hanging)&&(yvelocity>0)&&(canDo)) + { + if(moveLeft>0) + { + changeAnimation("fall_left", NO_CHANGE); + } + else if(moveRight>0) + { + changeAnimation("fall_right", NO_CHANGE); + } + } + } + + void Player::onHang(HangPoint*collide) + { + //Open for implementation, but call super method + switch(collide->getHangSide()) + { + case 1: + if((playerdir==2)&&(collide->hanging==0)&&(!onGround)) + { + collide->hanging=playerNo; + moveLeft=0; + moveRight=0; + setToDefaultValues(); + jumping=false; + landing=false; + hanging=true; + onGround = false; + bUp=false; + canDo=true; + doubleJump=1; + changeAnimation("hang_right", NO_CHANGE); + x=(collide->x+(collide->width/2))-hangPoint.x; + y=collide->y+((height/2)-hangPoint.y); + if(attacksPriority!=7) + { + attacksHolder=-1; + attacksPriority=0; + } + yVel=0; + xVel=0; + xvelocity=0; + yvelocity=0; + } + break; + + case 2: + if((playerdir==1)&&(collide->hanging==0)&&(!onGround)) + { + collide->hanging=playerNo; + moveLeft=0; + moveRight=0; + setToDefaultValues(); + jumping=false; + landing=false; + hanging=true; + onGround = false; + bUp=false; + canDo=true; + doubleJump=1; + changeAnimation("hang_left", NO_CHANGE); + x=collide->x+(collide->width/2)+hangPoint.x; + y=collide->y+((height/2)-hangPoint.y); + if(attacksPriority!=7) + { + attacksHolder=-1; + attacksPriority=0; + } + yVel=0; + xVel=0; + xvelocity=0; + yvelocity=0; + } + break; + } + } + + void Player::whileHanging(HangPoint*collide) + { + onGround = false; + /*if(hanging) + { + xvelocity = 0; + yvelocity = 0; + switch(playerdir) + { + case LEFT: + changeAnimation("hang_left",NO_CHANGE); + break; + + case RIGHT: + changeAnimation("hang_right",NO_CHANGE); + break; + } + }*/ + } + + void Player::finishHang(HangPoint*collide) + { + hanging=false; + //noFollow=0; + canDo=true; + if(collide->hanging==playerNo) + { + collide->hanging=0; + } + } + + void Player::checkPlayerCollision(Player*playr) + { + byte dir = isPlayerColliding(playr); + if(dir>0) + { + if(playerCollisions.isColliding(playr->playerNo)) + { + if(attacksHolder>-1 || attacksPriority>0) + { + switch(dir) + { + case DIR_UP: + if(isHittableUp(playr)) + { + whilePlayerHitting(playr,dir); + } + break; + + case DIR_LEFT: + if(isHittableLeft(playr)) + { + whilePlayerHitting(playr,dir); + } + break; + + case DIR_RIGHT: + if(isHittableRight(playr)) + { + whilePlayerHitting(playr,dir); + } + break; + + case DIR_DOWN: + if(isHittableDown(playr)) + { + whilePlayerHitting(playr,dir); + } + break; + } + } + else + { + playerCollisions.removeCollision(playr->playerNo); + finishPlayerHit(playr); + } + } + else + { + if(attacksHolder>-1 || attacksPriority>0) + { + playerCollisions.addCollision(playr->playerNo); + switch(dir) + { + case DIR_UP: + if(isHittableUp(playr)) + { + playerHitHandler(playr,dir); + } + break; + + case DIR_LEFT: + if(isHittableLeft(playr)) + { + playerHitHandler(playr,dir); + } + break; + + case DIR_RIGHT: + if(isHittableRight(playr)) + { + playerHitHandler(playr,dir); + } + break; + + case DIR_DOWN: + if(isHittableDown(playr)) + { + playerHitHandler(playr,dir); + } + break; + } + } + else + { + playerCollisions.removeCollision(playr->playerNo); + finishPlayerHit(playr); + } + } + whilePlayerColliding(playr,dir); + } + else if(playerCollisions.isColliding(playr->playerNo)) + { + playerCollisions.removeCollision(playr->playerNo); + finishPlayerHit(playr); + } + + if(Actor::rectsColliding(playr)) + { + if(playerRectCollisions.isColliding(playr->playerNo)) + { + if(attacksHolder>-1 || attacksPriority>0) + { + byte dir2 = getDir2(this->x, this->y, playr->x, playr->y); + switch(dir2) + { + case DIR_UP: + if(isHittableUp(playr)) + { + whilePlayerRectHitting(playr,dir2); + } + break; + + case DIR_LEFT: + if(isHittableLeft(playr)) + { + whilePlayerRectHitting(playr,dir2); + } + break; + + case DIR_RIGHT: + if(isHittableRight(playr)) + { + whilePlayerRectHitting(playr,dir2); + } + break; + + case DIR_DOWN: + if(isHittableDown(playr)) + { + whilePlayerRectHitting(playr,dir2); + } + break; + } + } + else + { + playerRectCollisions.removeCollision(playr->playerNo); + finishPlayerRectHit(playr); + } + } + else + { + if(attacksHolder>-1 || attacksPriority>0) + { + playerRectCollisions.addCollision(playr->playerNo); + byte dir2 = getDir2(this->x, this->y, playr->x, playr->y); + switch(dir2) + { + case DIR_UP: + if(isHittableUp(playr)) + { + onPlayerRectHit(playr,dir2); + } + break; + + case DIR_LEFT: + if(isHittableLeft(playr)) + { + onPlayerRectHit(playr,dir2); + } + break; + + case DIR_RIGHT: + if(isHittableRight(playr)) + { + onPlayerRectHit(playr,dir2); + } + break; + + case DIR_DOWN: + if(isHittableDown(playr)) + { + onPlayerRectHit(playr,dir2); + } + break; + } + } + else + { + playerRectCollisions.removeCollision(playr->playerNo); + finishPlayerRectHit(playr); + } + } + } + else if(playerRectCollisions.isColliding(playr->playerNo)) + { + playerRectCollisions.removeCollision(playr->playerNo); + finishPlayerRectHit(playr); + } + + if(hitboxRectsColliding(playr->getHitbox())) + { + if(!(attacksHolder>-1 || attacksPriority>0)) + { + if(playr->x < x) + { + playerColliding(playr,DIR_LEFT); + } + else + { + playerColliding(playr,DIR_RIGHT); + } + } + } + } + + void Player::playerColliding(Player*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + hitHandlerLeft(collide); + break; + + case DIR_RIGHT: + hitHandlerRight(collide); + break; + } + } + + void Player::playerHitHandler(Player*collide, byte dir) + { + if(attacksHolder>-1) + { + AttackManager::AttackInfo*nfo = attackMgr.getAttackInfo(dir, attacksHolder, playerdir); + if(nfo!=null) + { + causeDamage(collide,nfo->damage); + causeHurtLaunch(collide,nfo->xDir,nfo->xAmount,nfo->xMult, nfo->yDir,nfo->yAmount,nfo->yMult); + if(collide->xvelocity>0) + { + causeHurt(collide, LEFT, nfo->delayTime); + } + else if(collide->xvelocity<0) + { + causeHurt(collide, RIGHT,nfo->delayTime); + } + else + { + causeHurt(collide, collide->playerdir,nfo->delayTime); + } + } + } + onPlayerHit(collide,dir); + } + + void Player::whilePlayerColliding(Player*collide, byte dir) + { + //Open for implementation + } + + void Player::onPlayerHit(Player*collide, byte dir) + { + //Open for implementation + } + + void Player::whilePlayerHitting(Player*collide, byte dir) + { + //Open for implementation + } + + void Player::finishPlayerHit(Player*collide) + { + //Open for implementation + } + + void Player::onPlayerRectHit(Player*collide, byte dir) + { + //Open for implementation + } + + void Player::whilePlayerRectHitting(Player*collide, byte dir) + { + //Open for implementation + } + + void Player::finishPlayerRectHit(Player*collide) + { + //Open for implementation + } + + boolean Player::onPlayerDeflectDamage(Player*collide, int damage) + { + //Open for implementation + return false; + } + + boolean Player::onPlayerDeflectLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + //Open for implementation + return false; + } + + boolean Player::onItemDeflectDamage(Item*collide, int damage) + { + //Open for implementation + return false; + } + + boolean Player::onItemDeflectLaunch(Item*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + //Open for implementation + return false; + } + + boolean Player::onProjectileDeflectDamage(Projectile*collide, int damage) + { + //Open for implementation + return false; + } + + boolean Player::onProjectileDeflectLaunch(Projectile*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + //Open for implementation + return false; + } + + void Player::onBorderCollide(byte dir) + { + barrierCollide(dir); + } + + void Player::addAttackInfo(byte dir, int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult) + { + switch(dir) + { + case DIR_LEFT: + attackMgr.addLeftAttackInfo(attackNo, playerdir, damage, delayTime, xDir, xAmount, xMult, yDir, yAmount, yMult); + break; + + case DIR_RIGHT: + attackMgr.addRightAttackInfo(attackNo, playerdir, damage, delayTime, xDir, xAmount, xMult, yDir, yAmount, yMult); + break; + + case DIR_UP: + attackMgr.addUpAttackInfo(attackNo, playerdir, damage, delayTime, xDir, xAmount, xMult, yDir, yAmount, yMult); + break; + + case DIR_DOWN: + attackMgr.addDownAttackInfo(attackNo, playerdir, damage, delayTime, xDir, xAmount, xMult, yDir, yAmount, yMult); + break; + } + } + + void Player::stand() + { + /*checkAttacks(); + if(canDo && !jumping) + { + moveLeft=0; + moveRight=0; + switch(playerdir) + { + case 1: + changeAnimation("stand_left", NO_CHANGE); + break; + + case 2: + changeAnimation("stand_right", NO_CHANGE); + break; + } + }*/ + if(attacksPriority!=7) + { + animFinish(); + } + } + + void Player::switchDirection() + { + if(playerdir == LEFT) + { + playerdir = RIGHT; + String animName = getAnimName(); + String suffix = animName.substring(animName.length()-5, animName.length()); + if(suffix.equals("_left")) + { + String prefix = animName.substring(0, animName.length()-5); + changeAnimation(prefix + "_right", FORWARD); + } + } + else if(playerdir == RIGHT) + { + playerdir = LEFT; + String animName = getAnimName(); + String suffix = animName.substring(animName.length()-6, animName.length()); + if(suffix.equals("_right")) + { + String prefix = animName.substring(0, animName.length()-6); + changeAnimation(prefix + "_left", FORWARD); + } + } + } + + void Player::moveDown() + { + hurt=0; + down=true; + upKey=false; + if((onGround)&&(canDo)) + { + switch(playerdir) + { + case 1: + changeAnimation("crouch_left", NO_CHANGE); + break; + + case 2: + changeAnimation("crouch_right", NO_CHANGE); + break; + } + } + if(hanging) + { + hanging=false; + onGround = false; + switch(playerdir) + { + case 1: + changeAnimation("fall_left", NO_CHANGE); + break; + + case 2: + changeAnimation("fall_right", NO_CHANGE); + break; + } + } + if(canDropThrough) + { + dropping=true; + canDropThrough=false; + yvelocity+=2; + dropTime=Global::worldTime+4; + } + } + + void Player::jump() + { + jump(5,5); + } + + void Player::jump(float dist1, float dist2) + { + if(!chargingAttack && chargeSmash==0 && CanDo()) + { + if((hurt==2)&&(onGround)) + { + hurt=0; + animFinish(); + } + else if(hurt==1) + { + hurt=0; + } + up=true; + upKey=true; + if(hanging) + { + hanging=false; + climbUp(); + } + else if(onGround) + { + jumping=true; + yvelocity=-dist1; + y-=1; + switch(playerdir) + { + case 1: + changeAnimation("jump_left", FORWARD); + break; + + case 2: + changeAnimation("jump_right", FORWARD); + break; + } + doubleJump=1; + } + else + { + if(doubleJump==1) + { + jumping = true; + yvelocity=-dist2; + doubleJump=0; + switch(playerdir) + { + case 1: + changeAnimation("jump2_left", FORWARD); + break; + + case 2: + changeAnimation("jump2_right", FORWARD); + break; + } + } + } + } + } + + void Player::climbUp() + { + if((hurt==2)&&(onGround)) + { + hurt=0; + animFinish(); + } + up=true; + hanging=false; + y-=((float)hitbox->height + ((float)height*0.26f)); + if(doubleJump==1) + { + yvelocity=-2; + doubleJump=0; + switch(playerdir) + { + case 1: + x-=(hitbox->width); + changeAnimation("jump2_left", FORWARD); + break; + + case 2: + x+=(hitbox->width); + changeAnimation("jump2_right", FORWARD); + break; + } + } + onGround = false; + } + + void Player::climbUpAttack() + { + climbUp(); + attackA(); + } + + void Player::onFinishCharge() + { + // + } + + void Player::doChargingAttack(byte button) + { + // + } + + /** + * Standard attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackA() + { + // + } + + /** + * Standard side attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackSideA() + { + // + } + + /** + * Standard up attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackUpA() + { + // + } + + /** + * Standard down attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackDownA() + { + // + } + + /** + * Special attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackB() + { + // + } + + /** + * Special side attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackSideB() + { + // + } + + /** + * Special up attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackUpB() + { + // + } + + /** + * Special down attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + */ + void Player::attackDownB() + { + // + } + + /** + * Smash side attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + *

+ * @param type determines whether the smash attack is {@link #STEP_CHARGE charging}, {@link #STEP_GO going}, or {@link #STEP_FINISH finishing}. + */ + void Player::attackSideSmash(byte type) + { + // + } + + /** + * Smash up attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + *

+ * @param type determines whether the smash attack is {@link #STEP_CHARGE charging}, {@link #STEP_GO going}, or {@link #STEP_FINISH finishing}. + */ + void Player::attackUpSmash(byte type) + { + // + } + + /** + * Smash down attack. Should be overridden. {@link AttackTemplates} class can be used for basic attacks. + *

+ * @param type determines whether the smash attack is {@link #STEP_CHARGE charging}, {@link #STEP_GO going}, or {@link #STEP_FINISH finishing}. + */ + void Player::attackDownSmash(byte type) + { + // + } + + /** + * Final Smash attack. Should be overridden. + * It is recommended to write this method from scratch. + */ + void Player::attackFinalSmash() + { + // + } +} \ No newline at end of file diff --git a/SmashBros/Player.h b/SmashBros/Player.h new file mode 100755 index 0000000..f779890 --- /dev/null +++ b/SmashBros/Player.h @@ -0,0 +1,426 @@ +#include "GameElement.h" +#include "OffScreenExplode.h" +#include "Chargebar.h" +#include "Platform.h" +#include "HangPoint.h" +#include "CollisionManager.h" +#include "AttackManager.h" +#include "AttackRandomizer.h" +#include "HitBox.h" +#include "Projectile.h" +#include "SmashForwards.h" + +#pragma once + +namespace SmashBros +{ + class Player : public GameElement + { + friend class AttackRandomizer; + friend class AttackTemplates; + friend class Chargebar; + friend class Controls; + friend class Global; + friend class P2PDataManager; + friend class Projectile; + friend class ProjectileManager; + friend class Stage; + private: + static const float jumpXBoost; + + ArrayList files; + + byte aiType; + boolean firstUpdate; + Actor*indicator; + float indicX,indicY; + boolean setIndic; + + OffScreenExplode*offScreenExplosion; + + String folderPath; + + Vector2i hangPoint; + + Color playerColor; + + int stock; + + Chargebar*chargebar; + + boolean prevCollidePlatform[8]; + boolean currentCollidePlatform[8]; + SmashBros::Platform*currentCollidePlatformActor[8]; + SmashBros::Platform*lastGroundPlat; + float lastGroundX; + boolean groundCollidedFrame; + HangPoint*currentHangPoint; + ArrayList collideQueue; + + CollisionManager playerCollisions; + CollisionManager playerRectCollisions; + AttackManager attackMgr; + AttackRandomizer randomizer; + + int itemCollidingIndex; + friend class Item; + friend class ItemManager; + Item*itemHolding; + Item*itemWearing; + Item*itemHatting; + Item*itemWielding; + float itemOffsetX; + float itemOffsetY; + + boolean hangColliding; + boolean prevHangColliding; + boolean groundColliding; + boolean prevGroundColliding; + + boolean groundCheck; + + byte hurtFrame; + + HitBox*hitbox; + RectangleF hitboxPoint; + + boolean up; + + long runTime; + long smashTime; + long moveTime; + byte buttondir; + + byte playerNo; + byte team; + int charNo; + boolean alive; + byte lastHit; + int percent; + friend class HUD; + boolean onGround; + boolean jumping; + byte hurt; + long hurtTime; + boolean invincible; + boolean deflectState; + + boolean dropping; + boolean canDropThrough; + long dropTime; + + boolean canDo; + + boolean cpu; + Player*currentEnemy; + long comboTime; + byte standardCombo; + + boolean grabbed; + boolean hasgrabbed; + boolean grabbing; + + boolean canFinalsmash; + boolean hanging; + + virtual void whenCreated(); + + void reset(); + + void updateHitbox(); + void setIndicatorColor(); + + void setInitialCPUTarget(); + void updateCPUTarget(); + boolean checkbUpRecovery(); + void recoverJump(); + boolean checkTrappedUnder(Platform*plat); + boolean checkTrappedUnder(GameEngine::Rectangle plat); + boolean checkTrappedOver(GameEngine::Rectangle plat); + boolean isObstacle(Platform*plat); + float getMinAmountTrappedUnder(Platform*plat); + Vector2f findRecoveryTarget(); + void getToRecoveryTarget(Vector2f target); + void goInDirection(byte dir); + boolean checkObstacleDir(RectangleF obst, byte dir); + boolean checkDirSemicircle(byte dir, byte dirCmp); + boolean checkDirRelation(byte dir, byte cmp1, byte cmp2); + double getClosestDistanceUnSqr(Vector2f self, GameEngine::Rectangle rect); + Vector2f getClosestPoint(GameEngine::Rectangle rect, byte dir); + boolean getDirSeparating(Vector2f target, Rectangle rect); + GameEngine::Rectangle getRectSeparating(Vector2f target); + void followEnemy(boolean canAttack, int level); + boolean checkEnemyHang(); + boolean recover(int level); + + void stopAI(int level); + void walkAI(int level); + void runAI(int level); + void jumpAI(int level); + void followAI(int level); + void normalAI(int level); + void cpuAI(byte type, int level); + + void hitHandlerRight(Player*collide); + void hitHandlerLeft(Player*collide); + boolean isHittableRight(Player*collide); + boolean isHittableLeft(Player*collide); + boolean isHittableUp(Player*collide); + boolean isHittableDown(Player*collide); + + byte isPlayerColliding(Player*collide); + byte solidPlatformCollision(Platform*collide); + void platformCollision(Platform*collide, byte dir); + + void barrierCollide(byte barrierNo); + + void whilePlatformCollide(Platform*collide, byte dir); + void whileGroundColliding(); + void finishGroundCollide(); + void onHang(HangPoint*collide); + void whileHanging(HangPoint*collide); + void finishHang(HangPoint*collide); + + void checkPlayerCollision(Player*playr); + void playerColliding(Player*collide, byte dir); + void playerHitHandler(Player*collide, byte dir); + + void onBorderCollide(byte dir); + + void handleAddP2PData(DataVoid&data); + void handleSetP2PData(byte*&data); + + protected: + byte moveLeft; + byte moveRight; + + boolean upKey; + boolean down; + + String name; + + byte playerdir; + double weight; + boolean landing; + + int hitAmount; + long attackTime; + + int attacksHolder; + double attacksPriority; + + int chargeSmash; + + int smashPower; + boolean chargingAttack; + + boolean bUp; + byte doubleJump; + + float walkSpeed; + float runSpeed; + float fallWalk; + float fallRun; + int flyTime; + int flyRunTime; + float recoverAmount; + float recoverRunAmount; + + void addFile(String file); + void loadFile(String file); + + void setOnGround(boolean toggle); + void setItemOffset(float x1, float y1); + + void setCantDo(); + void setHanging(boolean toggle); + void setJumping(boolean toggle); + void finishDeflect(); + void resetAttackCollisions(); + void setHitbox(float x1, float y1, int w, int h); + void showHitboxWireframe(boolean toggle); + void setHitboxColor(Color c); + void setFolderPath(String path); + + void addTwoSidedAnimation(String name, String file, int fps, int rows, int cols); + void addSingleAnimation(String name, String file, int fps, int rows, int cols); + + void setHangPoint(int x1, int y1); + void destroyCharge(); + void animFinish(); + + void updateGravity(); + void updateFrame(); + void updateMovement(); + void updateHanging(); + void updateHurt(); + void updateDrop(); + void updateAI(); + + void createProjectile(Projectile*p); + + void causeDamage(Player*collide, int amount); + void causeHurtLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + void causeHurt(Player*collide, byte dir, int time); + + boolean checkItemUse(); + boolean checkItemUseSide(); + boolean checkItemUseSmash(byte type); + void discardItem(); + + void platformResponse(Platform*collide, byte dir, double multiplier); + + void addAttackInfo(byte dir, int attackNo, byte playerdir, int damage, int delayTime, int xDir,float xAmount,float xMult,int yDir,float yAmount,float yMult); + + void jump(float dist1, float dist2); + void climbUp(); + void climbUpAttack(); + + public: + static const byte TEAM_RED = 1; + static const byte TEAM_BLUE = 2; + static const byte TEAM_GREEN = 3; + static const byte TEAM_YELLOW = 4; + + static const byte LEFT = 1; + static const byte RIGHT = 2; + + static const byte STEP_CHARGE = 1; + static const byte STEP_GO = 2; + static const byte STEP_FINISH = 3; + + static const byte ATTACK_A = 1; + static const byte ATTACK_SIDEA = 2; + static const byte ATTACK_UPA = 3; + static const byte ATTACK_DOWNA = 4; + static const byte ATTACK_B = 5; + static const byte ATTACK_SIDEB = 6; + static const byte ATTACK_UPB = 7; + static const byte ATTACK_DOWNB = 8; + static const byte ATTACK_SIDESMASH = 9; + static const byte ATTACK_UPSMASH = 10; + static const byte ATTACK_DOWNSMASH = 11; + static const byte ATTACK_FINALSMASH = 12; + + static const byte ATTACKTYPE_MELEE = 1; + static const byte ATTACKTYPE_UPMELEE = 2; + static const byte ATTACKTYPE_DOWNMELEE = 3; + static const byte ATTACKTYPE_STRONGMELEE = 4; + static const byte ATTACKTYPE_SIDEMOVE = 5; + static const byte ATTACKTYPE_UPMOVE = 6; + static const byte ATTACKTYPE_DOWNMOVE = 7; + static const byte ATTACKTYPE_PROJECTILE = 8; + static const byte ATTACKTYPE_DEFENSIVE = 9; + + static const byte AI_STOP = 1; + static const byte AI_WALK = 2; + static const byte AI_RUN = 3; + static const byte AI_JUMP = 4; + static const byte AI_NORMAL = 5; + static const byte AI_FOLLOW = 6; + + float xVel; + float yVel; + + Player(float x1, float y1, byte playerNo, byte team); + virtual ~Player(); + + virtual void onCreate(); + virtual void Load(); + virtual void LoadAttackTypes(); + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + virtual void onAnimationFinish(const String&n); + virtual void setToDefaultValues(); + virtual boolean checkIfAble(); + virtual void onDestroy(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void onPlatformCollide(Platform*collide, byte dir); + virtual void finishPlatformCollide(Platform*collide, byte dir); + virtual void onGroundCollide(); + virtual void whilePlayerColliding(Player*collide, byte dir); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void whilePlayerHitting(Player*collide, byte dir); + virtual void finishPlayerHit(Player*collide); + virtual void onPlayerRectHit(Player*collide, byte dir); + virtual void whilePlayerRectHitting(Player*collide, byte dir); + virtual void finishPlayerRectHit(Player*collide); + + virtual boolean onPlayerDeflectDamage(Player*collide, int damage); + virtual boolean onPlayerDeflectLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + virtual boolean onItemDeflectDamage(Item*collide, int damage); + virtual boolean onItemDeflectLaunch(Item*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + virtual boolean onProjectileDeflectDamage(Projectile*collide, int damage); + virtual boolean onProjectileDeflectLaunch(Projectile*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + + virtual void onFinishCharge(); + virtual void doChargingAttack(byte button); + + virtual void attackA(); + virtual void attackSideA(); + virtual void attackUpA(); + virtual void attackDownA(); + virtual void attackB(); + virtual void attackSideB(); + virtual void attackUpB(); + virtual void attackDownB(); + virtual void attackSideSmash(byte type); + virtual void attackUpSmash(byte type); + virtual void attackDownSmash(byte type); + virtual void attackFinalSmash(); + + void respawn(); + void Unload(); + void addAIAttackType(byte attack, byte attacktype, float probability, boolean charge = false); + + void addAnimation(Animation*a); + void setColor(Color c); + + boolean isCPU(); + boolean isAlive(); + boolean isHurt(); + boolean isHoldingItem(); + boolean isWearingItem(); + boolean isHattingItem(); + boolean isWieldingItem(); + boolean isInvincible(); + String getName(); + int getPercent(); + int getLastHitIndex(); + int getAttacksHolder(); + double getAttacksPriority(); + boolean isOnGround(); + byte getPlayerDir(); + byte getDirFacing(); + byte getTeam(); + boolean canFinalSmash(); + void setPlayerDir(byte dir); + byte getPlayerNo(); + boolean CanDo(); + boolean isGrabbed(); + int getStock(); + boolean hasGrabbed(); + boolean isGrabbing(); + boolean isJumping(); + boolean isHanging(); + int getSmashPower(); + byte getMoveLeft(); + byte getMoveRight(); + WireframeActor*getHitbox(); + void setIndicatorOffset(float x1, float y1); + String getFolderPath(); + void checkAttacks(); + boolean pickUpItem(Item*item); + + boolean hitboxRectsColliding(HitBox*collide); + boolean hitboxRectsColliding(WireframeActor*collide); + boolean hitboxRectsColliding(Actor*collide); + + void stand(); + void switchDirection(); + void moveDown(); + virtual void jump(); + }; +} \ No newline at end of file diff --git a/SmashBros/PoisonMushroom.cpp b/SmashBros/PoisonMushroom.cpp new file mode 100755 index 0000000..cff3251 --- /dev/null +++ b/SmashBros/PoisonMushroom.cpp @@ -0,0 +1,122 @@ +#include "PoisonMushroom.h" +#include "Global.h" + +namespace SmashBros +{ + PoisonMushroom::PoisonMushroom(float x1, float y1) : Item(x1, y1, 160, TYPE_WIELD) + { + itemNo = Global::ITEM_POISONMUSHROOM; + + weight = 0.2f; + + moving = false; + active = false; + scale = 1; + finishTime = 0; + + dir = (byte)((GameEngine::random()*2)+1); + + addAnimation(new Animation("normal", 1, "Images/Game/Items/Mushroom/poison_mushroom.png")); + + changeAnimation("normal",FORWARD); + } + + PoisonMushroom::~PoisonMushroom() + { + // + } + + boolean PoisonMushroom::canPickUp() + { + return false; + } + + void PoisonMushroom::onPlayerCollide(Player*collide) + { + if(!active) + { + if(collide->pickUpItem(this)) + { + scale = collide->Scale; + + int oldHeight = collide->height; + + collide->Scale*=0.5; + + int newHeight = (int)(collide->height*0.5); + + int dif = newHeight - oldHeight; + collide->y-=dif/2; + + finishTime = Global::getWorldTime() + 100; + + moving = false; + active = true; + + setVisible(false); + } + } + } + + void PoisonMushroom::onPlatformCollide(Platform*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + this->dir = 1; + break; + + case DIR_RIGHT: + this->dir = 2; + break; + } + } + + void PoisonMushroom::onGroundCollide() + { + moving = true; + } + + void PoisonMushroom::onDestroy() + { + if(active) + { + Player*playr = Global::getPlayerActor(getItemHolder()); + playr->Scale = scale; + } + } + + void PoisonMushroom::Update(long gameTime) + { + Item::Update(gameTime); + if(active) + { + if(finishTime<=Global::getWorldTime()) + { + destroy(); + } + } + if(isHeld()) + { + Player*playr = getPlayer(); + x = playr->x; + y = playr->y; + } + else + { + if(moving) + { + switch(dir) + { + case 1: + x-=2; + break; + + case 2: + x+=2; + break; + } + } + } + } +} \ No newline at end of file diff --git a/SmashBros/PoisonMushroom.h b/SmashBros/PoisonMushroom.h new file mode 100755 index 0000000..8a09b8a --- /dev/null +++ b/SmashBros/PoisonMushroom.h @@ -0,0 +1,28 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class PoisonMushroom : public Item + { + private: + boolean moving; + float scale; + long finishTime; + boolean active; + byte dir; + + public: + PoisonMushroom(float x1, float y1); + virtual ~PoisonMushroom(); + + virtual void Update(long gameTime); + + virtual boolean canPickUp(); + virtual void onPlayerCollide(Player*collide); + virtual void onPlatformCollide(Platform*collide, byte dir); + virtual void onGroundCollide(); + virtual void onDestroy(); + }; +} \ No newline at end of file diff --git a/SmashBros/Preferences.cpp b/SmashBros/Preferences.cpp new file mode 100755 index 0000000..487bb6e --- /dev/null +++ b/SmashBros/Preferences.cpp @@ -0,0 +1,250 @@ +#include "Preferences.h" +#include "Game.h" +#include "Controls.h" + +namespace SmashBros +{ + bool Preferences::menuMusic = true; + bool Preferences::menuSoundFx = true; + bool Preferences::ingameMusic = true; + + bool Preferences::highfps = false; + + const String Preferences::version = "2.1"; + + bool Preferences::newVersion = false; + + bool Preferences::debuglog = false; + + String Preferences::versionMessage = (String)"Welcome to iSSB v2.1, also known as Super Smash Bros. Mobile! This is the first " + + "update to include brand new Bluetooth support! This means that you can play wirelessly against " + + "your friends. Look forward to more updates in the future!"; + + PrefManager Preferences::prefMgr = PrefManager(); + + void Preferences::init() + { + prefMgr.addValue("version",0); + prefMgr.addValue("debuglog",debuglog); + prefMgr.addValue("menuMusic",menuMusic); + prefMgr.addValue("menuSoundFx",menuSoundFx); + prefMgr.addValue("ingameMusic",ingameMusic); + prefMgr.addValue("highfps",highfps); + + prefMgr.addValue("controls_joystick", Controls::joystickEnabled); + + prefMgr.addValue("controls_pause", Controls::controls[0][Controls::BUTTON_PAUSE]); + + prefMgr.addValue("controls_p1_up", Controls::controls[1][Controls::BUTTON_UP]); + prefMgr.addValue("controls_p1_down", Controls::controls[1][Controls::BUTTON_DOWN]); + prefMgr.addValue("controls_p1_left", Controls::controls[1][Controls::BUTTON_LEFT]); + prefMgr.addValue("controls_p1_right", Controls::controls[1][Controls::BUTTON_RIGHT]); + prefMgr.addValue("controls_p1_jump", Controls::controls[1][Controls::BUTTON_JUMP]); + prefMgr.addValue("controls_p1_standard", Controls::controls[1][Controls::BUTTON_STANDARD]); + prefMgr.addValue("controls_p1_special", Controls::controls[1][Controls::BUTTON_SPECIAL]); + prefMgr.addValue("controls_p1_grab", Controls::controls[1][Controls::BUTTON_GRAB]); + + prefMgr.addValue("controls_p2_up", Controls::controls[2][Controls::BUTTON_UP]); + prefMgr.addValue("controls_p2_down", Controls::controls[2][Controls::BUTTON_DOWN]); + prefMgr.addValue("controls_p2_left", Controls::controls[2][Controls::BUTTON_LEFT]); + prefMgr.addValue("controls_p2_right", Controls::controls[2][Controls::BUTTON_RIGHT]); + prefMgr.addValue("controls_p2_jump", Controls::controls[2][Controls::BUTTON_JUMP]); + prefMgr.addValue("controls_p2_standard", Controls::controls[2][Controls::BUTTON_STANDARD]); + prefMgr.addValue("controls_p2_special", Controls::controls[2][Controls::BUTTON_SPECIAL]); + prefMgr.addValue("controls_p2_grab", Controls::controls[2][Controls::BUTTON_GRAB]); + + prefMgr.addValue("controls_p3_up", Controls::controls[3][Controls::BUTTON_UP]); + prefMgr.addValue("controls_p3_down", Controls::controls[3][Controls::BUTTON_DOWN]); + prefMgr.addValue("controls_p3_left", Controls::controls[3][Controls::BUTTON_LEFT]); + prefMgr.addValue("controls_p3_right", Controls::controls[3][Controls::BUTTON_RIGHT]); + prefMgr.addValue("controls_p3_jump", Controls::controls[3][Controls::BUTTON_JUMP]); + prefMgr.addValue("controls_p3_standard", Controls::controls[3][Controls::BUTTON_STANDARD]); + prefMgr.addValue("controls_p3_special", Controls::controls[3][Controls::BUTTON_SPECIAL]); + prefMgr.addValue("controls_p3_grab", Controls::controls[3][Controls::BUTTON_GRAB]); + + prefMgr.addValue("controls_p4_up", Controls::controls[4][Controls::BUTTON_UP]); + prefMgr.addValue("controls_p4_down", Controls::controls[4][Controls::BUTTON_DOWN]); + prefMgr.addValue("controls_p4_left", Controls::controls[4][Controls::BUTTON_LEFT]); + prefMgr.addValue("controls_p4_right", Controls::controls[4][Controls::BUTTON_RIGHT]); + prefMgr.addValue("controls_p4_jump", Controls::controls[4][Controls::BUTTON_JUMP]); + prefMgr.addValue("controls_p4_standard", Controls::controls[4][Controls::BUTTON_STANDARD]); + prefMgr.addValue("controls_p4_special", Controls::controls[4][Controls::BUTTON_SPECIAL]); + prefMgr.addValue("controls_p4_grab", Controls::controls[4][Controls::BUTTON_GRAB]); + + for(int i=0; iRun(Application::ORIENTATION_LANDSCAPE, false); + delete game; + exit(0); + return 0; +} \ No newline at end of file diff --git a/SmashBros/Projectile.cpp b/SmashBros/Projectile.cpp new file mode 100755 index 0000000..8aa0d40 --- /dev/null +++ b/SmashBros/Projectile.cpp @@ -0,0 +1,1051 @@ +#include "Projectile.h" +#include "Global.h" +#include "Player.h" +#include "Platform.h" +#include "ProjectileManager.h" +#include "Item.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + int Projectile::nextID = 0; + + Projectile::Projectile(byte playerNo, float x1, float y1) : GameElement(x1,y1) + { + this->id = nextID; + nextID++; + if(nextID == INTEGER_MAX) + { + nextID = 0; + } + while(!ProjectileManager::checkIDAvailable(nextID)) + { + nextID++; + if(nextID == INTEGER_MAX) + { + nextID = 0; + } + } + dead = false; + itemdir = 0; + team = 0; + solid = false; + solidOwner = true; + this->playerNo = playerNo; + playersColliding = CollisionManager(); + Player*owner = Global::getPlayerActor(playerNo); + itemdir=owner->playerdir; + team=owner->getTeam(); + layer = LAYER_MIDDLEUPPER; + + platform = new Platform(Platform::TYPE_GOTHROUGH, x, y, 1, 1); + } + + Projectile::~Projectile() + { + if(!dead && P2PDataManager::isEnabled()) + { + ProjectileManager::destroyedProjectiles.add(this->id); + } + dead = true; + delete platform; + } + + int Projectile::getID() + { + return this->id; + } + + void Projectile::setNextID(int projID) + { + nextID = projID; + } + + //x, y, animIndex, frame, bools, layer, playerNo, team + //4, 4, 4, 4, 1 1 1 1 = 20 + void Projectile::handleAddP2PData(DataVoid&data) + { + int frame = getAnimation()->getCurrentFrame(); + int animIndex = getAnimIndex(); + Bitset bools; + //visible + if(isVisible()) + { + bools.set(0, true); + } + else + { + bools.set(0, false); + } + byte boolsByte = bools.getByte(); + + data.add(&x, sizeof(x)); + data.add(&y, sizeof(y)); + data.add(&animIndex, sizeof(animIndex)); + data.add(&frame, sizeof(frame)); + data.add(&boolsByte, sizeof(boolsByte)); + data.add(&layer, sizeof(layer)); + data.add(&playerNo, sizeof(playerNo)); + data.add(&team, sizeof(team)); + + DataVoid newData; + addP2PData(newData); + data.add(newData); + } + + void Projectile::handleSetP2PData(byte*&data) + { + //x + x = DataVoid::toFloat(data); + data += sizeof(float); + + //y + y = DataVoid::toFloat(data); + data += sizeof(float); + + //animIndex + int animIndex = DataVoid::toInt(data); + changeAnimation(animIndex, STOPPED); + data += sizeof(int); + + //frame + int frame = DataVoid::toInt(data); + getAnimation()->setCurrentFrame(frame); + data += sizeof(int); + + //bools + byte boolsByte = data[0]; + Bitset bools(boolsByte); + //visibility + if(bools.get(0)) + { + setVisible(true); + } + else + { + setVisible(false); + } + data += sizeof(byte); + + //layer + layer = data[0]; + data += sizeof(byte); + + //playerNo + playerNo = data[0]; + data += sizeof(byte); + + //team + team = data[0]; + data += sizeof(byte); + + setP2PData(data); + } + + void Projectile::addP2PData(DataVoid&data) + { + //Open for implementation + } + + void Projectile::setP2PData(byte*&data) + { + //Open for implementation + } + + void Projectile::Update(long gameTime) + { + Rect borders = Global::currentStage->getBorders(); + int left = Global::currentStage->x + borders.left; + int top = Global::currentStage->y + borders.top; + int right = Global::currentStage->x + borders.right; + int bottom = Global::currentStage->y + borders.bottom; + if((x+width/2)right || (y+height/2)bottom) + { + destroy(); + } + platform->Update(gameTime); + platform->x = x; + platform->y = y; + GameElement::Update(gameTime); + } + + void Projectile::Draw(Graphics2D&g, long gameTime) + { + GameElement::Draw(g,gameTime); + } + + byte Projectile::getTeam() + { + return team; + } + + byte Projectile::getItemDir() + { + return itemdir; + } + + byte Projectile::getPlayerNo() + { + return playerNo; + } + + boolean Projectile::isDead() + { + return dead; + } + + void Projectile::setSolid(boolean toggle) + { + solid = toggle; + } + + boolean Projectile::isSolid() + { + return solid; + } + + void Projectile::setOwnerSolid(boolean toggle) + { + solidOwner = toggle; + } + + boolean Projectile::isOwnerSolid() + { + return solidOwner; + } + + void Projectile::destroy() + { + if(!dead && P2PDataManager::isEnabled()) + { + ProjectileManager::destroyedProjectiles.add(this->id); + } + dead = true; + setVisible(false); + } + + void Projectile::setLayer(byte layer) + { + this->layer = layer; + } + + boolean Projectile::isHittable(Player*collide, byte dir) + { + if((collide->getPlayerNo()>0)&&!((Global::teamBattle)&&(team==collide->getTeam())) + &&(playerNo!=collide->getPlayerNo())&&(!collide->isInvincible())) + { + if(collide->attacksPriority<5) + { + if(collide->attacksPriority > 3) + { + if(collide->playerdir==LEFT && xx) + { + return false; + } + else if(collide->playerdir==RIGHT && x>collide->x) + { + return false; + } + } + } + return true; + } + return false; + } + + void Projectile::createProjectile(Projectile*p) + { + ProjectileManager::AddProjectile(p); + } + + void Projectile::causeDamage(Player*collide, int amount) + { + boolean canInflict = true; + if(collide->attacksPriority==5) + { + collide->updateHitbox(); + switch(collide->playerdir) + { + case Player::LEFT: + if(xx && PrimitiveActor::getDir((PrimitiveActor*)collide->getHitbox(),(PrimitiveActor*)this)!=PrimitiveActor::DIR_LEFT) + { + boolean inflicted = collide->onProjectileDeflectDamage(this, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + break; + + case Player::RIGHT: + if(x>collide->x && PrimitiveActor::getDir((PrimitiveActor*)collide,(PrimitiveActor*)this)!=PrimitiveActor::DIR_RIGHT) + { + boolean inflicted = collide->onProjectileDeflectDamage(this, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + break; + } + } + else if(collide->attacksPriority==6) + { + boolean inflicted = collide->onProjectileDeflectDamage(this, amount); + if(inflicted) + { + canInflict = false; + collide->deflectState = true; + } + } + if(canInflict) + { + collide->percent+=amount; + if(collide->percent>999) + { + collide->percent=999; + } + } + } + + void Projectile::causeHurtLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult) + { + if(collide->deflectState) + { + collide->onProjectileDeflectLaunch(this, xDir, xAmount, xMult, yDir, yAmount, yMult); + } + else + { + //float oldXvel; + //float oldYvel; + float newyVel=(float)(yDir*(yAmount+(yMult*(collide->percent))/100)); + float newxVel=(float)(xDir*(xAmount+(xMult*(collide->percent))/100)); + //Console.WriteLine(this.attacksHolder + ": " + newyVel + ""); + if(newyVel>0) + { + if(newyVel>collide->yvelocity) + { + collide->yvelocity=newyVel; + } + } + else if(newyVel<0) + { + if(newyVelyvelocity) + { + collide->yvelocity=newyVel; + } + } + if(newxVel>0) + { + if(newxVel>collide->xvelocity) + { + collide->xvelocity=newxVel; + } + } + else if(newxVel<0) + { + if(newxVelxvelocity) + { + collide->xvelocity=newxVel; + } + } + collide->y-=1; + if(collide->yvelocity>0 && collide->isOnGround()) + { + collide->yvelocity = -(collide->yvelocity/2); + } + } + } + + void Projectile::causeHurt(Player*collide, byte dir, int time) + { + if(!collide->deflectState) + { + if(abs(collide->xvelocity)<=3) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + collide->changeAnimation("hurt_spin_up", FORWARD); + } + } + + else if((abs(collide->xvelocity)>3)&&(abs(collide->xvelocity)<7)) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_fly_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_fly_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_minor_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_minor_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_fly_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_fly_right", FORWARD); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_right", FORWARD); + break; + } + } + } + + else if(abs(collide->xvelocity)>=7) + { + if(abs(collide->yvelocity)<=3) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>3)&&(abs(collide->yvelocity)<7)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", FORWARD); + break; + } + } + else if((abs(collide->yvelocity)>=7)&&(abs(collide->yvelocity)<12)) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_spin_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_spin_right", FORWARD); + break; + } + } + else if(abs(collide->yvelocity)>=12) + { + switch(dir) + { + case Player::LEFT: + collide->changeAnimation("hurt_flip_left", FORWARD); + break; + + case Player::RIGHT: + collide->changeAnimation("hurt_flip_right", FORWARD); + break; + } + } + } + collide->xVel=0; + collide->yVel=0; + collide->attackTime=0; + collide->setToDefaultValues(); + collide->chargingAttack=false; + collide->bUp=false; + collide->up=false; + collide->hurt=2; + collide->landing=false; + collide->jumping=false; + collide->moveLeft=0; + collide->moveRight=0; + collide->hanging=false; + collide->attacksHolder=-1; + collide->attacksPriority=0; + collide->canDo=false; + collide->hurtTime=Global::worldTime+time; + collide->hurtFrame=4; + collide->runTime=0; + collide->chargeSmash=0; + collide->lastHit = this->playerNo; + + collide->destroyCharge(); + + if(collide->itemHolding!=null) + { + collide->itemHolding->onHolderHurt(); + } + /*if(itemActor->itemOwner>0) + { + collide->lastHit=itemOwner; + }*/ + } + } + + void Projectile::onDestroy() + { + // + } + + void Projectile::onPlayerHit(Player*collide, byte dir) + { + // + } + + void Projectile::whilePlayerHitting(Player*collide, byte dir) + { + // + } + + void Projectile::whileGroundColliding() + { + // + } + + void Projectile::whilePlatformColliding(Platform*collide, byte dir) + { + // + } + + byte Projectile::isPlatformColliding(Platform*collide) + { + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)(x - (float)width/2), (int)(y - (float)height/2), (int)width, (int)height); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)(collide->x - (float)collide->width/2),(int)(collide->y - (float)collide->height/2),(int)collide->width,(int)collide->height); + GameEngine::Rectangle collideOverlap = getOverlapRect(r2,r1); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX = (int)collideOverlap.x; + int endX = (int)(collideOverlap.x + collideOverlap.width); + int startY = (int)collideOverlap.y; + int endY = (int)(collideOverlap.y + collideOverlap.height); + + int left=0; + int right=0; + int top=0; + int bottom=0; + boolean colliding = false; + + float x2 = ((float)collideOverlap.x/collide->Scale); + float y2 = ((float)collideOverlap.y/collide->Scale); + float incr2 = (1/collide->Scale); + + PixelIterator colPxlIter(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY; cntYright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + colliding = true; + } + } + } + + if(colliding) + { + int w = right - left; + int h = bottom - top; + int overlapX = (int)((left - startX) + overlap.x + (w/2)); + int overlapY = (int)((top - startY) + overlap.y + (h/2)); + byte dir = getDir2((float)width/2,(float)height/2,(float)overlapX, (float)overlapY); + + byte type = collide->getType(); + if((type == Platform::TYPE_NORMAL)|| (type == Platform::TYPE_GOTHROUGH && dir == DIR_DOWN)) + { + switch(dir) + { + case DIR_DOWN: + return DIR_UP; + + case DIR_UP: + return DIR_DOWN; + + case DIR_LEFT: + return DIR_RIGHT; + + case DIR_RIGHT: + return DIR_LEFT; + } + } + } + } + return 0; + } + + byte Projectile::solidPlatformCollision(Platform*collide) + { + if(collide->getCollideType() == Platform::COLLIDE_SOLID) + { + //Rectangle rect = this.grid.getAreaRect(); + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)(x-(float)width/2), (int)(y-(float)height/2), width, height); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)(collide->x - collide->width/2),(int)(collide->y - collide->height/2),collide->width,collide->height); + GameEngine::Rectangle collideOverlap = getOverlapRect(r2,r1); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX2 = collideOverlap.x; + int endX2 = collideOverlap.x + collideOverlap.width; + int startY2 = collideOverlap.y; + int endY2 = collideOverlap.y + collideOverlap.height; + + int left1=0; + int right1=0; + int top1=0; + int bottom1=0; + + int left2=0; + int right2=0; + int top2=0; + int bottom2=0; + + int startX1 = overlap.x; + int startY1 = overlap.y; + + int xPnt = startX1; // bounds checker for this + int yPnt = startY1; + + float x1 = ((float)startX1/Scale);//pixel checker starter for this + float y1 = ((float)startY1/Scale); + float incr1 = (float)(1/Scale); + + float x2 = ((float)startX2/collide->Scale);//pixel checker starter for collide + float y2 = ((float)startY2/collide->Scale); + float incr2 = (float)(1/collide->Scale); + + boolean itemCol = false; + + boolean colliding = false; + + PixelIterator pxlIter(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)collideOverlap.width,(int)collideOverlap.height); + PixelIterator colPxlIter(collide); + colPxlIter.reset(x2,y2,incr2,incr2,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY2; cntYright1) + { + right1 = xPnt; + } + if(yPntbottom1) + { + bottom1 = yPnt; + } + } + itemCol = true; + } + if(colPxlIter.checkNextPixel()) + { + if(!colliding) + { + left2 = cntX; + right2 = cntX; + top2 = cntY; + bottom2 = cntY; + } + else + { + if(cntXright2) + { + right2 = cntX; + } + if(cntYbottom2) + { + bottom2 = cntY; + } + } + colliding = true; + } + xPnt++; + } + yPnt++; + } + + if(colliding) + { + int w = right2 - left2; + int h = bottom2 - top2; + GameEngine::Rectangle collideOverlap2 = GameEngine::Rectangle(left2, top2, w, h); + int overlapX = (left2 - startX2) + overlap.x + (w/2); + int overlapY = (top2 - startY2) + overlap.y + (h/2); + byte dir = getDir2((float)width/2,(float)height/2,(float)overlapX, (float)overlapY); + + byte type = collide->getType(); + if((type == Platform::TYPE_NORMAL)||(type == Platform::TYPE_GOTHROUGH && dir == DIR_DOWN)) + { + switch(dir) + { + case DIR_DOWN: + y = (collideOverlap2.y + (collide->y - collide->height/2)) - (float)(bottom1 - (height/2)) + 1; + return DIR_UP; + + case DIR_UP: + y = ((collide->y - collide->height/2) + (collideOverlap2.y + collideOverlap2.height)) + (float)((height/2) - top1) + 1; + return DIR_DOWN; + + case DIR_LEFT: + x = ((collide->x - collide->width/2) + (collideOverlap2.x + collideOverlap2.width)) + (float)(right1 - (width/2)); + xvelocity = 0; + return DIR_RIGHT; + + case DIR_RIGHT: + x = (collideOverlap2.x + (collide->x - collide->width/2)) - (float)((width/2) - left1); + xvelocity = 0; + return DIR_LEFT; + } + } + } + } + } + else if(collide->getCollideType() == Platform::COLLIDE_BOX) + { + //Rectangle rect = this.grid.getAreaRect(); + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)(x-(float)width/2), (int)(y-(float)height/2), width, height); + WireframeActor*collideBox = collide->getBox(); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)collideBox->x,(int)collideBox->y,collideBox->width,collideBox->height); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + if(overlap.x!=-1) + { + int left=0; + int right=0; + int top=0; + int bottom=0; + + int startX = overlap.x; + int startY = overlap.y; + int endX = overlap.x + overlap.width; + int endY = overlap.y + overlap.height; + + float x1 = ((float)startX/Scale);//pixel checker starter for this + float y1 = ((float)startY/Scale); + float incr1 = (float)(1/Scale); + + boolean itemCol = false; + + PixelIterator pxlIter(this); + pxlIter.reset(x1,y1,incr1,incr1,(int)overlap.width,(int)overlap.height); + + for(int cntY=startY; cntYright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + itemCol = true; + } + } + } + + if(!itemCol) + { + return 0; + } + + byte dir = getDir(r2,r1); + switch(dir) + { + case DIR_UP: + y = (collideBox->y - (float)(bottom - (height/2))); + return DIR_UP; + + case DIR_DOWN: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + y=(collideBox->y+collideBox->height) + (float)((height/2) - top); + } + return DIR_DOWN; + + case DIR_UPLEFT: + case DIR_DOWNLEFT: + case DIR_LEFT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + x = collideBox->x - (float)((width/2) - left); + } + return DIR_LEFT; + + case DIR_UPRIGHT: + case DIR_DOWNRIGHT: + case DIR_RIGHT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + x = (collideBox->x + collideBox->width) + ((float)right - ((float)width/2)); + } + return DIR_RIGHT; + } + } + } + return 0; + } + + byte Projectile::solidPlayerCollision(Player*collide) + { + collide->updateHitbox(); + GameEngine::Rectangle r1 = GameEngine::Rectangle((int)collide->hitbox->x, (int)collide->hitbox->y, collide->hitbox->width, collide->hitbox->height); + GameEngine::Rectangle r2 = GameEngine::Rectangle((int)(x - width/2),(int)(y - height/2),width,height); + GameEngine::Rectangle collideOverlap = getOverlapRect(r2,r1); + GameEngine::Rectangle overlap = getOverlapRect(r1,r2); + + if(collideOverlap.x!=-1) + { + int startX = collideOverlap.x; + int endX = collideOverlap.x + collideOverlap.width; + int startY = collideOverlap.y; + int endY = collideOverlap.y + collideOverlap.height; + + float x2 = ((float)startX/Scale); + float y2 = ((float)startY/Scale); + float incr = (float)(1/Scale); + + int left=0; + int right=0; + int top=0; + int bottom=0; + boolean colliding = false; + + PixelIterator pxlIter(this); + pxlIter.reset(x2,y2,incr,incr,(int)collideOverlap.width,(int)collideOverlap.height); + + for(int cntY=startY; cntYright) + { + right = cntX; + } + if(cntYbottom) + { + bottom = cntY; + } + } + colliding = true; + } + } + } + + if(colliding) + { + int w = right - left; + int h = bottom - top; + GameEngine::Rectangle collideOverlap2 = GameEngine::Rectangle(left, top, w, h); + int overlapX = (left - startX) + overlap.x + (w/2); + int overlapY = (top - startY) + overlap.y + (h/2); + byte dir = getDir2((float)collide->hitbox->width/2,(float)collide->hitbox->height/2,(float)overlapX, (float)overlapY); + + switch(dir) + { + case DIR_DOWN: + collide->y = (collideOverlap2.y + (y - height/2)) - (float)((float)(collide->hitbox->height + ((float)collide->hitboxPoint.y*collide->Scale))) + 1; + collide->updateHitbox(); + break; + + case DIR_UP: + collide->y = ((y - height/2) + (collideOverlap2.y + collideOverlap2.height)) + collide->height/2 - ((float)((float)collide->hitboxPoint.y*collide->Scale) + collide->height/2) + 1; + collide->updateHitbox(); + break; + + case DIR_LEFT: + collide->x = ((x - width/2) + (collideOverlap2.x + collideOverlap2.width) + (float)((float)collide->hitbox->width)/2); + collide->updateHitbox(); + break; + + case DIR_RIGHT: + collide->x = (collideOverlap2.x + (x - width/2)) - (float)((float)collide->hitbox->width)/2; + collide->updateHitbox(); + break; + } + return dir; + } + } + return 0; + } +} \ No newline at end of file diff --git a/SmashBros/Projectile.h b/SmashBros/Projectile.h new file mode 100755 index 0000000..7de91ed --- /dev/null +++ b/SmashBros/Projectile.h @@ -0,0 +1,84 @@ +#include "GameElement.h" +#include "Platform.h" +#include "CollisionManager.h" +#include "SmashForwards.h" + +#pragma once + +namespace SmashBros +{ + class Projectile : public GameElement + { + friend class P2PDataManager; + friend class Player; + friend class ProjectileManager; + friend class Stage; + private: + + static int nextID; + int id; + + boolean dead; + byte playerNo; + byte team; + boolean solid; + boolean solidOwner; + byte layer; + + Platform*platform; + + CollisionManager playersColliding; + + byte solidPlatformCollision(Platform*collide); + byte solidPlayerCollision(Player*collide); + + void handleAddP2PData(DataVoid&data); + void handleSetP2PData(byte*&data); + + protected: + byte itemdir; + boolean isHittable(Player*collide, byte dir); + void createProjectile(Projectile*p); + void causeDamage(Player*collide, int amount); + void causeHurtLaunch(Player*collide, int xDir, float xAmount, float xMult, int yDir, float yAmount, float yMult); + void causeHurt(Player*collide, byte dir, int time); + + public: + static const byte LEFT = 1; + static const byte RIGHT = 2; + + static const byte LAYER_BOTTOM = 1; + static const byte LAYER_MIDDLELOWER = 2; + static const byte LAYER_MIDDLEUPPER = 3; + static const byte LAYER_TOP = 4; + + Projectile(byte playerNo, float x1, float y1); + virtual ~Projectile(); + + int getID(); + static void setNextID(int projID); + + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + virtual void onDestroy(); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void whilePlayerHitting(Player*collide, byte dir); + virtual void whileGroundColliding(); + virtual void whilePlatformColliding(Platform*collide, byte dir); + + byte getTeam(); + byte getItemDir(); + byte getPlayerNo(); + boolean isDead(); + void setSolid(boolean toggle); + boolean isSolid(); + void setOwnerSolid(boolean toggle); + boolean isOwnerSolid(); + void destroy(); + void setLayer(byte layer); + byte isPlatformColliding(Platform*collide); + }; +} \ No newline at end of file diff --git a/SmashBros/ProjectileManager.cpp b/SmashBros/ProjectileManager.cpp new file mode 100755 index 0000000..39df2f1 --- /dev/null +++ b/SmashBros/ProjectileManager.cpp @@ -0,0 +1,414 @@ +#include "ProjectileManager.h" +#include "Global.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + ArrayList ProjectileManager::projectiles = ArrayList(); + ArrayList ProjectileManager::destroyedProjectiles = ArrayList(); + + void ProjectileManager::handleAddP2PData(DataVoid&data) + { + if(projectiles.size()>0) + { + bool avail = true; + data.add(&avail, sizeof(avail)); + + int total = 0; + + DataVoid projUpdates; + + for(int i=0; idead) + { + total++; + int projID = proj->getID(); + projUpdates.add(&projID, sizeof(projID)); + + proj->handleAddP2PData(projUpdates); + } + } + + data.add(&total, sizeof(total)); + data.add(projUpdates); + } + else + { + bool avail = false; + data.add(&avail, sizeof(avail)); + } + + if(destroyedProjectiles.size()>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + int total = destroyedProjectiles.size(); + data.add(&total, sizeof(total)); + + for(int i=0; igetID()) + { + proj = checkProj; + j = projectiles.size(); + } + } + + if(proj == NULL) + { + P2PDataManager::setErrorState(); + Game::showMessage("Error", (String)"An error has occured in ProjectileManager::handleSetP2PData(byte*&)\n No projectile to update found with id " + projID); + String mylog = (String)"projectiles.size() = " + projectiles.size() + '\n'; + for(int j=0; jgetID(); + mylog += (String)"index " + j + ": " + hold; + } + Game::showMessage(mylog); + return; + } + else + { + proj->handleSetP2PData(data); + } + } + } + + avail = data[0]; + data += sizeof(bool); + + if(avail) + { + int total = DataVoid::toInt(data); + data += sizeof(int); + + for(int i=0; igetID()) + { + proj = checkProj; + index = j; + j = projectiles.size(); + } + } + + if(proj == NULL) + { + P2PDataManager::setErrorState(); + Game::showMessage("Error", (String)"An error has occured in ProjectileManager::handleSetP2PData(byte*&)\n No projectile to destroy found with id " + projID); + String mylog = (String)"destroyedProjectiles.size() = " + destroyedProjectiles.size() + '\n'; + for(int j=0; jgetID(); + mylog += (String)"index " + j + ": " + hold; + } + Game::showMessage(mylog); + return; + } + else + { + //Game::showMessage((String)"destroyed projectile with id " + projID); + delete proj; + projectiles.remove(index); + } + } + } + destroyedProjectiles.clear(); + } + + bool ProjectileManager::checkIDAvailable(int projID) + { + for(int i=0; igetID(); + if(check == projID) + { + return false; + } + } + return true; + } + + void ProjectileManager::AddProjectile(Projectile*p) + { + Console::WriteLine((String)"Adding projectile with id " + p->getID() + " to ProjectileManager"); + projectiles.add(p); + } + + void ProjectileManager::RemoveAll() + { + for(int i=0; idestroy(); + projectiles.get(i)->onDestroy(); + delete projectiles.get(i); + } + projectiles.clear(); + destroyedProjectiles.clear(); + } + + void ProjectileManager::Update(long gameTime) + { + for(int i=(projectiles.size()-1); i>=0; i--) + { + Projectile*projectile = projectiles.get(i); + if(projectile->dead) + { + projectile->onDestroy(); + delete projectile; + projectiles.remove(i); + } + else + { + projectile->Update(gameTime); + Stage*stage = Global::currentStage; + for(int j=0; jplatforms.size(); j++) + { + byte dir = stage->checkProjectileCollision(projectile, stage->platforms.get(j)); + if(dir > 0) + { + if(stage->platforms.get(j)->getType()==Platform::TYPE_GOTHROUGH) + { + if(dir == PrimitiveActor::DIR_UP) + { + projectile->whilePlatformColliding(stage->platforms.get(j), dir); + projectile->whileGroundColliding(); + if(projectile->isSolid()) + { + if(projectile->yvelocity>0) + { + projectile->yvelocity = 0; + } + } + } + } + else + { + projectile->whilePlatformColliding(stage->platforms.get(j), dir); + if(dir == PrimitiveActor::DIR_UP) + { + projectile->whileGroundColliding(); + } + if(projectile->isSolid()) + { + switch(dir) + { + case PrimitiveActor::DIR_UP: + if(projectile->yvelocity>0) + { + projectile->yvelocity = 0; + } + break; + + case PrimitiveActor::DIR_LEFT: + if(projectile->xvelocity>0) + { + projectile->xvelocity = 0; + } + break; + + case PrimitiveActor::DIR_RIGHT: + if(projectile->xvelocity<0) + { + projectile->xvelocity = 0; + } + break; + } + } + } + } + } + for(int j=0; j<=Global::possPlayers; j++) + { + if(Global::characters[j]!=null) + { + CheckProjectileCollision(projectile,Global::characters[j]); + } + } + } + } + } + + void ProjectileManager::CheckProjectileCollision(Projectile*projectile, Player*playr) + { + byte dir = 0; + if(projectile->isSolid() && ((projectile->isOwnerSolid()) || (!projectile->isOwnerSolid() && playr->getPlayerNo()!=projectile->getPlayerNo()))) + { + dir = projectile->solidPlayerCollision(playr); + switch(dir) + { + case PrimitiveActor::DIR_DOWN: + playr->platformCollision(projectile->platform, PrimitiveActor::DIR_UP); + if(!playr->hangColliding) + { + if(!playr->groundCheck) + { + playr->whileGroundColliding(); + } + playr->groundColliding = true; + if(!playr->prevGroundColliding) + { + playr->onGroundCollide(); + } + playr->groundCheck = true; + } + playr->currentCollidePlatformActor[PrimitiveActor::DIR_UP] = projectile->platform; + playr->collideQueue.add(PrimitiveActor::DIR_UP); + break; + + case PrimitiveActor::DIR_UP: + playr->platformCollision(projectile->platform, PrimitiveActor::DIR_DOWN); + playr->currentCollidePlatformActor[PrimitiveActor::DIR_DOWN] = projectile->platform; + playr->collideQueue.add(PrimitiveActor::DIR_DOWN); + break; + + case PrimitiveActor::DIR_LEFT: + playr->platformCollision(projectile->platform, PrimitiveActor::DIR_RIGHT); + playr->currentCollidePlatformActor[PrimitiveActor::DIR_RIGHT] = projectile->platform; + playr->collideQueue.add(PrimitiveActor::DIR_RIGHT); + break; + + case PrimitiveActor::DIR_RIGHT: + playr->platformCollision(projectile->platform, PrimitiveActor::DIR_LEFT); + playr->currentCollidePlatformActor[PrimitiveActor::DIR_LEFT] = projectile->platform; + playr->collideQueue.add(PrimitiveActor::DIR_LEFT); + break; + } + } + else + { + dir = projectile->isColliding2(playr); + } + if(dir>0) + { + switch(dir) + { + case PrimitiveActor::DIR_DOWN: + dir = PrimitiveActor::DIR_UP; + break; + + case PrimitiveActor::DIR_UP: + dir = PrimitiveActor::DIR_DOWN; + break; + + case PrimitiveActor::DIR_LEFT: + dir = PrimitiveActor::DIR_RIGHT; + break; + + case PrimitiveActor::DIR_RIGHT: + dir = PrimitiveActor::DIR_LEFT; + break; + } + if(projectile->playersColliding.isColliding(playr->getPlayerNo())) + { + projectile->whilePlayerHitting(playr, dir); + } + else + { + projectile->onPlayerHit(playr, dir); + projectile->playersColliding.addCollision(playr->getPlayerNo()); + } + } + else + { + projectile->playersColliding.removeCollision(playr->getPlayerNo()); + } + } + + void ProjectileManager::DrawBottomLayer(Graphics2D&g, long gameTime) + { + for(int i=(projectiles.size()-1); i>=0; i--) + { + if(projectiles.get(i)->layer == Projectile::LAYER_BOTTOM) + { + projectiles.get(i)->Draw(g, gameTime); + } + } + } + + void ProjectileManager::DrawMiddleLowerLayer(Graphics2D&g, long gameTime) + { + for(int i=(projectiles.size()-1); i>=0; i--) + { + if(projectiles.get(i)->layer == Projectile::LAYER_MIDDLELOWER) + { + projectiles.get(i)->Draw(g, gameTime); + } + } + } + + void ProjectileManager::DrawMiddleUpperLayer(Graphics2D&g, long gameTime) + { + for(int i=(projectiles.size()-1); i>=0; i--) + { + if(projectiles.get(i)->layer == Projectile::LAYER_MIDDLEUPPER) + { + projectiles.get(i)->Draw(g, gameTime); + } + } + } + + void ProjectileManager::DrawTopLayer(Graphics2D&g, long gameTime) + { + for(int i=(projectiles.size()-1); i>=0; i--) + { + if(projectiles.get(i)->layer == Projectile::LAYER_TOP) + { + projectiles.get(i)->Draw(g, gameTime); + } + } + } +} \ No newline at end of file diff --git a/SmashBros/ProjectileManager.h b/SmashBros/ProjectileManager.h new file mode 100755 index 0000000..e9e44c9 --- /dev/null +++ b/SmashBros/ProjectileManager.h @@ -0,0 +1,32 @@ +#include "Projectile.h" + +#pragma once + +namespace SmashBros +{ + class ProjectileManager + { + friend class Global; + friend class Player; + friend class P2PDataManager; + friend class Projectile; + private: + static ArrayList projectiles; + static ArrayList destroyedProjectiles; + + static void handleAddP2PData(DataVoid&data); + static void handleSetP2PData(byte*&data); + + static void CheckProjectileCollision(Projectile*projectile, Player*playr); + + static bool checkIDAvailable(int projID); + public: + static void AddProjectile(Projectile*p); + static void RemoveAll(); + static void Update(long gameTime); + static void DrawBottomLayer(Graphics2D&g, long gameTime); + static void DrawMiddleLowerLayer(Graphics2D&g, long gameTime); + static void DrawMiddleUpperLayer(Graphics2D&g, long gameTime); + static void DrawTopLayer(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/RayGun.cpp b/SmashBros/RayGun.cpp new file mode 100755 index 0000000..a25a6f5 --- /dev/null +++ b/SmashBros/RayGun.cpp @@ -0,0 +1,293 @@ +#include "RayGun.h" +#include "Global.h" + +namespace SmashBros +{ + RayGun::RayGun(float x1, float y1) : Item(x1, y1, 200, TYPE_HOLD) + { + itemNo = Global::ITEM_RAYGUN; + + weight = 0.2f; + + ammo = 16; + active = false; + activeTime = 0; + attackDir = 0; + + Animation*anim; + + anim = new Animation("left",1,"Images/Game/Items/RayGun/raygun.png"); + addAnimation(anim); + + anim = new Animation("right",1,"Images/Game/Items/RayGun/raygun.png"); + anim->mirror(true); + addAnimation(anim); + + anim = new Animation("down_left",1,"Images/Game/Items/RayGun/raygun_down.png"); + addAnimation(anim); + + anim = new Animation("down_right",1,"Images/Game/Items/RayGun/raygun_down.png"); + anim->mirror(true); + addAnimation(anim); + + dir = (byte)((GameEngine::random()*2)+1); + + switch(dir) + { + case 1: + changeAnimation("left",FORWARD); + break; + + case 2: + changeAnimation("right",FORWARD); + break; + } + + setHoldOffset(5, 1); + } + + RayGun::~RayGun() + { + // + } + + void RayGun::onDiscard(Player*discarder) + { + switch(discarder->getPlayerDir()) + { + case Player::LEFT: + xvelocity = 2; + break; + + case Player::RIGHT: + xvelocity = -2; + break; + } + dir = discarder->getPlayerDir(); + yvelocity = -3; + } + + boolean RayGun::use(byte attackDir) + { + this->attackDir = attackDir; + if(attackDir==ATTACK_NORMAL) + { + if(!active) + { + active = true; + if(ammo>0) + { + createProjectile(new Ray(getItemHolder(),x,y)); + ammo--; + } + activeTime = Global::getWorldTime() + 5; + } + return true; + } + else if(attackDir==ATTACK_SIDE) + { + if(!active) + { + active = true; + if(ammo>0) + { + createProjectile(new Ray(getItemHolder(),x,y)); + ammo--; + } + activeTime = Global::getWorldTime() + 4; + } + return true; + } + return false; + } + + boolean RayGun::holderCanDo() + { + if(active && attackDir==ATTACK_NORMAL) + { + return false; + } + return true; + } + + void RayGun::Update(long gameTime) + { + Item::Update(gameTime); + + if(isHeld()) + { + if(activeTime<=Global::getWorldTime()) + { + active = false; + } + Player*playr = getPlayer(); + if(active) + { + switch(playr->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("left",FORWARD); + break; + + case Player::RIGHT: + changeAnimation("right",FORWARD); + break; + } + } + else + { + switch(playr->getPlayerDir()) + { + case Player::LEFT: + changeAnimation("down_left",FORWARD); + break; + + case Player::RIGHT: + changeAnimation("down_right",FORWARD); + break; + } + } + } + else + { + switch(dir) + { + case Player::LEFT: + changeAnimation("left",FORWARD); + break; + + case Player::RIGHT: + changeAnimation("right",FORWARD); + break; + } + } + } + + RayGun::Ray::Ray(byte playerNo, float x1, float y1) : Projectile(playerNo, x1, y1) + { + Animation*anim; + + anim = new Animation("left",1,"Images/Game/Items/RayGun/ray.png"); + addAnimation(anim); + + anim = new Animation("right",1,"Images/Game/Items/RayGun/ray.png"); + anim->mirror(true); + addAnimation(anim); + + switch(itemdir) + { + case Player::LEFT: + changeAnimation("left",FORWARD); + xvelocity = -6; + break; + + case Player::RIGHT: + changeAnimation("right",FORWARD); + xvelocity = 6; + break; + } + + startX = x; + } + + RayGun::Ray::~Ray() + { + // + } + + void RayGun::Ray::Update(long gameTime) + { + Projectile::Update(gameTime); + if(abs(startX - x)>240) + { + destroy(); + } + } + + void RayGun::Ray::onPlayerHit(Player*collide, byte dir) + { + if(isHittable(collide,dir)) + { + if(collide->getAttacksPriority()==5) + { + if(itemdir==collide->getPlayerDir()) + { + causeDamage(collide,2); + collide->y-=3; + causeHurtLaunch(collide,0,0,0, -1,1,1); + switch(itemdir) + { + case 1: + causeHurtLaunch(collide,-1,3,1, 0,0,0); + causeHurt(collide, Player::RIGHT, 3); + break; + + case 2: + causeHurtLaunch(collide,1,3,1, 0,0,0); + causeHurt(collide, Player::LEFT, 3); + break; + } + destroy(); + } + else + { + xvelocity=-xvelocity; + switch(itemdir) + { + case 1: + itemdir=2; + changeAnimation("right", NO_CHANGE); + break; + + case 2: + itemdir=1; + changeAnimation("left", NO_CHANGE); + break; + } + } + } + + else if(collide->getAttacksPriority()==6) + { + xvelocity=-xvelocity; + switch(itemdir) + { + case 1: + itemdir=2; + changeAnimation("right", NO_CHANGE); + break; + + case 2: + itemdir=1; + changeAnimation("left", NO_CHANGE); + break; + } + } + + else if(collide->getAttacksPriority()==7) + { + destroy(); + } + + else + { + causeDamage(collide,2); + collide->y-=3; + causeHurtLaunch(collide,0,0,0, -1,1,1); + switch(itemdir) + { + case 1: + causeHurtLaunch(collide, -1,3,1, 0,0,0); + causeHurt(collide, Player::RIGHT, 3); + break; + + case 2: + causeHurtLaunch(collide,1,3,1, 0,0,0); + causeHurt(collide, Player::LEFT, 3); + break; + } + destroy(); + } + } + } +} \ No newline at end of file diff --git a/SmashBros/RayGun.h b/SmashBros/RayGun.h new file mode 100755 index 0000000..3cb6063 --- /dev/null +++ b/SmashBros/RayGun.h @@ -0,0 +1,40 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class RayGun : public Item + { + private: + byte dir; + int ammo; + long activeTime; + boolean active; + byte attackDir; + + class Ray : public Projectile + { + private: + float startX; + + public: + Ray(byte playerNo, float x1, float y1); + virtual ~Ray(); + + virtual void Update(long gameTime); + + virtual void onPlayerHit(Player*collide, byte dir); + }; + + public: + RayGun(float x1, float y1); + virtual ~RayGun(); + + virtual void Update(long gameTime); + + virtual void onDiscard(Player*discarder); + virtual boolean use(byte attackDir); + virtual boolean holderCanDo(); + }; +} \ No newline at end of file diff --git a/SmashBros/SmashBall.cpp b/SmashBros/SmashBall.cpp new file mode 100755 index 0000000..5acffbe --- /dev/null +++ b/SmashBros/SmashBall.cpp @@ -0,0 +1,470 @@ +#include "SmashBall.h" +#include "Global.h" +#include "Stage.h" + +namespace SmashBros +{ + SmashBall::SmashBall(float x1, float y1) : Item(x1,y1, 400,TYPE_WIELD) + { + moveTime = 0; + speed = 1; + hittable = true; + unHittableTime = 0; + health = 10; + + active = true; + + itemNo = Global::ITEM_SMASHBALL; + + readyFire = null; + + Animation*anim; + + anim = new Animation("normal", 5, 8, 1); + anim->addFrame("Images/Game/Items/SmashBall/smashball.png"); + addAnimation(anim); + + anim = new Animation("hit", 6, 2, 1); + anim->addFrame("Images/Game/Items/SmashBall/smashball_hit.png"); + addAnimation(anim); + + addFileResource("Images/Game/Items/SmashBall/finalsmash_fire.png"); + + changeAnimation("normal",FORWARD); + + ignoreGoThroughPlatforms(true); + setSolid(true); + canBeCarried(false); + } + + SmashBall::~SmashBall() + { + // + } + + void SmashBall::onAnimationFinish(const String&n) + { + if(n.equals("hit")) + { + changeAnimation("normal",FORWARD); + } + } + + void SmashBall::onCreate() + { + Global::smashBallOnField = true; + yvelocity = 2*speed; + } + + void SmashBall::onDestroy() + { + Global::smashBallOnField = false; + Global::playerHasSmashBall = false; + if(readyFire!=null) + { + readyFire->destroy(); + readyFire = null; + } + } + + void SmashBall::onPickUp(Player*collide) + { + doPowerUp(collide,POWERUP_FINALSMASH,0); + } + + boolean SmashBall::canPickUp() + { + return false; + } + + void SmashBall::whilePlatformColliding(Platform*collide, byte dir) + { + if(!isHeld()) + { + setDirection(dir,speed); + } + } + + void SmashBall::whilePlayerColliding(Player*collide) + { + byte dir = getDir(collide,this); + if(isHeld()) + { + setDirection(dir,speed); + } + else + { + if(collide->getAttacksPriority()>0 && hittable) + { + hittable = false; + unHittableTime = Global::getWorldTime() + 3; + setDirection(dir,2*speed); + hitSmashBall(collide,dir); + } + else + { + setDirection(dir,speed); + } + } + } + + void SmashBall::hitSmashBall(Player*collide, byte dir) + { + Console::WriteLine((String)"" + health); + if(((int)collide->getAttacksPriority()) == 4) + { + health-=3; + changeAnimation("hit", FORWARD); + } + else if(((int)collide->getAttacksPriority()) == 5) + { + health-=1; + changeAnimation("hit", FORWARD); + } + else if(((int)collide->getAttacksPriority()) == 6) + { + health-=2; + changeAnimation("hit", FORWARD); + } + else if(collide->getAttacksPriority() > 0) + { + health-=(int)(collide->getAttacksPriority()); + changeAnimation("hit", FORWARD); + } + + if(collide->getPlayerNo()>0) + { + if(health<=0 && active) + { + active=false; + readyFire = new Projectile(collide->getPlayerNo(), collide->x,collide->y); + readyFire->addAnimation(new Animation("normal",1,"Images/Game/Items/SmashBall/finalsmash_fire.png")); + readyFire->changeAnimation("normal", FORWARD); + readyFire->setAlpha(0.278f); + readyFire->setLayer(Projectile::LAYER_MIDDLEUPPER); + createProjectile(readyFire); + collide->pickUpItem(this); + } + } + } + + void SmashBall::Update(long gameTime) + { + if(isHeld()) + { + // + } + else + { + if(!hittable) + { + if(unHittableTime <= Global::getWorldTime()) + { + hittable = true; + } + } + if(moveTime <= Global::getWorldTime()) + { + setDirection(); + + moveTime = Global::getWorldTime() + 10; + } + + Rectangle borders = Global::currentStage->getItemBoundaries(); + + if(x < borders.x) + { + xvelocity = speed; + } + else if(x > (borders.x + borders.width)) + { + xvelocity = -speed; + } + + if(y < borders.y) + { + yvelocity = speed; + } + else if(y > (borders.y + borders.height)) + { + yvelocity = -speed; + } + } + Item::Update(gameTime); + } + + void SmashBall::Draw(Graphics2D&g, long gameTime) + { + if(isHeld() && readyFire!=null) + { + Player*owner = Global::getPlayerActor(getItemHolder()); + readyFire->x = owner->x; + readyFire->y = owner->y; + x = 0; + y = 0; + } + else + { + Item::Draw(g, gameTime); + } + } + + void SmashBall::setDirection(byte dir, float speed) + { + int moveDist = 1; + switch(dir) + { + case DIR_UP: + yvelocity = -speed; + y-=moveDist; + break; + + case DIR_DOWN: + yvelocity = speed; + y+=moveDist; + break; + + case DIR_LEFT: + xvelocity = -speed; + x-=moveDist; + break; + + case DIR_RIGHT: + xvelocity = speed; + x+=moveDist; + break; + + case DIR_UPLEFT: + xvelocity = -speed; + yvelocity = -speed; + x-=moveDist; + y-=moveDist; + break; + + case DIR_UPRIGHT: + xvelocity = speed; + yvelocity = -speed; + x+=moveDist; + y-=moveDist; + break; + + case DIR_DOWNLEFT: + xvelocity = -speed; + yvelocity = speed; + x-=moveDist; + y+=moveDist; + break; + + case DIR_DOWNRIGHT: + xvelocity = speed; + yvelocity = speed; + x+=moveDist; + y+=moveDist; + break; + } + } + + void SmashBall::setDirection() + { + double rand = GameEngine::random()*6; + + //-----down-----// + + if(yvelocity>0) + { + if(xvelocity>0) + { + //down right + if(rand<=2) + { + //down + xvelocity=0; + yvelocity=speed; + } + else if((rand>2)&&(rand<4)) + { + //down right + xvelocity=speed; + yvelocity=speed; + } + else if(rand>=4) + { + //right + xvelocity=speed; + yvelocity=0; + } + } + else if(xvelocity==0) + { + //down + if(rand<=2) + { + //down left + xvelocity=-speed; + yvelocity=speed; + } + else if((rand>2)&&(rand<4)) + { + //down + xvelocity=0; + yvelocity=speed; + } + else if(rand>=4) + { + //down right + xvelocity=speed; + yvelocity=speed; + } + } + else if(xvelocity<0) + { + //down left + if(rand<=2) + { + //left + xvelocity=-speed; + yvelocity=0; + } + else if((rand>2)&&(rand<4)) + { + //down left + xvelocity=-speed; + yvelocity=speed; + } + else if(rand>=4) + { + //down + xvelocity=0; + yvelocity=speed; + } + } + } + + //-----nowhere-----// + + else if(yvelocity==0) + { + if(xvelocity>0) + { + //right + if(rand<=2) + { + //down right + xvelocity=speed; + yvelocity=speed; + } + else if((rand>2)&&(rand<4)) + { + //right + xvelocity=speed; + yvelocity=0; + } + else if(rand>=4) + { + //up right + xvelocity=speed; + yvelocity=-speed; + } + } + else if(xvelocity==0) + { + //nowhere + xvelocity=speed; + } + else if(xvelocity<0) + { + //left + if(rand<=2) + { + //up left + xvelocity=-speed; + yvelocity=-speed; + } + else if((rand>2)&&(rand<4)) + { + //left + xvelocity=-speed; + yvelocity=0; + } + else if(rand>=4) + { + //down left + xvelocity=-speed; + yvelocity=speed; + } + } + } + + //-----up-----// + + else if(yvelocity<0) + { + if(xvelocity>0) + { + //up right + if(rand<=2) + { + //up + xvelocity=0; + yvelocity=-speed; + } + else if((rand>2)&&(rand<4)) + { + //up right + xvelocity=speed; + yvelocity=-speed; + } + else if(rand>=4) + { + //right + xvelocity=speed; + yvelocity=0; + } + } + else if(xvelocity==0) + { + //up + if(rand<=2) + { + //up left + xvelocity=-speed; + yvelocity=-speed; + } + else if((rand>2)&&(rand<4)) + { + //up + xvelocity=0; + yvelocity=-speed; + } + else if(rand>=4) + { + //up right + xvelocity=speed; + yvelocity=-speed; + } + } + else if(xvelocity<0) + { + //up left + if(rand<=2) + { + //left + xvelocity=-speed; + yvelocity=0; + } + else if((rand>2)&&(rand<4)) + { + //up left + xvelocity=-speed; + yvelocity=-speed; + } + else if(rand>=4) + { + //up + xvelocity=0; + yvelocity=-speed; + } + } + } + } +} \ No newline at end of file diff --git a/SmashBros/SmashBall.h b/SmashBros/SmashBall.h new file mode 100755 index 0000000..f1cebd3 --- /dev/null +++ b/SmashBros/SmashBall.h @@ -0,0 +1,36 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class SmashBall : public Item + { + private: + Projectile*readyFire; + long moveTime; + float speed; + boolean hittable; + long unHittableTime; + boolean active; + int health; + + void hitSmashBall(Player*collide, byte dir); + void setDirection(byte dir, float speed); + void setDirection(); + + public: + SmashBall(float x1, float y1); + virtual ~SmashBall(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + virtual void onAnimationFinish(const String&n); + virtual void onCreate(); + virtual void onDestroy(); + virtual void onPickUp(Player*collide); + virtual boolean canPickUp(); + virtual void whilePlatformColliding(Platform*collide, byte dir); + virtual void whilePlayerColliding(Player*collide); + }; +} \ No newline at end of file diff --git a/SmashBros/SmashForwards.h b/SmashBros/SmashForwards.h new file mode 100644 index 0000000..3f4fabe --- /dev/null +++ b/SmashBros/SmashForwards.h @@ -0,0 +1,14 @@ + +#pragma once + +namespace SmashBros +{ + class Chargebar; + class GameElement; + class HitBox; + class Item; + class Platform; + class Player; + class Projectile; + class Stage; +} \ No newline at end of file diff --git a/SmashBros/Sonic.cpp b/SmashBros/Sonic.cpp new file mode 100755 index 0000000..d5f50fc --- /dev/null +++ b/SmashBros/Sonic.cpp @@ -0,0 +1,2480 @@ +#include "Sonic.h" +#include "Global.h" +#include "AttackTemplates.h" +#include "P2PDataManager.h" + +namespace SmashBros +{ + void Sonic::addProjectileInfo(byte type, int projID, float x, float y) + { + ProjectileInfo info; + info.type = type; + info.projID = projID; + info.x = x; + info.y = y; + createdProjectiles.add(info); + } + + Sonic::Sonic(float x1, float y1, byte playerNo, byte team) : Player(x1, y1, playerNo, team) + { + turning = false; + winding = false; + finalSmashing = false; + chargeAttack = 0; + + xprevious = 0; + yprevious = 0; + + rollSpeed = 6; + rocketSpeed = 0; + sonicSpeedRun = 12; + + walkSpeed = 4.2f; + runSpeed = 10; + fallWalk = 2.2f; + fallRun = 2.3f; + + weight = 0.1; + + name = "Sonic"; + + Scale = 0.95f; + + setHitbox(-11, -12, 22, 34); + setHitboxColor(Color::GREEN); + //showHitboxWireframe(true); + //setWireframeColor(Color.red); + //showWireframe(true); + + setHangPoint(6, 5); + + Console::WriteLine((String)"finished creating player " + playerNo); + } + + Sonic::~Sonic() + { + // + } + + void Sonic::addP2PData(DataVoid&data) + { + int total = createdProjectiles.size(); + + if(total>0) + { + P2PDataManager::setReliable(); + + bool avail = true; + data.add(&avail, sizeof(avail)); + + int total = createdProjectiles.size(); + data.add(&total, sizeof(total)); + + for(int i=0; i seq; + seq.add(2); seq.add(1); seq.add(0); + + Animation*anim = new Animation("finalsmash_stop_left", 6, 3, 1, seq); + anim->addFrame("Images/Game/Characters/Sonic/finalsmash_turn.png"); + addAnimation(anim); + anim = new Animation("finalsmash_stop_right", 6, 3, 1, seq); + anim->addFrame("Images/Game/Characters/Sonic/finalsmash_turn.png"); + anim->mirror(true); + addAnimation(anim); + } + + void Sonic::LoadAttackTypes() + { + addAIAttackType(ATTACK_A, ATTACKTYPE_MELEE, 10); + addAIAttackType(ATTACK_SIDEA, ATTACKTYPE_MELEE, 7); + addAIAttackType(ATTACK_UPA, ATTACKTYPE_MELEE, 4); + addAIAttackType(ATTACK_UPA, ATTACKTYPE_UPMELEE, 1); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_MELEE, 3); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_DOWNMELEE, 1); + addAIAttackType(ATTACK_DOWNA, ATTACKTYPE_DOWNMOVE, 4); + addAIAttackType(ATTACK_B, ATTACKTYPE_MELEE, 2); + addAIAttackType(ATTACK_B, ATTACKTYPE_UPMELEE, 2); + addAIAttackType(ATTACK_B, ATTACKTYPE_DOWNMELEE, 2); + addAIAttackType(ATTACK_SIDEB, ATTACKTYPE_SIDEMOVE, 3); + addAIAttackType(ATTACK_SIDEB, ATTACKTYPE_MELEE, 1); + addAIAttackType(ATTACK_UPB, ATTACKTYPE_UPMOVE, 3); + addAIAttackType(ATTACK_DOWNB, ATTACKTYPE_DOWNMOVE, 1, true); + addAIAttackType(ATTACK_SIDESMASH, ATTACKTYPE_STRONGMELEE, 2, true); + addAIAttackType(ATTACK_UPSMASH, ATTACKTYPE_STRONGMELEE, 1, true); + addAIAttackType(ATTACK_DOWNSMASH, ATTACKTYPE_STRONGMELEE, 1, true); + } + + void Sonic::setToDefaultValues() + { + turning = false; + winding = false; + chargeAttack = 0; + } + + void Sonic::onDestroy() + { + finalSmashing = false; + } + + boolean Sonic::checkIfAble() + { + if(turning || winding) + { + return false; + } + return true; + } + + void Sonic::Update(long gameTime) + { + Player::Update(gameTime); + + checkAttacks(); + updateGravity(); + updateFrame(); + + setHitbox(-10, -12, 22, 31); + + if(attacksHolder==12) + { + if(Global::getWorldTime()>=attackTime) + { + float oldxVel=(float)xVel; + animFinish(); + switch(playerdir) + { + case 1: + changeAnimation("special_finish_left", FORWARD); + break; + + case 2: + changeAnimation("special_finish_right", FORWARD); + break; + } + if(isOnGround()) + { + landing=true; + turning=true; + xVel=oldxVel; + upKey=false; + } + } + else + { + if(upKey) + { + if(isOnGround()) + { + yvelocity=-8; + } + else if(doubleJump==1) + { + yvelocity=-7; + doubleJump=0; + } + upKey=false; + } + if(moveLeft>0) + { + playerdir=1; + } + if(moveRight>0) + { + playerdir=2; + } + switch(playerdir) + { + case 1: + if(xVel>-rollSpeed) + { + turning=true; + playerdir=1; + xVel-=0.5; + attacksHolder=12; + moveLeft=0; + moveRight=0; + changeAnimation("roll_left", NO_CHANGE); + } + else + { + turning=false; + xVel=-rollSpeed; + attacksHolder=12; + playerdir=1; + moveLeft=0; + moveRight=0; + changeAnimation("roll_left", NO_CHANGE); + } + break; + + case 2: + if(xVel=attackTime) + { + animFinish(); + yvelocity=-3; + switch(playerdir) + { + case 1: + changeAnimation("special_finish_left", FORWARD); + break; + + case 2: + changeAnimation("special_finish_right", FORWARD); + break; + } + chargeAttack=0; + } + else + { + if(upKey) + { + animFinish(); + chargeAttack=0; + attackTime=0; + upKey=false; + } + if(moveLeft>0) + { + playerdir=1; + } + if(moveRight>0) + { + playerdir=2; + } + switch(playerdir) + { + case 1: + if(xVel>-rocketSpeed) + { + turning=true; + playerdir=1; + xVel-=1; + attacksHolder=14; + moveLeft=0; + moveRight=0; + changeAnimation("roll_left", NO_CHANGE); + } + else + { + turning=false; + xVel=-rocketSpeed; + attacksHolder=14; + playerdir=1; + moveLeft=0; + moveRight=0; + changeAnimation("roll_left", NO_CHANGE); + } + break; + + case 2: + if(xVel=0) + { + animFinish(); + } + break; + + case 2: + xVel-=0.2f; + if(xVel<=0) + { + animFinish(); + } + break; + } + } + + updateMovement(); + + updateHanging(); + updateHurt(); + updateDrop(); + updateAI(); + + if(finalSmashing) + { + attacksPriority=7; + } + if(attacksPriority==7) + { + if(Global::getWorldTime()>=attackTime) + { + if(turning) + { + switch(playerdir) + { + case 1: + changeAnimation("finalsmash_finish_left", NO_CHANGE); + break; + + case 2: + changeAnimation("finalsmash_finish_right", NO_CHANGE); + break; + } + x=xprevious; + y=yprevious; + xvelocity=0; + landing=true; + turning=true; + yvelocity=0; + setCantDo(); + attacksHolder=-1; + chargeSmash=0; + chargeAttack=0; + } + else + { + switch(playerdir) + { + case 1: + changeAnimation("finalsmash_finish_left", FORWARD); + break; + + case 2: + changeAnimation("finalsmash_finish_right", FORWARD); + break; + } + Emeralds*emeralds = new Emeralds(getPlayerNo(), x, y); + emeralds->changeAnimation("disappear", FORWARD); + createProjectile(emeralds); + + addProjectileInfo(2, emeralds->getID(), x, y); + + turning=true; + landing=true; + setCantDo(); + attacksHolder=-1; + chargeSmash=0; + chargeAttack=0; + } + } + else + { + x=xprevious; + y=yprevious; + setHanging(false); + landing=false; + setJumping(false); + attacksHolder=-1; + chargeSmash=0; + chargeAttack=0; + if(turning) + { + switch(playerdir) + { + case 1: + changeAnimation("finalsmash_transform_left", NO_CHANGE); + break; + + case 2: + changeAnimation("finalsmash_transform_right", NO_CHANGE); + break; + } + } + else + { + if(moveLeft>0) + { + String animName = getAnimName(); + if(animName.equals("finalsmash_stand_left") || animName.equals("finalsmash_stand_right")) + { + playerdir=1; + changeAnimation("finalsmash_turn_left", FORWARD); + } + else if(animName.equals("finalsmash_turn_left")) + { + playerdir=1; + int animpos = this->getCurrentFrame(); + if(animpos<=0) + { + x-=sonicSpeedRun*(float).25; + } + else if(animpos<=1) + { + x-=sonicSpeedRun*(float).5; + } + else + { + x-=sonicSpeedRun*(float).75; + } + } + else + { + x-=sonicSpeedRun; + playerdir=1; + changeAnimation("finalsmash_run_left", NO_CHANGE); + } + } + else if(moveRight>0) + { + String animName = getAnimName(); + if(animName.equals("finalsmash_stand_right") || animName.equals("finalsmash_stand_left")) + { + playerdir=2; + changeAnimation("finalsmash_turn_right", FORWARD); + } + else if(animName.equals("finalsmash_turn_right")) + { + playerdir=1; + int animpos = getCurrentFrame(); + if(animpos<=0) + { + x+=sonicSpeedRun*(float).25; + } + else if(animpos<=1) + { + x+=sonicSpeedRun*(float).5; + } + else + { + x+=sonicSpeedRun*(float).75; + } + } + else + { + x+=sonicSpeedRun; + playerdir=2; + changeAnimation("finalsmash_run_right", NO_CHANGE); + } + } + else + { + String animName = getAnimName(); + switch(playerdir) + { + case 1: + if(animName.equals("finalsmash_run_left")) + { + changeAnimation("finalsmash_stop_left", FORWARD); + } + else if(animName.equals("finalsmash_stop_left")) + { + playerdir=1; + int animpos = getCurrentFrame(); + if(animpos<=0) + { + x-=sonicSpeedRun*(float).75; + } + else if(animpos<=1) + { + x-=sonicSpeedRun*(float).5; + } + else + { + x-=sonicSpeedRun*(float).25; + } + } + else + { + changeAnimation("finalsmash_stand_left", NO_CHANGE); + } + break; + + case 2: + if(animName.equals("finalsmash_run_right")) + { + changeAnimation("finalsmash_stop_right", FORWARD); + } + else if(animName.equals("finalsmash_stop_right")) + { + playerdir=2; + int animpos = getCurrentFrame(); + if(animpos<=0) + { + x+=sonicSpeedRun*(float).75; + } + else if(animpos<=1) + { + x+=sonicSpeedRun*(float).5; + } + else + { + x+=sonicSpeedRun*(float).25; + } + } + else + { + changeAnimation("finalsmash_stand_right", NO_CHANGE); + } + break; + } + } + if(upKey) + { + y-=sonicSpeedRun; + } + else if(down) + { + y+=sonicSpeedRun; + } + } + } + + Rect borders = Global::currentStage->getViewBorders(); + if(x < (borders.left + Global::currentStage->x)) + { + x = (float)borders.left + (float)Global::currentStage->x + (float)width/2; + } + else if(x > (borders.right + Global::currentStage->x)) + { + x = (float)borders.right + (float)Global::currentStage->x - (float)width/2; + } + + if(y < (borders.top + Global::currentStage->y)) + { + y = (float)borders.top + (float)Global::currentStage->y + (float)height/2; + } + else if(y > (borders.bottom + Global::currentStage->y)) + { + y = (float)borders.bottom + (float)Global::currentStage->y - (float)height/2; + } + } + + xprevious = x; + yprevious = y; + } + + void Sonic::Draw(Graphics2D&g, long gameTime) + { + Player::Draw(g, gameTime); + } + + void Sonic::onAnimationFinish(const String&n) + { + if(n.equals("roll_left") || n.equals("roll_right") + || n.equals("special_charge_down_left") || n.equals("special_charge_down_right")) + { + // + } + else if(n.equals("finalsmash_stand_left") || n.equals("finalsmash_stand_right") + || n.equals("finalsmash_run_left") || n.equals("finalsmash_run_right")) + { + // + } + else if(n.equals("finalsmash_transform_left") || n.equals("finalsmash_transform_right")) + { + turning=false; + landing=false; + attacksPriority=7; + switch(playerdir) + { + case 1: + changeAnimation("finalsmash_stand_left", FORWARD); + break; + + case 2: + changeAnimation("finalsmash_stand_right", FORWARD); + break; + } + } + else if(n.equals("finalsmash_stop_left") || n.equals("finalsmash_stop_right")) + { + switch(playerdir) + { + case LEFT: + changeAnimation("finalsmash_stand_left",FORWARD); + break; + + case RIGHT: + changeAnimation("finalsmash_stand_right",FORWARD); + break; + } + } + else if(n.equals("finalsmash_turn_left") || n.equals("finalsmash_turn_right")) + { + switch(playerdir) + { + case LEFT: + changeAnimation("finalsmash_run_left",FORWARD); + break; + + case RIGHT: + changeAnimation("finalsmash_run_right",FORWARD); + break; + } + } + else if(n.equals("finalsmash_finish_left") || n.equals("finalsmash_finish_right")) + { + AttackTemplates::finishFinalSmash(this); + animFinish(); + attackTime=0; + turning=false; + finalSmashing=false; + } + else if(n.equals("smash_wind_left") || n.equals("smash_wind_right")) + { + winding = false; + AttackTemplates::normalSmash(this,15,3.11,STEP_GO,1,15,14,20); + } + else if(n.equals("air_prep_down_left")|| n.equals("air_prep_down_right")) + { + if(isOnGround()) + { + AttackTemplates::dropAirDownA(this, STEP_FINISH, 10, 3.545, 7, 2); + } + else + { + AttackTemplates::dropAirDownA(this, STEP_GO, 10, 3.545, 7, 2); + } + } + else if(n.equals("air_attack_down_left")|| n.equals("air_attack_down_right")) + { + AttackTemplates::dropAirDownA(this, STEP_FINISH, 10, 3.545, 7, 2); + } + else if(n.equals("air_land_down_left")|| n.equals("air_land_down_right")) + { + animFinish(); + y+=5; + } + else if(n.equals("special_prep_left") || n.equals("special_prep_right")) + { + xVel=0; + yVel=0; + landing=false; + AttackTemplates::homingB(this, 11, 3.88, 8.5f); + } + else if(n.equals("special_attack_left") || n.equals("special_attack_right")) + { + animFinish(); + switch(playerdir) + { + case LEFT: + changeAnimation("special_finish_left", FORWARD); + xvelocity=1; + break; + + case RIGHT: + changeAnimation("special_finish_right", FORWARD); + xvelocity=-1; + break; + } + yvelocity=-1; + } + else if(n.equals("special_prep_side_left") || n.equals("special_prep_side_right")) + { + animFinish(); + AttackTemplates::rollAttack(this, 12, 3.09, rollSpeed, 16); + xvelocity=0; + yvelocity=-5; + } + else + { + Player::onAnimationFinish(n); + } + } + + void Sonic::onGroundCollide() + { + Player::onGroundCollide(); + if(attacksHolder==10) + { + AttackTemplates::dropAirDownA(this, STEP_FINISH, 10, 3.445, 7, 2); + landing=true; + } + else if(attacksHolder==11) + { + switch(playerdir) + { + case 1: + animFinish(); + changeAnimation("special_finish_left", FORWARD); + break; + + case 2: + animFinish(); + changeAnimation("special_finish_right", FORWARD); + break; + } + landing = true; + } + else if((attacksHolder==13)&&(yvelocity>=0)) + { + yvelocity=-6; + switch(playerdir) + { + case 1: + changeAnimation("special_land_down_left", FORWARD); + break; + + case 2: + changeAnimation("special_land_down_right", FORWARD); + break; + } + } + } + + void Sonic::jump() + { + Player::jump((float)6,(float)6); + } + + void Sonic::onPlayerHit(Player*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + switch(attacksHolder) + { + case 0: + //A + if(hitAmount==0 && playerdir==LEFT) + { + causeDamage(collide,2); + collide->y-=3; + collide->x+=1; + causeHurt(collide, RIGHT, 1); + hitAmount++; + } + break; + + case 1: + //A + if(hitAmount==0 && playerdir==LEFT) + { + causeDamage(collide,2); + collide->y-=3; + collide->x+=1; + causeHurt(collide, RIGHT, 1); + hitAmount++; + } + break; + + case 2: + //A 3 + if(hitAmount==0 && playerdir==LEFT) + { + causeDamage(collide,3); + causeHurtLaunch(collide,-1,2.2f,2.9f, -1,2,1.9f); + causeHurt(collide, RIGHT, 4); + hitAmount++; + } + break; + + case 8: + //A Air Side + if(playerdir==LEFT) + { + switch(hitAmount) + { + case 0: + case 1: + causeDamage(collide,4); + collide->x-=3; + collide->y-=4; + x-=15; + if(yvelocity>-2) + { + yvelocity=-2; + } + hitAmount+=1; + causeHurt(collide, RIGHT, 3); + break; + + case 2: + causeDamage(collide,5); + causeHurtLaunch(collide,-1,3.2f,5.34f, -1,2.1f,2.9f); + causeHurt(collide, RIGHT, 6); + hitAmount+=1; + break; + } + } + break; + + case 11: + //B + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,8); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*4); + distY=(float)(((collide->y - y)/dist)*4); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + causeHurtLaunch(collide,multX,abs(distX),3.04f, multY,abs(distY),3.04f); + causeHurt(collide, RIGHT, 5); + yvelocity/=abs(yvelocity); + yvelocity*=-3; + xvelocity/=abs(xvelocity); + xvelocity*=-3; + if(abs(xvelocity)>4) + { + xvelocity = (xvelocity/abs(xvelocity))*3; + } + if(abs(yvelocity)>4) + { + yvelocity = (yvelocity/abs(yvelocity))*3; + } + animFinish(); + changeAnimation("special_finish_left", FORWARD); + bUp=false; + landing = true; + } + break; + + case 12: + //B side + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,15); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.2); + distY=(float)(((collide->y - y)/dist)*1.2); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide,multX,abs(distX),3.89f, -1,2.82f,3.89f); + break; + + case RIGHT: + causeHurtLaunch(collide,multX,abs(distX),3.89f, -1,1.12f,3.89f); + break; + } + } + else + { + causeHurtLaunch(collide,multX,abs(distX),3.89f, multY,abs(distY),3.89f); + } + causeHurt(collide, RIGHT, 5); + } + break; + + case 13: + //B Air Down + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,13); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*3.72); + distY=(float)(((collide->y - y)/dist)*3.72); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + causeHurtLaunch(collide,multX,abs(distX),5.98f, -1,3.72f,5.78f); + } + else + { + causeHurtLaunch(collide,multX,abs(distX),5.98f, multY,abs(distY),5.98f); + } + causeHurt(collide, RIGHT, 6); + } + break; + + case 14: + //B Down + if(!turning) + { + double dist; + int multX=1; + float distX; + causeDamage(collide,smashPower); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.72); + if(distX<0) + { + multX=-1; + } + causeHurtLaunch(collide,multX,abs(distX),((float)smashPower/4), -1,3.4f,((float)smashPower/4)); + causeHurt(collide, RIGHT, 6); + } + break; + + case 15: + //Smash Side + if(playerdir==LEFT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,3.23f,((float)smashPower/4), -1,1.4f,((float)smashPower/4)); + causeHurt(collide, RIGHT, smashPower/3); + } + break; + + case 17: + //Smash Down + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,2.43f,((float)smashPower/4), -1,5.64f,((float)smashPower/4)); + causeHurt(collide, RIGHT, smashPower/3); + break; + } + if(attacksPriority==7) + { + //final smash + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,20); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*6); + distY=(float)(((collide->y - y)/dist)*6); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + collide->y-=5; + causeHurtLaunch(collide,multX,abs(distX),6, multY,abs(distY),6); + causeHurt(collide, RIGHT, 4); + } + break; + + case DIR_RIGHT: + switch(attacksHolder) + { + case 0: + //A + if(hitAmount==0 && playerdir==RIGHT) + { + causeDamage(collide,2); + collide->y-=3; + collide->x-=1; + causeHurt(collide, LEFT, 1); + hitAmount++; + } + break; + + case 1: + //A + if(hitAmount==0 && playerdir==RIGHT) + { + causeDamage(collide,2); + collide->y-=3; + collide->x-=1; + causeHurt(collide, LEFT, 1); + hitAmount++; + } + break; + + case 2: + //A 3 + if(hitAmount==0 && playerdir==RIGHT) + { + causeDamage(collide,3); + causeHurtLaunch(collide,1,2.2f,2.9f, -1,2,1.9f); + causeHurt(collide, LEFT, 4); + hitAmount++; + } + break; + + case 8: + //A Air Side + if(playerdir==RIGHT) + { + switch(hitAmount) + { + case 0: + case 1: + causeDamage(collide,4); + collide->x+=3; + collide->y-=4; + x+=15; + if(yvelocity>-2) + { + yvelocity=-2; + } + hitAmount+=1; + causeHurt(collide, LEFT, 3); + break; + + case 2: + causeDamage(collide,5); + causeHurtLaunch(collide,1,3.2f,5.34f, -1,2.1f,2.9f); + causeHurt(collide, LEFT, 6); + hitAmount+=1; + break; + } + } + break; + + case 11: + //B + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,8); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*4); + distY=(float)(((collide->y - y)/dist)*4); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + causeHurtLaunch(collide,multX,abs(distX),3.04f, multY,abs(distY),3.04f); + causeHurt(collide, LEFT, 5); + yvelocity/=abs(yvelocity); + yvelocity*=-3; + xvelocity/=abs(xvelocity); + xvelocity*=-3; + if(abs(xvelocity)>4) + { + xvelocity = (xvelocity/abs(xvelocity))*3; + } + if(abs(yvelocity)>4) + { + yvelocity = (yvelocity/abs(yvelocity))*3; + } + animFinish(); + changeAnimation("special_finish_right", FORWARD); + bUp=false; + landing = true; + } + break; + + case 12: + //B Side + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,15); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.2); + distY=(float)(((collide->y - y)/dist)*1.2); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide,multX,abs(distX),3.89f, -1,1.12f,3.89f); + break; + + case RIGHT: + causeHurtLaunch(collide,multX,abs(distX),3.89f, -1,2.82f,3.89f); + break; + } + + } + else + { + causeHurtLaunch(collide,multX,abs(distX),3.89f, multY,abs(distY),3.89f); + } + causeHurt(collide, LEFT, 5); + } + break; + + case 13: + //B Air Down + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,13); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*3.72); + distY=(float)(((collide->y - y)/dist)*3.72); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + causeHurtLaunch(collide,multX,abs(distX),5.98f, -1,3.72f,5.78f); + } + else + { + causeHurtLaunch(collide,multX,abs(distX),5.98f, multY,abs(distY),5.98f); + } + causeHurt(collide, LEFT, 6); + } + break; + + case 14: + //B Down + if(!turning) + { + double dist; + int multX=1; + float distX; + causeDamage(collide,smashPower); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.72); + if(distX<0) + { + multX=-1; + } + causeHurtLaunch(collide,multX,abs(distX),((float)smashPower/4), -1,3.4f,((float)smashPower/4)); + causeHurt(collide, LEFT, 6); + } + break; + + case 15: + //Smash Side + if(playerdir==RIGHT) + { + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,3.23f,((float)smashPower/4), -1,1.4f,((float)smashPower/4)); + causeHurt(collide, LEFT, smashPower/3); + } + break; + + case 17: + //Smash Down + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,2.43f,((float)smashPower/4), -1,5.64f,((float)smashPower/4)); + causeHurt(collide, LEFT, smashPower/3); + break; + } + if(attacksPriority==7) + { + //final smash + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,20); + collide->y-=5; + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*6); + distY=(float)(((collide->y - y)/dist)*6); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + causeHurtLaunch(collide,multX,abs(distX),6, multY,abs(distY),6); + causeHurt(collide, LEFT, 4); + } + break; + + case DIR_UP: + switch(attacksHolder) + { + case 8: + //A Air Side + switch(hitAmount) + { + case 0: + case 1: + causeDamage(collide,4); + collide->y-=4; + if(yvelocity>-2) + { + yvelocity=-2; + } + hitAmount+=1; + causeHurt(collide, collide->getPlayerDir(), 3); + break; + + case 2: + causeDamage(collide,5); + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide,-1,1.2f,5.34f, -1,3.1f,2.9f); + causeHurt(collide, RIGHT, 6); + break; + + case RIGHT: + causeHurtLaunch(collide,1,1.2f,5.34f, -1,3.1f,2.9f); + causeHurt(collide, LEFT, 6); + break; + } + + hitAmount+=1; + break; + } + break; + + case 11: + //B + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,8); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*4); + distY=(float)(((collide->y - y)/dist)*4); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + causeHurtLaunch(collide,multX,abs(distX),3.04f, multY,abs(distY),3.04f); + if(collide->xx>x) + { + causeHurt(collide, LEFT, 5); + } + else + { + causeHurt(collide, collide->getPlayerDir(), 5); + } + yvelocity/=abs(yvelocity); + yvelocity*=-3; + xvelocity/=abs(xvelocity); + xvelocity*=-3; + if(abs(xvelocity)>4) + { + xvelocity = (xvelocity/abs(xvelocity))*3; + } + if(abs(yvelocity)>4) + { + yvelocity = (yvelocity/abs(yvelocity))*3; + } + animFinish(); + switch(playerdir) + { + case 1: + changeAnimation("special_finish_left", FORWARD); + break; + + case 2: + changeAnimation("special_finish_right", FORWARD); + break; + } + bUp=false; + landing = true; + } + break; + + case 12: + //B Side + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,15); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.2); + distY=(float)(((collide->y - y)/dist)*1.2); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + switch(playerdir) + { + case LEFT: + if(collide->xx>x) + { + causeHurtLaunch(collide, multX,abs(distX),3.89f, -1,2.82f,3.89f); + } + else + { + causeHurtLaunch(collide, multX,abs(distX),3.89f, -1,1.12f,3.89f); + } + break; + } + } + else + { + causeHurtLaunch(collide,multX,abs(distX),3.89f, multY,abs(distY),3.89f); + } + if(collide->xx>x) + { + causeHurt(collide, LEFT, 5); + } + else + { + causeHurt(collide, collide->getPlayerDir(), 5); + } + } + break; + + case 14: + //B Down + { + double dist; + int multX=1; + float distX; + causeDamage(collide,smashPower); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.72); + if(distX<0) + { + multX=-1; + } + causeHurtLaunch(collide,multX,abs(distX),((float)smashPower/4), -1,3.4f,((float)smashPower/4)); + if(collide->xx>x) + { + causeHurt(collide, LEFT, 6); + } + else + { + causeHurt(collide, collide->getPlayerDir(), 6); + } + } + break; + + case 17: + //Smash Down + switch(playerdir) + { + case LEFT: + causeDamage(collide,smashPower); + causeHurtLaunch(collide,-1,0,0, -1,5.36f,((float)smashPower/4)); + causeHurt(collide, RIGHT, 7); + break; + + case RIGHT: + causeDamage(collide,smashPower); + causeHurtLaunch(collide,1,0,0, -1,5.36f,((float)smashPower/4)); + causeHurt(collide, LEFT, 7); + break; + } + break; + } + if(attacksPriority==7) + { + //final smash + double dist; + int multY=1; + float distY; + causeDamage(collide,20); + dist=distance(x,y,collide->x,collide->y); + distY=(float)(((collide->y - y)/dist)*6); + if(distY<0) + { + multY=-1; + } + collide->y-=5; + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide,-1,0,0, multY,abs(distY),6); + causeHurt(collide, RIGHT, 4); + break; + + case RIGHT: + causeHurtLaunch(collide,1,0,0, multY,abs(distY),6); + causeHurt(collide, LEFT, 4); + break; + } + + } + break; + + case DIR_DOWN: + switch(attacksHolder) + { + case 8: + //A Air Side + switch(hitAmount) + { + case 0: + case 1: + causeDamage(collide,4); + collide->y-=4; + if(yvelocity>-2) + { + yvelocity=-2; + } + hitAmount+=1; + causeHurt(collide, collide->getPlayerDir(), 3); + break; + + case 2: + causeDamage(collide,5); + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide, -1,1.2f,5.34f, 1,3.1f,2.9f); + causeHurt(collide, RIGHT, 6); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,1.2f,5.34f, 1,3.1f,2.9f); + causeHurt(collide, LEFT, 6); + break; + } + + hitAmount+=1; + break; + } + break; + + case 11: + //B + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,8); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*4); + distY=(float)(((collide->y - y)/dist)*4); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + causeHurtLaunch(collide, multX,abs(distX),3.04f, multY,abs(distY),3.04f); + if(collide->xx>x) + { + causeHurt(collide, LEFT, 5); + } + else + { + causeHurt(collide, collide->getPlayerDir(), 5); + } + yvelocity/=abs(yvelocity); + yvelocity*=-3; + xvelocity/=abs(xvelocity); + xvelocity*=-3; + if(abs(xvelocity)>4) + { + xvelocity = (xvelocity/abs(xvelocity))*3; + } + if(abs(yvelocity)>4) + { + yvelocity = (yvelocity/abs(yvelocity))*3; + } + animFinish(); + switch(playerdir) + { + case 1: + changeAnimation("special_finish_left", FORWARD); + break; + + case 2: + changeAnimation("special_finish_right", FORWARD); + break; + } + bUp=false; + landing = true; + } + break; + + case 12: + //B Side + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,15); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*1.2); + distY=(float)(((collide->y - y)/dist)*1.2); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + switch(playerdir) + { + case LEFT: + if(collide->xx>x) + { + causeHurtLaunch(collide, multX,abs(distX),3.89f, 1,2.82f,3.89f); + } + else + { + causeHurtLaunch(collide, multX,abs(distX),3.89f, 1,1.12f,3.89f); + } + break; + } + + } + else + { + causeHurtLaunch(collide, multX,abs(distX),3.89f, multY,abs(distY),3.89f); + } + if(collide->xx>x) + { + causeHurt(collide, LEFT, 5); + } + else + { + causeHurt(collide, collide->getPlayerDir(), 5); + } + } + break; + + case 13: + //B Air Down + { + double dist; + int multX=1; + int multY=1; + float distX; + float distY; + causeDamage(collide,13); + dist=distance(x,y,collide->x,collide->y); + distX=(float)(((collide->x - x)/dist)*3.72); + distY=(float)(((collide->y - y)/dist)*3.72); + if(distX<0) + { + multX=-1; + } + if(distY<0) + { + multY=-1; + } + if(collide->isOnGround()) + { + causeHurtLaunch(collide, multX,abs(distX),5.98f, 1,3.72f,5.78f); + } + else + { + causeHurtLaunch(collide, multX,abs(distX),5.98f, multY,abs(distY),5.98f); + } + if(collide->xx>x) + { + causeHurt(collide, LEFT, 6); + } + else + { + causeHurt(collide, collide->getPlayerDir(), 6); + } + } + break; + + case 17: + //Smash Down + switch(playerdir) + { + case LEFT: + causeDamage(collide,smashPower); + causeHurtLaunch(collide, -1,0,0, 1,5.36f,((float)smashPower/4)); + causeHurt(collide, RIGHT, 7); + break; + + case RIGHT: + causeDamage(collide,smashPower); + causeHurtLaunch(collide, 1,0,0, 1,5.36f,((float)smashPower/4)); + causeHurt(collide, LEFT, 7); + break; + } + break; + } + if(attacksPriority==7) + { + //final smash + double dist; + int multY=1; + float distY; + causeDamage(collide,20); + dist=distance(x,y,collide->x,collide->y); + distY=(float)(((collide->y - y)/dist)*6); + if(distY<0) + { + multY=-1; + } + collide->y-=5; + switch(playerdir) + { + case LEFT: + causeHurtLaunch(collide, -1,0,0, multY,abs(distY),6); + causeHurt(collide, RIGHT, 4); + break; + + case RIGHT: + causeHurtLaunch(collide, 1,0,0, multY,abs(distY),6); + causeHurt(collide, LEFT, 4); + break; + } + } + break; + } + } + + void Sonic::onPlayerRectHit(Player*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + if(attacksHolder==16) + { + //Smash Up + switch(playerdir) + { + case LEFT: + switch(hitAmount) + { + case 0: + case 1: + case 2: + causeDamage(collide,(int)(smashPower/3.5)); + collide->y-=collide->height; + collide->yvelocity=1; + collide->x=x-10; + causeHurt(collide, RIGHT, 3); + hitAmount+=1; + break; + + case 3: + causeDamage(collide,(int)(smashPower/3.5)); + causeHurtLaunch(collide,-1,3.43f,((float)smashPower/4), -1,2.64f,((float)smashPower/4)); + causeHurt(collide, RIGHT, 7); + hitAmount+=1; + break; + } + break; + + case RIGHT: + switch(hitAmount) + { + case 0: + case 1: + case 2: + causeDamage(collide,(int)(smashPower/3.5)); + collide->y-=collide->height; + collide->yvelocity=1; + collide->x=x-10; + causeHurt(collide, RIGHT, 3); + hitAmount+=1; + break; + + case 3: + causeDamage(collide,(int)(smashPower/3.5)); + causeHurtLaunch(collide,-1,3.43f,((float)smashPower/4), -1,2.64f,((float)smashPower/4)); + causeHurt(collide, RIGHT, 7); + hitAmount+=1; + break; + } + break; + } + } + break; + + case DIR_RIGHT: + if(attacksHolder==16) + { + //Smash Up + switch(playerdir) + { + case LEFT: + switch(hitAmount) + { + case 0: + case 1: + case 2: + causeDamage(collide,(int)(smashPower/3.5)); + collide->y-=collide->height; + collide->yvelocity=1; + collide->x=x+10; + causeHurt(collide, LEFT, 3); + hitAmount+=1; + break; + + case 3: + causeDamage(collide,(int)(smashPower/3.5)); + causeHurtLaunch(collide,1,3.43f,((float)smashPower/4), -1,2.64f,((float)smashPower/4)); + causeHurt(collide, LEFT, 7); + hitAmount+=1; + break; + } + break; + + case RIGHT: + switch(hitAmount) + { + case 0: + case 1: + case 2: + causeDamage(collide,(int)(smashPower/3.5)); + collide->y-=collide->height; + collide->yvelocity=1; + collide->x=x+10; + causeHurt(collide, LEFT, 3); + hitAmount+=1; + break; + + case 3: + causeDamage(collide,(int)(smashPower/3.5)); + causeHurtLaunch(collide,1,3.43f,((float)smashPower/4), -1,2.64f,((float)smashPower/4)); + causeHurt(collide, LEFT, 7); + hitAmount+=1; + break; + } + break; + } + } + break; + + case DIR_UP: + if(attacksHolder==16) + { + //Smash Up + switch(hitAmount) + { + case 0: + case 1: + case 2: + causeDamage(collide,(int)(smashPower/3.5)); + collide->y-=15; + causeHurt(collide, collide->getPlayerDir(), 3); + hitAmount+=1; + break; + + case 3: + causeDamage(collide,(int)(smashPower/3.5)); + causeHurtLaunch(collide,1,0,0, -1,5.26f,((float)smashPower/4)); + causeHurt(collide, collide->getPlayerDir(), 7); + hitAmount+=1; + break; + } + } + break; + } + } + + void Sonic::onFinishCharge() + { + // + } + + void Sonic::doChargingAttack(byte button) + { + if(chargeAttack==1) + { + destroyCharge(); + rocketSpeed = (float)smashPower; + AttackTemplates::rollAttack(this, 14, 2.895, rocketSpeed, 50); + chargeAttack = 0; + } + } + + void Sonic::attackA() + { + addAttackInfo(DIR_UP, 3, LEFT, 3, 4, -1,1.2f,2.9f, -1,3,1.9f); + addAttackInfo(DIR_UP, 3,RIGHT, 3, 4, 1,1.2f,2.9f, -1,3,1.9f); + addAttackInfo(DIR_LEFT, 7, LEFT, 11, 5, -1,2.64f,5.7f, -1,1.4f,3); + addAttackInfo(DIR_LEFT, 7,RIGHT, 11, 5, -1,2.3f,5.3f, -1,1.05f,2.9f); + addAttackInfo(DIR_RIGHT,7, LEFT, 11, 5, 1,2.3f,5.3f, -1,1.05f,2.9f); + addAttackInfo(DIR_RIGHT,7,RIGHT, 11, 5, 1,2.64f,5.7f, -1,1.4f,3); + addAttackInfo(DIR_UP, 7, LEFT, 11, 6, -1,0.4f,2.2f, -1,3.21f,5.77f); + addAttackInfo(DIR_UP, 7,RIGHT, 11, 6, 1,0.4f,2.2f, -1,3.21f,5.77f); + addAttackInfo(DIR_DOWN, 7, LEFT, 11, 5, -1,2.3f,5.3f, 1,2.05f,2.6f); + addAttackInfo(DIR_DOWN, 7,RIGHT, 11, 5, 1,2.3f,5.3f, 1,2.05f,2.6f); + + if(attacksPriority!=7 && !checkItemUse()) + { + if(isOnGround()) + { + AttackTemplates::combo3A(this, 5, 0,1.3, 1,1.45, 2,2.19); + switch(playerdir) + { + case 1: + x-=5; + break; + + case 2: + x+=5; + break; + } + } + else + { + AttackTemplates::normalAirA(this, 7,2.95); + } + } + } + + void Sonic::attackSideA() + { + addAttackInfo(DIR_LEFT, 3, LEFT, 11, 5, -1,2.1f,3.4f, -1,2.1f,3.4f); + addAttackInfo(DIR_RIGHT,3,RIGHT, 11, 5, 1,2.1f,3.4f, -1,2.1f,3.4f); + addAttackInfo(DIR_LEFT, 4, LEFT, 6, 6, -1,1.1f,2.8f, -1,3,5.8f); + addAttackInfo(DIR_RIGHT,4,RIGHT, 6, 6, 1,1.1f,2.8f, -1,3,5.8f); + addAttackInfo(DIR_UP, 3, LEFT, 11, 5, -1,1.6f,3.4f, -1,3.34f,3.4f); + addAttackInfo(DIR_UP, 3,RIGHT, 11, 5, 1,1.6f,3.4f, -1,3.34f,3.4f); + addAttackInfo(DIR_UP, 4, LEFT, 6, 6, -1,1.1f,1.8f, -1,3.5f,5.8f); + addAttackInfo(DIR_UP, 4,RIGHT, 6, 6, 1,1.1f,1.8f, -1,3.5f,5.8f); + addAttackInfo(DIR_DOWN, 4, LEFT, 6, 6, -1,1.56f,4, 1,2.2f,3.8f); + addAttackInfo(DIR_DOWN, 4,RIGHT, 6, 6, 1,1.56f,4, 1,2.2f,3.8f); + + if(attacksPriority!=7) + { + if(((getMoveLeft()==2) || (getMoveRight()==2)) && (isOnGround())) + { + AttackTemplates::normalDashA(this, 4,3.875, 8); + } + else + { + if(!checkItemUseSide()) + { + if(isOnGround()) + { + AttackTemplates::normalSideA(this, 3,2.79); + } + else + { + AttackTemplates::rehitAirSideA(this, 8,3.12); + } + } + } + } + } + + void Sonic::attackUpA() + { + addAttackInfo(DIR_LEFT, 5, LEFT, 10, 6, -1,2,4.1f, -1,3,4.9f); + addAttackInfo(DIR_LEFT, 5,RIGHT, 10, 6, -1,3.1f,4.3f, -1,2.2f,3.8f); + addAttackInfo(DIR_RIGHT,5, LEFT, 10, 6, 1,3.1f,4.3f, -1,2.2f,3.8f); + addAttackInfo(DIR_RIGHT,5,RIGHT, 10, 6, 1,2,4.1f, -1,3,4.9f); + addAttackInfo(DIR_LEFT, 9, LEFT, 9, 4, -1,1,1.2f, -1,3,3.3f); + addAttackInfo(DIR_RIGHT,9,RIGHT, 9, 4, 1,1,1.2f, -1,3,3.3f); + addAttackInfo(DIR_UP, 5, LEFT, 10, 6, -1,0.4f,1.1f, -1,4.87f,6.03f); + addAttackInfo(DIR_UP, 5,RIGHT, 10, 6, 1,0.4f,1.1f, -1,4.87f,6.03f); + addAttackInfo(DIR_UP, 9, LEFT, 9, 4, -1,0.2f,1.2f, -1,4.23f,5.3f); + addAttackInfo(DIR_UP, 9,RIGHT, 9, 4, 1,0.2f,1.2f, -1,4.23f,5.3f); + + if(attacksPriority!=7) + { + if(isOnGround()) + { + AttackTemplates::normalUpA(this, 5,2.74); + } + else + { + AttackTemplates::normalAirUpA(this, 9,2.53); + } + } + } + + void Sonic::attackDownA() + { + addAttackInfo(DIR_LEFT, 6, LEFT, 6, 6, -1,2.1f,5.4f, -1,3.12f,6); + addAttackInfo(DIR_LEFT, 6,RIGHT, 6, 6, -1,1.95f,5.4f, -1,3.03f,6); + addAttackInfo(DIR_RIGHT,6, LEFT, 6, 6, 1,1.95f,5.4f, -1,3.03f,6); + addAttackInfo(DIR_RIGHT,6,RIGHT, 6, 6, 1,2.1f,5.4f, -1,3.12f,6); + addAttackInfo(DIR_LEFT, 10, LEFT, 8, 6, -1,1,1.3f, -1,4.2f,5.3f); + addAttackInfo(DIR_LEFT, 10,RIGHT, 8, 6, -1,1,1.3f, -1,4.2f,5.3f); + addAttackInfo(DIR_RIGHT,10, LEFT, 8, 6, 1,1,1.3f, -1,4.2f,5.3f); + addAttackInfo(DIR_RIGHT,10,RIGHT, 8, 6, 1,1,1.3f, -1,4.2f,5.3f); + addAttackInfo(DIR_UP, 6, LEFT, 6, 6, -1,2.4f,5.1f, -1,4.92f,6.13f); + addAttackInfo(DIR_UP, 6,RIGHT, 6, 6, 1,2.4f,5.1f, -1,4.92f,6.13f); + addAttackInfo(DIR_UP, 10, LEFT, 8, 6, -1,0.3f,1.3f, -1,4.6f,5.3f); + addAttackInfo(DIR_UP, 10,RIGHT, 8, 6, 1,0.3f,1.3f, -1,4.6f,5.3f); + addAttackInfo(DIR_DOWN, 6, LEFT, 6, 6, -1,1.25f,5.4f, 1,3.2f,3); + addAttackInfo(DIR_DOWN, 6,RIGHT, 6, 6, 1,1.25f,5.4f, 1,3.2f,3); + addAttackInfo(DIR_DOWN, 10, LEFT, 8, 6, -1,0.3f,1.3f, -1,4.6f,5.3f); + addAttackInfo(DIR_DOWN, 10,RIGHT, 8, 6, 1,0.3f,1.3f, -1,4.6f,5.3f); + + if(attacksPriority!=7) + { + if(isOnGround()) + { + AttackTemplates::normalDownA(this, 6,2.96); + switch(playerdir) + { + case 1: + x-=4; + break; + + case 2: + x+=4; + break; + } + } + else + { + AttackTemplates::dropAirDownA(this, STEP_CHARGE, 10, 3.445, 7, 1.2f); + } + } + } + + void Sonic::attackB() + { + if(attacksPriority!=7 && !bUp) + { + if(canFinalSmash()) + { + attackFinalSmash(); + } + else + { + if(!bUp) + { + bUp=true; + yVel=-2; + landing=true; + switch(playerdir) + { + case 1: + changeAnimation("special_prep_left", FORWARD); + break; + + case 2: + changeAnimation("special_prep_right", FORWARD); + break; + } + } + } + } + } + + void Sonic::attackSideB() + { + + if(attacksPriority!=7 && !bUp) + { + bUp=true; + landing=true; + switch(playerdir) + { + case 1: + changeAnimation("special_prep_side_left", FORWARD); + break; + + case 2: + changeAnimation("special_prep_side_right", FORWARD); + break; + } + } + } + + void Sonic::attackUpB() + { + if(attacksPriority!=7 && !bUp) + { + AttackTemplates::launchUpB(this, -1,8, 7.5f,7.5f); + y-=34; + + Spring*spring = new Spring(getPlayerNo(), x, y + ((float)height/2)+23); + createProjectile(spring); + + addProjectileInfo(1, spring->getID(), x, y + ((float)height/2)+23); + } + } + + void Sonic::attackDownB() + { + if(attacksPriority!=7) + { + smashPower=0; + if(isOnGround()) + { + AttackTemplates::chargeB(this, 4, 10, 14); + switch(playerdir) + { + case LEFT: + changeAnimation("special_charge_down_left",FORWARD); + break; + + case RIGHT: + changeAnimation("special_charge_down_right",FORWARD); + break; + } + chargeAttack = 1; + } + else + { + AttackTemplates::bounceDownB(this,13,3.76, 10); + } + } + } + + void Sonic::attackSideSmash(byte type) + { + if(attacksPriority!=7 && !(checkItemUseSmash(type))&&(!bUp)) + { + if(isOnGround()) + { + if(type == STEP_CHARGE) + { + AttackTemplates::normalSmash(this,15,2.91,type,1,15,14,20); + } + else + { + winding = true; + switch(playerdir) + { + case LEFT: + changeAnimation("smash_wind_left",FORWARD); + break; + + case RIGHT: + changeAnimation("smash_wind_right",FORWARD); + break; + } + } + } + else + { + attackSideA(); + } + } + } + + void Sonic::attackUpSmash(byte type) + { + if(attacksPriority!=7 && !bUp) + { + hitAmount=0; + if(isOnGround()) + { + AttackTemplates::normalSmash(this,16,3.26,type,2,18,14,20); + if(type==STEP_GO) + { + y-=15; + yVel=-1; + } + } + else + { + attackUpA(); + } + } + } + + void Sonic::attackDownSmash(byte type) + { + if(attacksPriority!=7 && !bUp) + { + if(isOnGround()) + { + AttackTemplates::normalSmash(this,17,3.5,type,3,18,12,20); + } + else + { + attackDownA(); + } + } + } + + void Sonic::attackFinalSmash() + { + if(!bUp) + { + AttackTemplates::finalSmash(this, -1); + attacksPriority=7; + landing=true; + turning=true; + xvelocity=0; + yvelocity=0; + attackTime=Global::getWorldTime()+150; + chargeSmash=0; + smashPower=0; + finalSmashing = true; + switch(playerdir) + { + case 1: + { + changeAnimation("finalsmash_transform_left", FORWARD); + Emeralds*emeralds = new Emeralds(getPlayerNo(), x, y); + emeralds->changeAnimation("appear", FORWARD); + createProjectile(emeralds); + + addProjectileInfo(2, emeralds->getID(), x, y); + } + break; + + case 2: + { + changeAnimation("finalsmash_transform_right", FORWARD); + Emeralds*emeralds = new Emeralds(getPlayerNo(), x, y); + emeralds->changeAnimation("appear", FORWARD); + createProjectile(emeralds); + + addProjectileInfo(2, emeralds->getID(), x, y); + } + break; + } + } + } + + Sonic::Spring::Spring(byte playerNo, float x1, float y1) : Projectile(playerNo,x1,y1) + { + deadTime=Global::getWorldTime()+50; + + addAnimation(new Animation("normal", 1, "Images/Game/Characters/Sonic/spring_normal.png")); + Animation*anim = new Animation("bounce", 20, 5, 1); + anim->addFrame("Images/Game/Characters/Sonic/spring_bounce.png"); + addAnimation(anim); + + changeAnimation("normal",FORWARD); + + setSolid(true); + } + + Sonic::Spring::~Spring() + { + // + } + + void Sonic::Spring::Update(long gameTime) + { + yvelocity+=0.5; + + if(deadTime>0) + { + if(deadTime<=Global::getWorldTime()) + { + destroy(); + } + } + Projectile::Update(gameTime); + } + + void Sonic::Spring::onAnimationFinish(const String&n) + { + if(n.equals("bounce")) + { + changeAnimation("normal",FORWARD); + } + } + + void Sonic::Spring::onPlayerHit(Player*collide, byte dir) + { + if(dir==DIR_UP) + { + if(collide->getPlayerNo()>0 && !collide->isHanging()) + { + if(collide->yvelocity<=5 && collide->yvelocity>=0) + { + collide->yvelocity=-5; + } + else + { + collide->yvelocity=-abs(collide->yvelocity); + } + changeAnimation("bounce", FORWARD); + } + } + } + + void Sonic::Spring::whilePlatformColliding(Platform*collide, byte dir) + { + switch(dir) + { + case DIR_UP: + yvelocity*=0; + break; + + case DIR_DOWN: + yvelocity*=0; + break; + + case DIR_LEFT: + xvelocity*=0; + break; + + case DIR_RIGHT: + xvelocity*=0; + break; + } + } + + Sonic::Emeralds::Emeralds(byte playerNo, float x1, float y1) : Projectile(playerNo, x1, y1) + { + Animation*anim = new Animation("appear", 10, 7, 1); + anim->addFrame("Images/Game/Characters/Sonic/finalsmash_emeralds.png"); + addAnimation(anim); + + ArrayList seq; seq.add(6); seq.add(5); seq.add(4); seq.add(3); + anim = new Animation("disappear", 4, 7, 1, seq); + anim->addFrame("Images/Game/Characters/Sonic/finalsmash_emeralds.png"); + addAnimation(anim); + + changeAnimation("appear",FORWARD); + } + + Sonic::Emeralds::~Emeralds() + { + // + } + + void Sonic::Emeralds::onAnimationFinish(const String&n) + { + destroy(); + } +} \ No newline at end of file diff --git a/SmashBros/Sonic.h b/SmashBros/Sonic.h new file mode 100755 index 0000000..f11c263 --- /dev/null +++ b/SmashBros/Sonic.h @@ -0,0 +1,98 @@ +#include "Player.h" + +#pragma once + +namespace SmashBros +{ + class Sonic : public Player + { + private: + typedef struct + { + byte type; + int projID; + float x; + float y; + } ProjectileInfo; + + void addProjectileInfo(byte type, int projID, float x, float y); + + ArrayList createdProjectiles; + + class Spring : public Projectile + { + private: + long deadTime; + + public: + Spring(byte playerNo, float x1, float y1); + virtual ~Spring(); + + virtual void Update(long gameTime); + + virtual void onAnimationFinish(const String&n); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void whilePlatformColliding(Platform*collide, byte dir); + + }; + + class Emeralds : public Projectile + { + public: + Emeralds(byte playerNo, float x1, float y1); + virtual ~Emeralds(); + + virtual void onAnimationFinish(const String&n); + }; + + boolean turning; + boolean winding; + boolean finalSmashing; + byte chargeAttack; + + float xprevious; + float yprevious; + + float rollSpeed; + float rocketSpeed; + float sonicSpeedRun; + + public: + Sonic(float x1, float y1, byte playerNo, byte team); + virtual ~Sonic(); + + virtual void addP2PData(DataVoid&data); + virtual void setP2PData(byte*&data); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + virtual void Load(); + virtual void LoadAttackTypes(); + virtual void setToDefaultValues(); + virtual void onDestroy(); + virtual boolean checkIfAble(); + + virtual void onAnimationFinish(const String&n); + virtual void onGroundCollide(); + virtual void jump(); + virtual void onPlayerHit(Player*collide, byte dir); + virtual void onPlayerRectHit(Player*collide, byte dir); + + virtual void onFinishCharge(); + virtual void doChargingAttack(byte button); + + virtual void attackA(); + virtual void attackSideA(); + virtual void attackUpA(); + virtual void attackDownA(); + virtual void attackB(); + virtual void attackSideB(); + virtual void attackUpB(); + virtual void attackDownB(); + virtual void attackSideSmash(byte type); + virtual void attackUpSmash(byte type); + virtual void attackDownSmash(byte type); + virtual void attackFinalSmash(); + }; +} \ No newline at end of file diff --git a/SmashBros/SoundManager.cpp b/SmashBros/SoundManager.cpp new file mode 100644 index 0000000..3605621 --- /dev/null +++ b/SmashBros/SoundManager.cpp @@ -0,0 +1,85 @@ + +#include "SoundManager.h" + +namespace SmashBros +{ + SoundManager::SoundDict::SoundDict() + { + name = ""; + sound = NULL; + } + + SoundManager::SoundDict::SoundDict(const String&name, Sound*sound) + { + this->name = name; + this->sound = sound; + } + + SoundManager::SoundDict::~SoundDict() + { + if(sound!=NULL) + { + delete sound; + } + } + + SoundManager::SoundManager() + { + sounds = ArrayList(); + } + + SoundManager::~SoundManager() + { + for(int i=0; iname.equals(name)) + { + return true; + } + } + + Sound*sound = new Sound(); + if(sound->loadFromFile(filePath)) + { + sounds.add(new SoundDict(name,sound)); + return true; + } + delete sound; + return false; + } + + void SoundManager::playSound(const String&name) + { + for(int i=0; iname.equals(name)) + { + dict->sound->play(); + return; + } + } + } + + Sound*SoundManager::getSound(const String&name) + { + for(int i=0; iname.equals(name)) + { + return dict->sound; + } + } + return NULL; + } +} \ No newline at end of file diff --git a/SmashBros/SoundManager.h b/SmashBros/SoundManager.h new file mode 100644 index 0000000..1b6f13e --- /dev/null +++ b/SmashBros/SoundManager.h @@ -0,0 +1,33 @@ + +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class SoundManager + { + private: + class SoundDict + { + friend class SoundManager; + private: + Sound*sound; + String name; + public: + SoundDict(); + SoundDict(const String&name, Sound*sound); + ~SoundDict(); + }; + + ArrayList sounds; + + public: + SoundManager(); + ~SoundManager(); + + bool loadSound(const String&name, const String&filePath); + void playSound(const String&name); + Sound*getSound(const String&name); + }; +} \ No newline at end of file diff --git a/SmashBros/Stage.cpp b/SmashBros/Stage.cpp new file mode 100755 index 0000000..50ac6c1 --- /dev/null +++ b/SmashBros/Stage.cpp @@ -0,0 +1,1059 @@ +#include "Stage.h" +#include "Global.h" +#include "ProjectileManager.h" +#include "ItemManager.h" +#include "Camera.h" + +namespace SmashBros +{ + Stage::Stage(int x1, int y1) + { + x = x1; + y = y1; + + bgScale = 1; + + background = null; + + topBorder = -350; + bottomBorder = 350; + leftBorder = -500; + rightBorder = 500; + + topViewBorder = -300; + bottomViewBorder = 300; + leftViewBorder = -450; + rightViewBorder = 450; + + showItemBounds = false; + showWires = false; + + bgType = 0; + + gravity = 0.15; + + MusicManager::loadSong("Main Theme Remix"); + } + + Stage::~Stage() + { + if(background!=null) + { + delete background; + } + + for(int i=0; isetVisible(toggle); + } + for(int i=0; isetVisible(toggle); + } + showItemBounds = toggle; + showWires = toggle; + } + + void Stage::setWireframeColor(const Color&color) + { + for(int i=0; igetCollideType()) + { + case Platform::COLLIDE_BOX: + platforms.get(i)->getBox()->setColor(color); + break; + + case Platform::COLLIDE_SOLID: + platforms.get(i)->setWireframeColor(color); + break; + } + } + for(int i=0; isetColor(color); + } + } + + void Stage::setElementColor(const Color&color) + { + for(int i=0; isetColor(color); + } + } + + void Stage::Update(long gameTime) + { + for(int i=1; i<=Global::possPlayers; i++) //TODO: loop characters + { + if(Global::characters[i]!=null) + { + Global::characters[i]->Update(gameTime); + } + } + + for(int i=0; iUpdate(gameTime); + } + for(int i=0; iUpdate(gameTime); + updateElement(i); + } + for(int i=0; iUpdate(gameTime); + updateHangPoint(i); + } + for(int i=0; iUpdate(gameTime); + updateGround(i); + } + + ProjectileManager::Update(gameTime); + ItemManager::Update(gameTime); + + for(int i=0; i<=Global::possPlayers; i++) //TODO: loop characters + { + if(Global::characters[i]!=null) + { + + checkPlayerCollisions(Global::characters[i]); + } + } + } + + void Stage::Draw(Graphics2D&g, long gameTime) + { + drawBackground(g,gameTime); + drawBottomLayer(g,gameTime); + drawMiddleLayer(g,gameTime); + drawTopLayer(g,gameTime); + } + + void Stage::drawBackground(Graphics2D&g, long gameTime) + { + if(background!=null) + { + switch(bgType) + { + case BG_NORMAL: + background->drawFrame(null, g, (float)(x*Camera::Zoom), (float)(y*Camera::Zoom), bgScale*Camera::Zoom); + break; + + case BG_FIXED: + background->drawFrame(null, g, 0, View::x, View::y, (float)View::ScaleWidth(), (float)View::ScaleHeight()); + break; + } + } + } + + void Stage::drawBottomLayer(Graphics2D&g, long gameTime) + { + for(int i=0; iDraw(g, gameTime); + } + + ProjectileManager::DrawBottomLayer(g, gameTime); + + for(int i=0; isetVisible(true); + ground.get(i)->setAlpha(0.5f); + } + else + { + ground.get(i)->setVisible(false); + ground.get(i)->setAlpha(0); + } + ground.get(i)->Draw(g, gameTime); + } + for(int i=0; iDraw(g, gameTime); + } + } + + void Stage::drawMiddleLayer(Graphics2D&g, long gameTime) + { + ItemManager::Draw(g, gameTime); + + for(int i=0; iDraw(g, gameTime); + } + if(showItemBounds) + { + g.setColor(Color::GREEN); + g.drawRect((itemBounds.x*Camera::Zoom - View::x), (itemBounds.y*Camera::Zoom - View::y), (itemBounds.width*Camera::Zoom), (itemBounds.height*Camera::Zoom)); + } + for(int i=1; i<=Global::possPlayers; i++) //TODO: loop characters + { + if(Global::characters[i]!=null) + { + Global::characters[i]->Draw(g, gameTime); + } + } + ProjectileManager::DrawMiddleLowerLayer(g, gameTime); + } + + void Stage::drawTopLayer(Graphics2D&g, long gameTime) + { + ProjectileManager::DrawMiddleUpperLayer(g, gameTime); + for(int i=0; iDraw(g, gameTime); + } + ProjectileManager::DrawTopLayer(g, gameTime); + } + + void Stage::checkPlayerCollisions(Player*playr) + { + boolean setGrounded = playr->groundCheck; + for(byte j=1; j<8; j++) + { + playr->prevCollidePlatform[j-1] = playr->currentCollidePlatform[j-1]; + } + byte borderDir = borderColliding(playr); + if(borderDir > 0) + { + playr->onBorderCollide(borderDir); + } + else + { + for(int j=0; jgroundColliding) + { + if(!playr->prevHangColliding) + { + playr->hangColliding = true; + playr->currentHangPoint = hangs.get(j); + playr->onHang(hangs.get(j)); + j = hangs.size(); + } + else + { + playr->whileHanging(playr->currentHangPoint); + } + } + else if(playr->currentHangPoint == hangs.get(j) && playr->prevHangColliding) + { + playr->hangColliding = false; + playr->finishHang(playr->currentHangPoint); + j = hangs.size(); + } + } + if(!playr->hangColliding) + { + for(int j=0; jisColliding(ground.get(j))) + { + if(!setGrounded) + { + playr->whileGroundColliding(); + } + playr->groundColliding = true; + if(!playr->prevGroundColliding) + { + playr->onGroundCollide(); + } + setGrounded = true; + } + } + } + for(int i=0; i<8; i++) + { + playr->currentCollidePlatformActor[i] = null; + } + for(int j=0; j0) + { + playr->platformCollision(platforms.get(j), dir); + playr->currentCollidePlatformActor[dir] = platforms.get(j); + playr->collideQueue.add(dir); + } + boolean grounded = false; + if(dir == PrimitiveActor::DIR_UP || platforms.get(j)->checkGroundCollision(playr)) + { + grounded = true; + } + if(grounded && !playr->hangColliding) + { + playr->groundColliding = true; + if(playr->prevGroundColliding || setGrounded) + { + playr->whileGroundColliding(); + } + else + { + playr->onGroundCollide(); + } + setGrounded = true; + } + } + if(playr->prevGroundColliding && !setGrounded) + { + playr->groundColliding = false; + playr->finishGroundCollide(); + } + for(byte j=1; j<=8; j++) + { + playr->currentCollidePlatform[j-1] = false; + } + for(int j=0; jcollideQueue.size(); j++) + { + playr->currentCollidePlatform[playr->collideQueue.get(j)-1] = true; + } + for(byte j=1; j<=8; j++) + { + if(!playr->currentCollidePlatform[j-1] && playr->prevCollidePlatform[j-1]) + { + playr->finishPlatformCollide(playr->currentCollidePlatformActor[j], j); + } + } + playr->prevGroundColliding = playr->groundColliding; + playr->prevHangColliding = playr->hangColliding; + } + } + + /** + * Sets the gravity amount. The default is 0.15 + *

+ * @param grav decimal value that represents gravity + */ + void Stage::setGravity(double grav) + { + gravity = grav; + } + + double Stage::getGravity() + { + return gravity; + } + + void Stage::addElement(GameElement*a) + { + Vector2 pnt; + + pnt.x.x = a->x; + pnt.x.y = a->y; + pnt.y.x = a->x + x; + pnt.y.y = a->y + y; + + a->x += x; + a->y += y; + + ArrayList animFiles = a->getAnimation()->getAllFilenames(); + for(int i=0; i pnt; + + if(plat->getCollideType() == Platform::COLLIDE_SOLID) + { + ArrayList animFiles = plat->getAnimation()->getAllFilenames(); + for(int i=0; ix; + pnt.x.y = plat->y; + pnt.y.x = plat->x + x; + pnt.y.y = plat->y + y; + + plat->x += x; + plat->y += y; + + platCoords.add(pnt); + platforms.add(plat); + } + + void Stage::addForeground(GameElement*a) + { + Vector2 pnt; + + pnt.x.x = a->x; + pnt.x.y = a->y; + pnt.y.x = a->x + x; + pnt.y.y = a->y + y; + + a->x += x; + a->y += y; + + ArrayList animFiles = a->getAnimation()->getAllFilenames(); + for(int i=0; i pnt; + + pnt.x.x = hp->x; + pnt.x.y = hp->y; + pnt.y.x = hp->x + x; + pnt.y.y = hp->y + y; + + hp->x += x; + hp->y += y; + + hangCoords.add(pnt); + hangs.add(hp); + } + + void Stage::addGround(GameElement*gr) + { + Vector2 pnt; + + pnt.x.x = gr->x; + pnt.x.y = gr->y; + pnt.y.x = gr->x + x; + pnt.y.y = gr->y + y; + + gr->x += x; + gr->y += y; + + groundCoords.add(pnt); + ground.add(gr); + } + + void Stage::updatePlatform(int index) + { + Platform*plat = platforms.get(index); + Vector2 pnt = platCoords.get(index); + + if(plat->x != (float)pnt.y.x) + { + float dif = plat->x - pnt.y.x; + pnt.x.x += dif; + } + if(plat->y != (float)pnt.y.y) + { + float dif = plat->y - pnt.y.y; + pnt.x.y += dif; + } + + pnt.y.x = (x + pnt.x.x); + pnt.y.y = (y + pnt.x.y); + + plat->x = pnt.y.x; + plat->y = pnt.y.y; + } + + void Stage::updateElement(int index) + { + Actor*a = elements.get(index); + Vector2 pnt = elementCoords.get(index); + + if(a->x != (float)pnt.y.x) + { + float dif = a->x - pnt.y.x; + pnt.x.x += dif; + } + if(a->y != (float)pnt.y.y) + { + float dif = a->y - pnt.y.y; + pnt.x.y += dif; + } + + pnt.y.x = (x + pnt.x.x); + pnt.y.y = (y + pnt.x.y); + + a->x = pnt.y.x; + a->y = pnt.y.y; + } + + void Stage::updateForeground(int index) + { + GameElement*a = foregrounds.get(index); + Vector2 pnt = fgCoords.get(index); + + if(a->x != (float)pnt.y.x) + { + float dif = a->x - pnt.y.x; + pnt.x.x += dif; + } + if(a->y != (float)pnt.y.y) + { + float dif = a->y - pnt.y.y; + pnt.x.y += dif; + } + + pnt.y.x = (x + pnt.x.x); + pnt.y.y = (y + pnt.x.y); + + a->x = pnt.y.x; + a->y = pnt.y.y; + } + + void Stage::updateHangPoint(int index) + { + HangPoint*hp = hangs.get(index); + Vector2 pnt = hangCoords.get(index); + + if(hp->x != (float)pnt.y.x) + { + float dif = hp->x - pnt.y.x; + pnt.x.x += dif; + } + if(hp->y != (float)pnt.y.y) + { + float dif = hp->y - pnt.y.y; + pnt.x.y += dif; + } + + pnt.y.x = (x + pnt.x.x); + pnt.y.y = (y + pnt.x.y); + + hp->x = pnt.y.x; + hp->y = pnt.y.y; + } + + void Stage::updateGround(int index) + { + GameElement*gr = ground.get(index); + Vector2 pnt = groundCoords.get(index); + + if(gr->x != (float)pnt.y.x) + { + float dif = gr->x - pnt.y.x; + pnt.x.x += dif; + } + if(gr->y != (float)pnt.y.y) + { + float dif = gr->y - pnt.y.y; + pnt.x.y += dif; + } + + pnt.y.x = (x + pnt.x.x); + pnt.y.y = (y + pnt.x.y); + + gr->x = pnt.y.x; + gr->y = pnt.y.y; + } + + void Stage::setSpawnPoint(int spawnNo, int x1, int y1) + { + spawns[spawnNo].x = x1; + spawns[spawnNo].y = y1; + } + + Vector2i Stage::getSpawnPoint(int spawnNo) + { + Vector2i pnt; + pnt.x = x + spawns[spawnNo].x; + pnt.y = y + spawns[spawnNo].y; + return pnt; + } + + Rect Stage::getBorders() + { + Rect borders = {leftBorder,topBorder,rightBorder,bottomBorder}; + return borders; + } + + Rect Stage::getViewBorders() + { + Rect borders = {leftViewBorder,topViewBorder,rightViewBorder,bottomViewBorder}; + return borders; + } + + boolean Stage::checkSafeArea(Player*playr) + { + /*if(safe.size()==0) + { + if(playr->isOnGround()) + { + return true; + } + return false; + } + Rectangle playrRect = new Rectangle((int)(playr->x - playr->width/2 - x),(int)(playr->y - playr->height/2 - y),playr->width,playr->height); + + for(int i=0; iupdateHitbox(); + + if(playr->isOnGround()) + { + return true; + } + + for(int i=0; igetCollideType()==Platform::COLLIDE_SOLID) + { + platRect = Rectangle((int)(plat->x - plat->width/2),(int)(plat->y - plat->height/2),plat->width,plat->height); + } + else + { + platRect = Rectangle((int)plat->x,(int)plat->y,plat->width,plat->height); + } + + float middleY = platRect.y + (float)platRect.height/2; + + if(playr->hitbox->yhitbox->x>platRect.x && (playr->hitbox->x+playr->hitbox->width)<(platRect.x+platRect.width)) + { + return true; + } + } + return false; + } + + byte Stage::checkPlatformCollision(Player*p, Platform*collide) + { + switch(collide->getCollideType()) + { + case Platform::COLLIDE_BOX: + if(p->hitboxRectsColliding(collide->getBox())) + { + if(collide->getType()==Platform::TYPE_NORMAL || (collide->getType()==Platform::TYPE_GOTHROUGH && !p->dropping)) + { + byte dir = collide->getBoxDirection(p); + switch(dir) + { + case PrimitiveActor::DIR_UP: + if(p->yvelocity>=0) + { + p->y = (collide->getBox()->y - (float)((float)(p->hitboxPoint.height + p->hitboxPoint.y)*p->Scale) + 1); + } + break; + + case PrimitiveActor::DIR_DOWN: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + p->y=(collide->getBox()->y+collide->getBox()->height - (float)((float)p->hitboxPoint.y*p->Scale)); + } + break; + + case PrimitiveActor::DIR_LEFT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + p->x = (collide->getBox()->x - (float)(((float)p->hitboxPoint.width*p->Scale)/2)); + } + break; + + case PrimitiveActor::DIR_RIGHT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + p->x = (collide->getBox()->x + collide->getBox()->width + (float)(((float)p->hitboxPoint.width*p->Scale)/2)); + } + break; + } + p->updateHitbox(); + return dir; + } + } + return 0; + + case Platform::COLLIDE_SOLID: + if(collide->getType()==Platform::TYPE_NORMAL || (collide->getType()==Platform::TYPE_GOTHROUGH && !p->dropping)) + { + return p->solidPlatformCollision(collide); + } + else if(p->dropping) + { + byte dir = p->isColliding2(collide); + switch(dir) + { + case PrimitiveActor::DIR_UP: + return PrimitiveActor::DIR_DOWN; + + case PrimitiveActor::DIR_DOWN: + return PrimitiveActor::DIR_UP; + + case PrimitiveActor::DIR_LEFT: + return PrimitiveActor::DIR_RIGHT; + + case PrimitiveActor::DIR_RIGHT: + return PrimitiveActor::DIR_LEFT; + } + return 0; + } + return 0; + } + return 0; + } + + byte Stage::checkItemPlatformCollision(Item*item, Platform*collide) + { + switch(collide->getCollideType()) + { + case Platform::COLLIDE_BOX: + if(item->Actor::rectsColliding(collide->getBox())) + { + if(collide->getType()==Platform::TYPE_NORMAL || (collide->getType()==Platform::TYPE_GOTHROUGH && !item->ignoreGoThrough)) + { + byte dir = 0; + dir = item->normalPlatformCollision(collide); + switch(dir) + { + case PrimitiveActor::DIR_UP: + item->yvelocity = 0; + item->xvelocity = 0; + break; + + case PrimitiveActor::DIR_DOWN: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + item->yvelocity = abs(item->yvelocity); + } + break; + + case PrimitiveActor::DIR_LEFT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + item->xvelocity = -abs(item->xvelocity); + } + break; + + case PrimitiveActor::DIR_RIGHT: + if(collide->getType()!=Platform::TYPE_GOTHROUGH) + { + item->xvelocity = abs(item->xvelocity); + } + break; + } + return dir; + } + } + return 0; + + case Platform::COLLIDE_SOLID: + if(collide->getType()==Platform::TYPE_NORMAL || (collide->getType()==Platform::TYPE_GOTHROUGH && !item->ignoreGoThrough)) + { + byte dir = item->solidPlatformCollision(collide); + if(dir==PrimitiveActor::DIR_UP) + { + item->yvelocity = 0; + item->xvelocity = 0; + } + else if(dir==PrimitiveActor::DIR_LEFT) + { + item->xvelocity = -abs(item->xvelocity); + } + else if(dir==PrimitiveActor::DIR_RIGHT) + { + item->xvelocity = abs(item->xvelocity); + } + else if(dir==PrimitiveActor::DIR_DOWN) + { + item->yvelocity = abs(item->yvelocity); + } + return dir; + } + return 0; + } + return 0; + } + + void Stage::itemPlatformCollisions(Item*item) + { + boolean setGrounded = false; + ArrayList collides = ArrayList(); + for(int i=0; i<8; i++) + { + item->platformColliding[i] = false; + } + for(int j=0; jisHeld()) + { + dir = checkItemPlatformCollision(item,platforms.get(j)); + } + if(dir>0) + { + item->platformCollision(platforms.get(j), dir); + item->currentCollidePlatform[dir] = platforms.get(j); + collides.add(dir); + } + boolean grounded = false; + switch(dir) + { + case PrimitiveActor::DIR_UP: + grounded = true; + if(item->weight>0) + { + item->yvelocity = 0; + } + break; + + case PrimitiveActor::DIR_LEFT: + case PrimitiveActor::DIR_RIGHT: + if(item->weight>0) + { + item->xvelocity*=-1; + } + break; + } + if(grounded) + { + if(!setGrounded) + { + item->whileGroundColliding(); + } + item->groundColliding = true; + if(!item->prevGroundColliding) + { + item->onGroundCollide(); + } + setGrounded = true; + } + } + for(int i=0; i<8; i++) + { + item->prevPlatformColliding[i] = item->platformColliding[i]; + } + } + + byte Stage::borderColliding(Player*p) + { + if(p->isAlive()) + { + if(p->x < x + leftBorder) + { + return PrimitiveActor::DIR_LEFT; + } + else if(p->x > x + rightBorder) + { + return PrimitiveActor::DIR_RIGHT; + } + else if(p->y < y + topBorder) + { + return PrimitiveActor::DIR_UP; + } + else if(p->y > y + bottomBorder) + { + return PrimitiveActor::DIR_DOWN; + } + } + return 0; + } + + boolean Stage::wireframeCollision(Player*playr, WireframeActor*collide) + { + Rectangle r1 = Rectangle((int)(playr->x - playr->width/2), (int)(playr->y - playr->height/2), playr->width, playr->height); + Rectangle r2 = Rectangle((int)collide->x,(int)collide->y,collide->width,collide->height); + Rectangle overlap = Player::getOverlapRect(r1,r2); + + if(overlap.x!=-1) + { + int startX = overlap.x; + int endX = overlap.x + overlap.width; + int startY = overlap.y; + int endY = overlap.y + overlap.height; + + float x1 = ((float)startX/playr->Scale); + float y1 = ((float)startY/playr->Scale); + float incr1 = (float)(1/playr->Scale); + + float pntX1 = x1; + float pntY1 = y1; + + for(int cntY=startY; cntYpixelAtPoint((int)pntX1, (int)pntY1)) + { + return true; + } + pntX1 += incr1; + } + pntY1 += incr1; + } + } + return false; + } + + byte Stage::checkProjectileCollision(Projectile*p, Platform*collide) + { + switch(collide->getCollideType()) + { + case Platform::COLLIDE_BOX: + { + if(p->isSolid()) + { + byte dir = p->solidPlatformCollision(collide); + return dir; + } + else if(p->Actor::rectsColliding(collide->getBox())) + { + byte dir = collide->getBoxDirection(p); + if(dir==PrimitiveActor::DIR_UPLEFT || dir==PrimitiveActor::DIR_UPRIGHT) + { + dir = PrimitiveActor::DIR_UP; + } + else if(dir==PrimitiveActor::DIR_DOWNLEFT) + { + dir = PrimitiveActor::DIR_LEFT; + } + else if(dir==PrimitiveActor::DIR_DOWNRIGHT) + { + dir = PrimitiveActor::DIR_RIGHT; + } + if(p->isSolid()) + { + switch(dir) + { + case PrimitiveActor::DIR_UP: + p->y = collide->getBox()->y - p->height/2; + break; + + case PrimitiveActor::DIR_DOWN: + p->y = collide->getBox()->y + collide->getBox()->height + p->height/2; + break; + + case PrimitiveActor::DIR_LEFT: + p->x = collide->getBox()->x - p->width/2; + break; + + case PrimitiveActor::DIR_RIGHT: + p->x = collide->getBox()->x + collide->getBox()->width + p->width/2; + break; + } + } + return dir; + } + } + return 0; + + case Platform::COLLIDE_SOLID: + byte dir = 0; + if(p->isSolid()) + { + dir = p->solidPlatformCollision(collide); + } + else + { + dir = p->isPlatformColliding(collide); + } + return dir; + } + return 0; + } +} \ No newline at end of file diff --git a/SmashBros/Stage.h b/SmashBros/Stage.h new file mode 100755 index 0000000..81c96cd --- /dev/null +++ b/SmashBros/Stage.h @@ -0,0 +1,122 @@ +#include "Platform.h" +#include "HangPoint.h" +#include "Projectile.h" +#include "MusicManager.h" +#include "SmashForwards.h" + +#pragma once + +namespace SmashBros +{ + class Stage + { + friend class Camera; + friend class Item; + friend class ItemManager; + friend class ProjectileManager; + private: + Animation*background; + double bgScale; + + GameEngine::Rectangle itemBounds; + boolean showItemBounds; + boolean showWires; + + byte bgType; + + ArrayList files; + + ArrayList platforms; + ArrayList > platCoords; + + ArrayList elements; + ArrayList > elementCoords; + + ArrayList hangs; + ArrayList > hangCoords; + + ArrayList foregrounds; + ArrayList > fgCoords; + + ArrayList ground; + ArrayList > groundCoords; + + Vector2i spawns[7]; + + double gravity; + friend class Player; + + void checkPlayerCollisions(Player*playr); + + void updatePlatform(int index); + void updateElement(int index); + void updateForeground(int index); + void updateHangPoint(int index); + void updateGround(int index); + + byte checkPlatformCollision(Player*p, Platform*collide); + byte checkItemPlatformCollision(Item*item, Platform*collide); + void itemPlatformCollisions(Item*item); + boolean wireframeCollision(Player*playr, WireframeActor*collide); + byte checkProjectileCollision(Projectile*p, Platform*collide); + + byte borderColliding(Player*p); + + protected: + int topBorder; + int bottomBorder; + int leftBorder; + int rightBorder; + + int topViewBorder; + int bottomViewBorder; + int leftViewBorder; + int rightViewBorder; + + void setItemBoundaries(int x1, int y1, int x2, int y2); + void showItemBoundaries(boolean toggle); + void setBackgroundScale(double scale); + void loadFile(const String&fileName); + + void drawBackground(Graphics2D&g, long gameTime); + void drawBottomLayer(Graphics2D&g, long gameTime); + void drawMiddleLayer(Graphics2D&g, long gameTime); + void drawTopLayer(Graphics2D&g, long gameTime); + + public: + static const byte BG_NORMAL = 0; + static const byte BG_FIXED = 1; + + int x,y; + + Stage(int x1, int y1); + virtual ~Stage(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + void Unload(); + void setBackground(String imgName); + void setBackgroundType(byte type); + GameEngine::Rectangle getItemBoundaries(); + + void showWireframes(boolean toggle); + void setWireframeColor(const Color&color); + void setElementColor(const Color&color); + + void setGravity(double grav); + double getGravity(); + + void addElement(GameElement*a); + void addPlatform(Platform*plat); + void addForeground(GameElement*a); + void addHangPoint(HangPoint*hp); + void addGround(GameElement*gr); + + void setSpawnPoint(int spawnNo, int x1, int y1); + Vector2i getSpawnPoint(int spawnNo); + Rect getBorders(); + Rect getViewBorders(); + boolean checkSafeArea(Player*playr); + }; +} \ No newline at end of file diff --git a/SmashBros/StageSelectScreen.cpp b/SmashBros/StageSelectScreen.cpp new file mode 100755 index 0000000..8689980 --- /dev/null +++ b/SmashBros/StageSelectScreen.cpp @@ -0,0 +1,149 @@ +#include "StageSelectScreen.h" +#include "Global.h" +#include "Menus.h" + +namespace SmashBros +{ + StageSelectScreen::StageIcon::StageIcon(StageSelectScreen*screen, float x1, float y1, int num) : Actor(x1,y1) + { + this->num = num; + this->screen = screen; + } + + StageSelectScreen::StageIcon::~StageIcon() + { + // + } + + void StageSelectScreen::StageIcon::onMouseEnter() + { + setColor(Color::YELLOW); + } + + void StageSelectScreen::StageIcon::onMouseLeave() + { + setColor(Color::WHITE); + } + + void StageSelectScreen::StageIcon::onRelease() + { + Global::selectedStage = num; + MusicManager::stop(); + screen->queueLoad = 1; + screen->onSelect(num); + } + + StageSelectScreen::StageSelectScreen(const String&name) : Screen(name) + { + stageGrid = new ActorGrid(80,145, 5, 8); + stageGrid->setSpacing(105, 100); + stageGrid->setScale(1.5f); + for(int i=0; i<=Global::totalStages; i++) + { + StageIcon*a = new StageIcon(this, 0,0, i); + String sPath = ""; + //TODO: add stages + switch(i) + { + default: + case Global::STAGE_FRACTALSTAGE: + sPath = "Images/Menus/StageSelect/test.png"; + break; + + case Global::STAGE_HILLSIDEBATTLEGROUND: + sPath = "Images/Menus/StageSelect/hillside_battleground.png"; + break; + + case Global::STAGE_BATTLEFIELDBRAWL: + sPath = "Images/Menus/StageSelect/battlefield.png"; + break; + + case Global::STAGE_FINALDESTINATION: + sPath = "Images/Menus/StageSelect/final_destination.png"; + break; + + case Global::STAGE_HYRULETEMPLE: + sPath = "Images/Menus/StageSelect/hyruletemple.png"; + break; + } + a->addAnimation(new Animation("normal",1,sPath)); + a->changeAnimation("normal", FORWARD); + stageGrid->add(a); + } + + loadScreen = new Actor(450,300); + loadScreen->addAnimation(new Animation("normal",1,"Images/loading.png")); + loadScreen->changeAnimation("normal", FORWARD); + loadScreen->setAlpha(0.5f); + loadScreen->Scale = 1.876f; + + queueLoad = 0; + drawnOnce = false; + } + + StageSelectScreen::~StageSelectScreen() + { + delete stageGrid; + delete loadScreen; + } + + void StageSelectScreen::onLoad() + { + //Open for implementation + Global::LoadGame(); + } + + void StageSelectScreen::onSelect(int stageNo) + { + //Open for implementation + } + + void StageSelectScreen::onGoToGame() + { + //Open for implementation + ScreenManager::GoToScreen("Game"); + } + + void StageSelectScreen::LoadContent() + { + queueLoad = 0; + drawnOnce = false; + } + + void StageSelectScreen::UnloadContent() + { + queueLoad = 0; + drawnOnce = false; + } + + void StageSelectScreen::Update(long gameTime) + { + if(drawnOnce) + { + if(queueLoad==1) + { + onLoad(); + queueLoad++; + } + else if(queueLoad == 2) + { + onGoToGame(); + queueLoad = 0; + drawnOnce = false; + } + } + stageGrid->Update(gameTime); + Menus::button_back->Update(gameTime); + } + + void StageSelectScreen::Draw(Graphics2D&g, long gameTime) + { + stageGrid->Draw(g, gameTime); + Menus::button_back->Draw(g, gameTime); + if(queueLoad>0) + { + loadScreen->Draw(g, gameTime); + drawnOnce = true; + } + } +} \ No newline at end of file diff --git a/SmashBros/StageSelectScreen.h b/SmashBros/StageSelectScreen.h new file mode 100755 index 0000000..6df21a2 --- /dev/null +++ b/SmashBros/StageSelectScreen.h @@ -0,0 +1,43 @@ +#include "ActorGrid.h" + +#pragma once + +namespace SmashBros +{ + class StageSelectScreen : public Screen + { + private: + ActorGrid*stageGrid; + byte queueLoad; + boolean drawnOnce; + Actor*loadScreen; + + class StageIcon : public Actor + { + private: + int num; + StageSelectScreen*screen; + + public: + StageIcon(StageSelectScreen*screen, float x1, float y1, int num); + virtual ~StageIcon(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + public: + StageSelectScreen(const String&name); + virtual ~StageSelectScreen(); + + virtual void onLoad(); + virtual void onSelect(int stageNo); + virtual void onGoToGame(); + + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + }; +} \ No newline at end of file diff --git a/SmashBros/SuperMushroom.cpp b/SmashBros/SuperMushroom.cpp new file mode 100755 index 0000000..6ca347b --- /dev/null +++ b/SmashBros/SuperMushroom.cpp @@ -0,0 +1,122 @@ +#include "SuperMushroom.h" +#include "Global.h" + +namespace SmashBros +{ + SuperMushroom::SuperMushroom(float x1, float y1) : Item(x1, y1, 160, TYPE_WIELD) + { + itemNo = Global::ITEM_SUPERMUSHROOM; + + weight = 0.2f; + + moving = false; + active = false; + scale = 1; + finishTime = 0; + + dir = (byte)((GameEngine::random()*2)+1); + + addAnimation(new Animation("normal", 1, "Images/Game/Items/Mushroom/mushroom.png")); + + changeAnimation("normal",FORWARD); + } + + SuperMushroom::~SuperMushroom() + { + // + } + + boolean SuperMushroom::canPickUp() + { + return false; + } + + void SuperMushroom::onPlayerCollide(Player*collide) + { + if(!active) + { + if(collide->pickUpItem(this)) + { + scale = collide->Scale; + + int oldHeight = collide->height; + + collide->Scale*=2.5; + + int newHeight = (int)(collide->height*2.5); + + int dif = newHeight - oldHeight; + collide->y-=dif/2; + + finishTime = Global::getWorldTime() + 100; + + moving = false; + active = true; + + setVisible(false); + } + } + } + + void SuperMushroom::onPlatformCollide(Platform*collide, byte dir) + { + switch(dir) + { + case DIR_LEFT: + this->dir = 1; + break; + + case DIR_RIGHT: + this->dir = 2; + break; + } + } + + void SuperMushroom::onGroundCollide() + { + moving = true; + } + + void SuperMushroom::onDestroy() + { + if(active) + { + Player*playr = Global::getPlayerActor(getItemHolder()); + playr->Scale = scale; + } + } + + void SuperMushroom::Update(long gameTime) + { + Item::Update(gameTime); + if(active) + { + if(finishTime<=Global::getWorldTime()) + { + destroy(); + } + } + if(isHeld()) + { + Player*playr = getPlayer(); + x = playr->x; + y = playr->y; + } + else + { + if(moving) + { + switch(dir) + { + case 1: + x-=2; + break; + + case 2: + x+=2; + break; + } + } + } + } +} \ No newline at end of file diff --git a/SmashBros/SuperMushroom.h b/SmashBros/SuperMushroom.h new file mode 100755 index 0000000..d68150f --- /dev/null +++ b/SmashBros/SuperMushroom.h @@ -0,0 +1,28 @@ +#include "Item.h" + +#pragma once + +namespace SmashBros +{ + class SuperMushroom : public Item + { + private: + boolean moving; + float scale; + long finishTime; + boolean active; + byte dir; + + public: + SuperMushroom(float x1, float y1); + virtual ~SuperMushroom(); + + virtual void Update(long gameTime); + + virtual boolean canPickUp(); + virtual void onPlayerCollide(Player*collide); + virtual void onPlatformCollide(Platform*collide, byte dir); + virtual void onGroundCollide(); + virtual void onDestroy(); + }; +} \ No newline at end of file diff --git a/SmashBros/ToggleButton.cpp b/SmashBros/ToggleButton.cpp new file mode 100755 index 0000000..1de3cf0 --- /dev/null +++ b/SmashBros/ToggleButton.cpp @@ -0,0 +1,76 @@ +#include "ToggleButton.h" + +namespace SmashBros +{ + ToggleButton::ToggleButton(float x1, float y1, boolean toggle) : Actor(x1,y1) + { + Animation*on = new Animation("on",1,"Images/Menus/Buttons/Generic/toggle_on.png"); + Animation*off = new Animation("off",1,"Images/Menus/Buttons/Generic/toggle_off.png"); + addAnimation(on); + addAnimation(off); + if(toggle) + { + changeAnimation("on", FORWARD); + } + else + { + changeAnimation("off", FORWARD); + } + this->toggle = toggle; + } + + ToggleButton::~ToggleButton() + { + // + } + + void ToggleButton::Update(long gameTime) + { + Actor::Update(gameTime); + if(toggle) + { + changeAnimation("on",FORWARD); + } + else + { + changeAnimation("off",FORWARD); + } + } + + void ToggleButton::setToggle(boolean toggle) + { + this->toggle = toggle; + if(toggle) + { + changeAnimation("on",FORWARD); + } + else + { + changeAnimation("off",FORWARD); + } + onToggle(toggle); + } + + boolean ToggleButton::getToggle() + { + return toggle; + } + + void ToggleButton::onRelease() + { + if(toggle) + { + toggle = false; + } + else + { + toggle = true; + } + onToggle(toggle); + } + + void ToggleButton::onToggle(boolean toggle) + { + //Open for implementation + } +} \ No newline at end of file diff --git a/SmashBros/ToggleButton.h b/SmashBros/ToggleButton.h new file mode 100755 index 0000000..4f007f7 --- /dev/null +++ b/SmashBros/ToggleButton.h @@ -0,0 +1,23 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class ToggleButton : public Actor + { + private: + boolean toggle; + + public: + ToggleButton(float x1, float y1, boolean toggle=false); + virtual ~ToggleButton(); + + virtual void Update(long gameTime); + virtual void onRelease(); + virtual void onToggle(boolean toggle); + + void setToggle(boolean toggle); + boolean getToggle(); + }; +} \ No newline at end of file diff --git a/SmashBros/ToggleButtons.cpp b/SmashBros/ToggleButtons.cpp new file mode 100755 index 0000000..0dece96 --- /dev/null +++ b/SmashBros/ToggleButtons.cpp @@ -0,0 +1,122 @@ +#include "ToggleButtons.h" + +namespace SmashBros +{ + ToggleButtons::DualToggleButton::DualToggleButton(ToggleButtons*holder, byte num, float x1, float y1, boolean toggle) : ToggleButton(x1,y1,toggle) + { + this->holder = holder; + this->num = num; + } + + ToggleButtons::DualToggleButton::~DualToggleButton() + { + // + } + + void ToggleButtons::DualToggleButton::onRelease() + { + ToggleButton::onRelease(); + switch(num) + { + case 1: + if(getToggle()) + { + holder->toggle = 1; + holder->t2->setToggle(false); + } + else + { + holder->toggle = 2; + holder->t2->setToggle(true); + } + break; + + case 2: + if(getToggle()) + { + holder->toggle = 2; + holder->t1->setToggle(false); + } + else + { + holder->toggle = 1; + holder->t1->setToggle(true); + } + break; + } + } + + ToggleButtons::ToggleButtons(float x1,float y1, float x2, float y2) + { + toggle = 1; + t1 = new DualToggleButton(this,1,x1,y1,true); + t2 = new DualToggleButton(this,2,x2,y2,false); + } + + ToggleButtons::~ToggleButtons() + { + delete t1; + delete t2; + } + + void ToggleButtons::Update(long gameTime) + { + byte prevToggle = toggle; + t1->Update(gameTime); + t2->Update(gameTime); + if(toggle!=prevToggle) + { + onToggle(toggle); + } + } + + void ToggleButtons::Draw(Graphics2D&g, long gameTime) + { + t1->Draw(g, gameTime); + t2->Draw(g, gameTime); + } + + byte ToggleButtons::getToggle() + { + return toggle; + } + + void ToggleButtons::setToggle(byte toggle) + { + if(toggle>=2) + { + toggle = 2; + t1->setToggle(false); + t2->setToggle(true); + } + else if(toggle<=1) + { + toggle = 1; + t1->setToggle(true); + t2->setToggle(false); + } + this->toggle = toggle; + onToggle(this->toggle); + } + + void ToggleButtons::onToggle(byte toggle) + { + //Open for implementation + } + + void ToggleButtons::setScale(float scale) + { + Scale = scale; + t1->Scale = Scale; + t2->Scale = Scale; + } + + bool ToggleButtons::isClicked() + { + if(t1->isClicked() || t2->isClicked()) + { + return true; + } + return false; + } +} \ No newline at end of file diff --git a/SmashBros/ToggleButtons.h b/SmashBros/ToggleButtons.h new file mode 100755 index 0000000..5d1633a --- /dev/null +++ b/SmashBros/ToggleButtons.h @@ -0,0 +1,42 @@ +#include "ToggleButton.h" + +#pragma once + +namespace SmashBros +{ + class ToggleButtons + { + private: + class DualToggleButton : public ToggleButton + { + private: + byte num; + ToggleButtons*holder; + public: + DualToggleButton(ToggleButtons*holder, byte num, float x1, float y1, boolean toggle); + virtual ~DualToggleButton(); + + virtual void onRelease(); + }; + + DualToggleButton*t1; + DualToggleButton*t2; + + float Scale; + byte toggle; + + public: + ToggleButtons(float x1, float y1, float x2, float y2); + virtual ~ToggleButtons(); + + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + virtual void onToggle(byte toggle); + + byte getToggle(); + void setToggle(byte Toggle); + void setScale(float scale); + + bool isClicked(); + }; +} \ No newline at end of file diff --git a/SmashBros/TogglePane.cpp b/SmashBros/TogglePane.cpp new file mode 100755 index 0000000..0d35cb1 --- /dev/null +++ b/SmashBros/TogglePane.cpp @@ -0,0 +1,68 @@ +#include "TogglePane.h" + +namespace SmashBros +{ + TogglePane::TogglePane(float x1, float y1, boolean toggle) : Actor(x1,y1) + { + Animation*on = new Animation("on",1,"Images/Menus/Rules/Items/toggle_on.png"); + Animation*off = new Animation("off",1,"Images/Menus/Rules/Items/toggle_off.png"); + addAnimation(on); + addAnimation(off); + this->toggle = toggle; + if(toggle) + { + changeAnimation("on", FORWARD); + } + else + { + changeAnimation("off", FORWARD); + } + } + + TogglePane::~TogglePane() + { + // + } + + void TogglePane::Update(long gameTime) + { + Actor::Update(gameTime); + if(toggle) + { + changeAnimation("on",FORWARD); + } + else + { + changeAnimation("off",FORWARD); + } + } + + void TogglePane::setToggle(boolean toggle) + { + this->toggle = toggle; + onToggle(toggle); + } + + boolean TogglePane::getToggle() + { + return toggle; + } + + void TogglePane::onRelease() + { + if(toggle) + { + toggle = false; + } + else + { + toggle = true; + } + onToggle(toggle); + } + + void TogglePane::onToggle(boolean toggle) + { + //Open for implementation + } +} \ No newline at end of file diff --git a/SmashBros/TogglePane.h b/SmashBros/TogglePane.h new file mode 100755 index 0000000..78e96da --- /dev/null +++ b/SmashBros/TogglePane.h @@ -0,0 +1,23 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class TogglePane : public Actor + { + private: + boolean toggle; + + public: + TogglePane(float x1, float y1, boolean toggle = false); + virtual ~TogglePane(); + + virtual void Update(long gameTime); + virtual void onRelease(); + virtual void onToggle(boolean toggle); + + void setToggle(boolean toggle); + boolean getToggle(); + }; +} \ No newline at end of file diff --git a/SmashBros/WinnerScreen.cpp b/SmashBros/WinnerScreen.cpp new file mode 100755 index 0000000..be38b17 --- /dev/null +++ b/SmashBros/WinnerScreen.cpp @@ -0,0 +1,479 @@ +#include "WinnerScreen.h" +#include "Global.h" +#include "Preferences.h" +#include "Menus.h" + +namespace SmashBros +{ + WinnerScreen::FinishButton::FinishButton(float x1, float y1) : Actor(x1,y1) + { + // + } + + WinnerScreen::FinishButton::~FinishButton() + { + // + } + + void WinnerScreen::FinishButton::onMouseEnter() + { + changeAnimation("hover",FORWARD); + } + + void WinnerScreen::FinishButton::onMouseLeave() + { + changeAnimation("normal",FORWARD); + } + + void WinnerScreen::FinishButton::onRelease() + { + if(Global::gameType==Global::TYPE_GROUPBRAWL) + { + ScreenManager::GoToScreen("BrawlCharSelect"); + } + } + + WinnerScreen::WinnerScreen(const String&name) : Screen(name) + { + button_finish = new FinishButton(800,500); + + button_finish->addAnimation(new Animation("normal", 1, "Images/Game/WinnerScreen/continue.png")); + button_finish->addAnimation(new Animation("hover", 1, "Images/Game/WinnerScreen/continue_selected.png")); + button_finish->changeAnimation("normal", FORWARD); + } + + WinnerScreen::~WinnerScreen() + { + for(int i=0; iteamplace > stats.get(j)->teamplace) + { + CharStat*stat = stats.get(j-1); + stats.set(j-1,stats.get(j)); + stats.set(j,stat); + } + else if(stats.get(j-1)->teamplace == stats.get(j)->teamplace) + { + if(stats.get(j-1)->place > stats.get(j)->place) + { + CharStat*stat = stats.get(j-1); + stats.set(j-1,stats.get(j)); + stats.set(j,stat); + } + } + } + } + } + else + { + int n = stats.size(); + + for(int i = 0; i < n; i++) + { + for(int j = 1; j < (n-i); j++) + { + if(stats.get(j-1)->place > stats.get(j)->place) + { + CharStat*stat = stats.get(j-1); + stats.set(j-1,stats.get(j)); + stats.set(j,stat); + } + } + } + } + + for(int i=0; ix = (float)((float)View::ScaleWidth() / (float)(Global::charAmount+1))*(float)(i+1); + stat->y = 250; + } + + delete[] actualWinners; + delete[] actualTeamWinners; + } + + void WinnerScreen::UnloadContent() + { + for(int i=0; iUpdate(gameTime); + } + button_finish->Update(gameTime); + } + + void WinnerScreen::Draw(Graphics2D&g, long gameTime) + { + button_finish->Draw(g, gameTime); + for(int i=0; iDraw(g, gameTime); + } + } + + boolean WinnerScreen::addFile(String fileName) + { + for(int i=0; ipNum = pNum; + this->team = team; + this->place = place; + this->teamplace = teamplace; + this->score = score; + this->ko = ko; + this->death = death; + cNum = Global::selectedChar[pNum-1]; + playr = new CharStatPlayer(x,y); + + playr->Scale = 3.0f; + + String path = (String)"Images/Game/Characters/" + Global::getCharName(cNum) + "/"; + + String lose = path + "lose.png"; + String win = path + "win.png"; + String win_hold = path + "win_hold.png"; + + boolean success; + + success = screen->addFile(lose); + if(!success) + { + lose = "Images/Game/Misc/placeholder.gif"; + screen->addFile(lose); + } + success = screen->addFile(win); + if(!success) + { + win = "Images/Game/Misc/placeholder.gif"; + screen->addFile(win); + } + success = screen->addFile(win_hold); + if(!success) + { + win_hold = "Images/Game/Misc/placeholder.gif"; + screen->addFile(win_hold); + } + + Animation*anim; + switch(cNum) + { + default: + //TODO: add characters + case Global::CHAR_MARIO: + anim = new Animation("win",8,8,1); + anim->addFrame(win); + playr->addAnimation(anim); + anim = new Animation("win_hold",1,win_hold); + anim->addFrame(win_hold); + playr->addAnimation(anim); + anim = new Animation("lose",4,2,1); + anim->addFrame(lose); + playr->addAnimation(anim); + break; + + case Global::CHAR_SONIC: + anim = new Animation("win",5,6,1); + anim->addFrame(win); + playr->addAnimation(anim); + anim = new Animation("win_hold",1,win_hold); + anim->addFrame(win_hold); + playr->addAnimation(anim); + anim = new Animation("lose",4,2,1); + anim->addFrame(lose); + playr->addAnimation(anim); + break; + + case Global::CHAR_ICHIGO: + anim = new Animation("win",6,5,1); + anim->addFrame(win); + playr->addAnimation(anim); + anim = new Animation("win_hold",1,win_hold); + anim->addFrame(win_hold); + playr->addAnimation(anim); + anim = new Animation("lose",4,2,1); + anim->addFrame(lose); + playr->addAnimation(anim); + break; + + case Global::CHAR_FOX: + anim = new Animation("win",8,6,1); + anim->addFrame(win); + playr->addAnimation(anim); + anim = new Animation("win_hold",1,win_hold); + anim->addFrame(win_hold); + playr->addAnimation(anim); + anim = new Animation("lose",4,2,1); + anim->addFrame(lose); + playr->addAnimation(anim); + break; + } + + if((Global::teamBattle && teamplace==1) || (!Global::teamBattle && place==1)) + { + playr->changeAnimation("win", FORWARD); + } + else + { + playr->changeAnimation("lose", FORWARD); + } + + String str = ""; + + if(Global::teamBattle) + { + str += getPlaceString(teamplace) + ": " + getTeamString(team) + " Team\n"; + str += getPlaceString(place) + ": " + "Player " + pNum + "\n"; + } + else + { + str += getPlaceString(place) + ": " + "Player " + pNum + "\n"; + } + str += "\n"; + str += (String)"Score: " + (String)this->score + (String)"\n"; + str += (String)"KOs: " + (String)this->ko + (String)"\n"; + str += (String)"Deaths: " + (String)this->death + (String)"\n"; + + description = new TextActor(str, AssetManager::getFont("Fonts/arial.ttf", Font::BOLD, 14), Color::BLACK); + description->setAlignment(TextActor::ALIGN_CENTER); + } + + WinnerScreen::CharStat::~CharStat() + { + delete playr; + delete description; + } + + void WinnerScreen::CharStat::Update(long gameTime) + { + playr->x = x; + playr->y = y - playr->height/2; + playr->Update(gameTime); + description->x = x; + description->y = y + description->height/2; + description->Update(gameTime); + } + + void WinnerScreen::CharStat::Draw(Graphics2D&g, long gameTime) + { + playr->x = x; + playr->y = y - playr->height/2; + playr->Draw(g, gameTime); + description->x = x; + description->y = y + description->height/2; + description->Draw(g, gameTime); + } + + String WinnerScreen::CharStat::getTeamString(int teamNum) + { + switch(teamNum) + { + case Global::TEAM_RED: + return "Red"; + + case Global::TEAM_BLUE: + return "Blue"; + + case Global::TEAM_GREEN: + return "Green"; + + case Global::TEAM_YELLOW: + return "Yellow"; + } + return ""; + } + + String WinnerScreen::CharStat::getPlaceString(int placeNum) + { + switch(placeNum) + { + case 1: + return "1st Place"; + + case 2: + return "2nd Place"; + + case 3: + return "3rd Place"; + + case 4: + return "4th Place"; + + case 5: + return "5th Place"; + + case 6: + return "6th Place"; + } + return ""; + } + + String WinnerScreen::CharStat::toString() + { + String str = ""; + str += (String)"Player " + (String)pNum + (String)"\n"; + + if(Global::teamBattle) + { + str += (String)"Place: " + (String)teamplace + (String)"\n"; + str += (String)"Actual (non-team) place: " + (String)place + (String)"\n"; + str += (String)"Team: " + (String)team + (String)"\n"; + } + else + { + str += (String)"Place: " + (String)place + (String)"\n"; + } + + str += (String)"Score: " + (String)score + (String)"\n"; + str += (String)"KOs: " + (String)ko + (String)"\n"; + + return str; + } + + WinnerScreen::CharStat::operator String() + { + return toString(); + } +} \ No newline at end of file diff --git a/SmashBros/WinnerScreen.h b/SmashBros/WinnerScreen.h new file mode 100755 index 0000000..0e6a716 --- /dev/null +++ b/SmashBros/WinnerScreen.h @@ -0,0 +1,67 @@ +#include "GameEngine/GameEngine.h" + +#pragma once + +namespace SmashBros +{ + class WinnerScreen : public Screen + { + public: + WinnerScreen(const String&name); + virtual ~WinnerScreen(); + + virtual void Initialize(); + virtual void LoadContent(); + virtual void UnloadContent(); + virtual void Update(long gameTime); + virtual void Draw(Graphics2D&g, long gameTime); + + private: + boolean addFile(String fileName); + + class CharStat + { + public: + float x,y; + int pNum,cNum,team,place,teamplace,score,ko,death; + + CharStat(WinnerScreen*screen, int pNum, int team, int place, int teamplace, int score, int ko, int death); + ~CharStat(); + + void Update(long gameTime); + void Draw(Graphics2D&g, long gameTime); + String getTeamString(int teamNum); + String getPlaceString(int placeNum); + String toString(); + operator String(); + + private: + class CharStatPlayer : public Actor + { + public: + CharStatPlayer(float x1, float y1); + ~CharStatPlayer(); + virtual void onAnimationFinish(const String&name); + }; + + CharStatPlayer*playr; + TextActor*description; + }; + + class FinishButton : public Actor + { + public: + FinishButton(float x1, float y1); + ~FinishButton(); + + virtual void onMouseEnter(); + virtual void onMouseLeave(); + virtual void onRelease(); + }; + + ArrayList stats; + ArrayList files; + + FinishButton*button_finish; + }; +} \ No newline at end of file diff --git a/Sounds/Menus/ButtonBack.ogg b/Sounds/Menus/ButtonBack.ogg new file mode 100644 index 0000000..51974eb Binary files /dev/null and b/Sounds/Menus/ButtonBack.ogg differ diff --git a/Sounds/Menus/TitleScreen_click.ogg b/Sounds/Menus/TitleScreen_click.ogg new file mode 100644 index 0000000..37d5610 Binary files /dev/null and b/Sounds/Menus/TitleScreen_click.ogg differ diff --git a/Sounds/Menus/menu_select.ogg b/Sounds/Menus/menu_select.ogg new file mode 100644 index 0000000..404faa3 Binary files /dev/null and b/Sounds/Menus/menu_select.ogg differ diff --git a/Sounds/Menus/ready_to_fight.ogg b/Sounds/Menus/ready_to_fight.ogg new file mode 100644 index 0000000..a5660e9 Binary files /dev/null and b/Sounds/Menus/ready_to_fight.ogg differ