131 |
} |
} |
132 |
|
|
133 |
void |
void |
134 |
GameMenu::draw_background(px::GC &gc) { |
GameMenu::draw_background(px::GC &gc) |
135 |
|
{ |
136 |
if (!zoomed) { |
if (!zoomed) { |
137 |
const Rect& game_area = display::GetGameArea(); |
const Rect& game_area = display::GetGameArea(); |
138 |
int part_width = game_area.w/3; |
int part_width = game_area.w/3; |
171 |
} |
} |
172 |
} |
} |
173 |
|
|
174 |
|
// Be sure to redraw everything, or actors may appear on top |
175 |
|
// of the stones (actors are drawn in one pass and only |
176 |
|
// clipped to the screen boundary). |
177 |
|
display::RedrawAll(video::GetScreen()); |
178 |
|
|
179 |
// get the selected part from screen |
// get the selected part from screen |
180 |
// SDL_Surface *back = video::GetScreen()->get_surface(); |
// SDL_Surface *back = video::GetScreen()->get_surface(); |
181 |
Rect src_area(game_area.x+x, game_area.y+y, part_width, part_height); |
Rect src_area(game_area.x+x, game_area.y+y, part_width, part_height); |
566 |
video::ShowMouse(); |
video::ShowMouse(); |
567 |
} |
} |
568 |
|
|
|
static void |
|
|
mouse_force(int xrel, int yrel) |
|
|
{ |
|
|
px::V2 force(xrel, yrel); |
|
|
double f = length(force); |
|
|
if (f > 0) |
|
|
{ |
|
|
force *= options::MouseSpeed; |
|
|
world::SetMouseForce(force); |
|
|
} |
|
|
} |
|
|
|
|
569 |
void |
void |
570 |
Game::handle_events() |
Game::handle_events() |
571 |
{ |
{ |
577 |
on_keydown(e); |
on_keydown(e); |
578 |
break; |
break; |
579 |
case SDL_MOUSEMOTION: |
case SDL_MOUSEMOTION: |
580 |
mouse_force(e.motion.xrel, e.motion.yrel); |
world::SetMouseForce (options::MouseSpeed * |
581 |
|
V2 (e.motion.xrel, e.motion.yrel)); |
582 |
break; |
break; |
583 |
case SDL_MOUSEBUTTONDOWN: |
case SDL_MOUSEBUTTONDOWN: |
584 |
case SDL_MOUSEBUTTONUP: |
case SDL_MOUSEBUTTONUP: |
662 |
break; |
break; |
663 |
|
|
664 |
case SDLK_F3: |
case SDLK_F3: |
665 |
player::Suicide(); |
if (e.key.keysym.mod & KMOD_SHIFT) { |
666 |
|
change_state(RESTARTGAME); |
667 |
|
} |
668 |
|
else { |
669 |
|
player::Suicide(); |
670 |
|
} |
671 |
break; |
break; |
672 |
|
|
673 |
case SDLK_F4: |
case SDLK_F4: |
699 |
options::ShowFPS = !options::ShowFPS; |
options::ShowFPS = !options::ShowFPS; |
700 |
break; |
break; |
701 |
case SDLK_l: |
case SDLK_l: |
702 |
|
// Reload current level or abort if this fails |
703 |
change_state(load_level(icurrent_level) ? LEVELINIT : ABORT); |
change_state(load_level(icurrent_level) ? LEVELINIT : ABORT); |
704 |
break; |
break; |
705 |
case SDLK_t: |
case SDLK_t: |
731 |
"Escape:", "Show game menu", |
"Escape:", "Show game menu", |
732 |
"F1:", "Show this help", |
"F1:", "Show this help", |
733 |
"F3:", "Kill current marble", |
"F3:", "Kill current marble", |
734 |
|
"Shift+F3:", "Restart the current level", |
735 |
"F4:", "Skip to next level", |
"F4:", "Skip to next level", |
736 |
"F5:", "Skip to next unsolved level", |
"F5:", "Skip to next unsolved level", |
737 |
"F10:", "Make screenshot", |
"F10:", "Make screenshot", |
738 |
"Left arrow:", "Decrease mouse speed", |
"Left arrow:", "Decrease mouse speed", |
739 |
"Right arrow:", "Increase mouse speed", |
"Right arrow:", "Increase mouse speed", |
740 |
"Alt+x:", "Return to level menu", |
// "Alt+x:", "Return to level menu", |
741 |
"Alt+Return:", "Switch between fullscreen and window", |
"Alt+Return:", "Switch between fullscreen and window", |
742 |
|
|
743 |
0 |
0 |
808 |
enigma::SlopeForce2 = 25.0; |
enigma::SlopeForce2 = 25.0; |
809 |
enigma::FrictionFactor = 1.0; |
enigma::FrictionFactor = 1.0; |
810 |
enigma::ElectricForce = 15.0; |
enigma::ElectricForce = 15.0; |
811 |
enigma::BumperForce = 800.0; |
enigma::BumperForce = 500.0; |
812 |
} |
} |
813 |
|
|
814 |
px::Surface * |
px::Surface * |