Start.cpp
上传用户:cncdtg88
上传日期:2013-03-14
资源大小:10474k
文件大小:20k
- // start.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "start.h"
- #include <stdio.h>
- #include <math.h>
- #include "MainFrm.h"
- #include "license.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- typedef struct player_data {
- RECT window_rect; //The size of the window used for rendering
- HPEN crosshair_pen; //The pen used for drawing the crosshair (WIN32 stuff. Nothing to do with STATE ...)
- DWORD weapon; //A handle to the weapon object
- DWORD fire_animation; //A handle to the animation used for shooting
- DWORD fire_effect_polygon; // When shooting we enable this polygon to be used by the shooting-fire-animation
- DWORD weapon_idle_sequence; //The sequence that is used with the weapon 3D animation when not shooting
- DWORD weapon_shooting_sequence; //A handle to the 3d animation sequance that is used while shooting
- DWORD weapon_shooting_mark_bitmap; //A handle to the the bitmap we use for marking shooting holes
-
- DWORD shooting_shred; //A object handle. This is the master splinter. When we shoot we duplicate this object
- //for creating the broken pieces falling down from where the bullets hit
- int is_shooting;
- } player_data;
- player_data gl_player;
- #define STEP 60
- #define GRAVITY 100.0
- #define HEIGHT_ABOVE_GROUND (50.0*WORLD_FACTOR)
- #define VIEWER_SIZE (50*WORLD_FACTOR)
- #define SIZE_OF_WALKING_EFFECT 32
- #define WALKING_EFFECT_HEIGHT (HEIGHT_ABOVE_GROUND*0.125)
- #define MOUSE_SENSITIVITY 0.2
- #define MAX_TILT 85
- #define GUN_MOVING_SPEED 0.05
- #define SHOOTING_MARK_RADIUS 20
- #define SHRED_SPEED 20
- #define SHRED_SIZE 10
- #define WORLD_FACTOR 6
- #define STANDING 1
- #define WALKING 2
- #define FALLING 3
- #define SOUND_STEP1 0
- #define SOUND_STEP2 1
- #define SOUND_STEP3 2
- #define SOUND_STEP4 3
- #define SOUND_FALL 4
- #define SOUND_HIT_WALL 5
- #define SOUND_SHOOT 6
- #define NUMBER_OF_SOUNDS 7
- //Opponent stage constant
- #define OPPONENT_IDLE 1
- #define OPPONENT_ATTACK 2
- #define OPPONENT_ATTACK_DISTANCE 1000
- DWORD g_skyArray[100];
- /////////////////////////////////////////////////////////////////////////////
- // CMy3DSTATE_AppWizardApp
- BEGIN_MESSAGE_MAP(CMy3DSTATE_AppWizardApp, CWinApp)
- //{{AFX_MSG_MAP(CMy3DSTATE_AppWizardApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMy3DSTATE_AppWizardApp construction
- CMy3DSTATE_AppWizardApp::CMy3DSTATE_AppWizardApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CMy3DSTATE_AppWizardApp object
- CMy3DSTATE_AppWizardApp theApp;
- /////////////////////////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////////////////////////
- BOOL CMy3DSTATE_AppWizardApp::InitInstance()
- {
-
-
-
- return TRUE;
- }
- BOOL CMy3DSTATE_AppWizardApp::OnIdle(LONG lCount)
- {
-
-
-
- return true;
- }
- int CMy3DSTATE_AppWizardApp::ExitInstance()
- {
- int res = CWinApp::ExitInstance();
-
- STATE_engine_close();
- return res;
- }
- void copy_vector(double dst[3], double src[3])
- {
- dst[0]=src[0];
- dst[1]=src[1];
- dst[2]=src[2];
- }
- void set_vector(double dst[3], double x, double y, double z)
- {
- dst[0]=x;
- dst[1]=y;
- dst[2]=z;
- }
- void add_vector(double dst[3], double src[3])
- {
- dst[0]+=src[0];
- dst[1]+=src[1];
- dst[2]+=src[2];
- }
- void sub_vector(double dst[3], double src[3])
- {
- dst[0]-=src[0];
- dst[1]-=src[1];
- dst[2]-=src[2];
- }
- void mul_vector(double vec[3], double factor)
- {
- vec[0]*=factor;
- vec[1]*=factor;
- vec[2]*=factor;
- }
- void camera_manage_free_falling(DWORD camera, double walking_height_effect[], int *player_stage, int *player_stage_progress, DWORD sounds[])
- {
-
- double location[3], bellow[3], intersection[3];
- STATE_camera_get_location(camera, &location[0], &location[1], &location[2]);
- copy_vector(bellow, location);
- bellow[2]=-1e10;
- DWORD poly,obj;
-
- int rc=STATE_engine_is_movement_possible(location, bellow, &poly, intersection, &obj);
- if(rc==YES) {
-
- }
- else {
-
- double walking_effect=0;
- if( *player_stage==WALKING)
- walking_effect=walking_height_effect[*player_stage_progress];
- double height=location[2]-intersection[2];
- double wanted_height_above_ground=HEIGHT_ABOVE_GROUND+walking_effect;
-
- if(height>wanted_height_above_ground+GRAVITY) {
- *player_stage=FALLING;
- location[2]-=GRAVITY;
- height-=GRAVITY;
- }
- else {
- location[2]=intersection[2]+wanted_height_above_ground;
- if(*player_stage==FALLING) {
- *player_stage=STANDING;
- STATE_sound_play(sounds[SOUND_FALL], SOUND_NO_LOOP);
- }
- }
-
- STATE_camera_set_location(camera, location[0], location[1], location[2]);
- }
- }
- void camera_move_according_to_keyboard_input(DWORD camera, int *player_stage, int *player_stage_progress, DWORD sounds[])
- {
- if(GetAsyncKeyState(VK_LEFT)<0) STATE_camera_rotate_z(camera, 5,WORLD_SPACE);
- if(GetAsyncKeyState(VK_RIGHT )<0) STATE_camera_rotate_z(camera, -5,WORLD_SPACE);
- double direction[3];
- STATE_camera_get_direction(camera, &direction[0], &direction[1], &direction[2]);
- direction[2]=0;
- if(STATE_math_normalize_vector(direction)==VR_ERROR){
-
- set_vector(direction, 1,0,0);
- }
-
- if((*player_stage!=FALLING) && (GetAsyncKeyState(VK_UP)<0)) {
- *player_stage=WALKING;
- mul_vector(direction,STEP);
-
- (*player_stage_progress)++;
- if(*player_stage_progress>=SIZE_OF_WALKING_EFFECT) {
- *player_stage_progress=0;
- }
- if( ((*player_stage_progress) % (SIZE_OF_WALKING_EFFECT/4))==0) {
- int sound_num=(*player_stage_progress)/(SIZE_OF_WALKING_EFFECT/4);
- STATE_sound_play(sounds[sound_num], SOUND_NO_LOOP);
- }
- }
- else
- if((*player_stage!=FALLING) && (GetAsyncKeyState(VK_DOWN)<0)) {
- mul_vector(direction,-STEP);
- *player_stage=WALKING;
-
- (*player_stage_progress)--;
- if((*player_stage_progress)<0) *player_stage_progress=SIZE_OF_WALKING_EFFECT-1;
- if( ((*player_stage_progress) % (SIZE_OF_WALKING_EFFECT/4))==0) {
- int sound_num=(*player_stage_progress)/(SIZE_OF_WALKING_EFFECT/4);
- STATE_sound_play(sounds[sound_num], SOUND_NO_LOOP);
- }
- }
- else {
- if(*player_stage!=FALLING)
- *player_stage=STANDING;
- return;
- }
- double wanted_location[3];
- STATE_camera_get_location(camera, &wanted_location[0], &wanted_location[1], &wanted_location[2]);
- add_vector(wanted_location, direction);
- int did_camera_move=STATE_camera_move_with_collision_detection(camera, wanted_location, VIEWER_SIZE);
- if(did_camera_move==NO) {
- if(*player_stage_progress==0)
- STATE_sound_play(sounds[SOUND_HIT_WALL], SOUND_NO_LOOP);
- }
- }
- void camera_move_according_to_mouse_input(DWORD camera)
- {
- DWORD static first_time_flag=YES;
- static POINT point;
-
- if(GetCursorPos( &point)==0)
- return;
- int center_x=(gl_player.window_rect.right-gl_player.window_rect.left)/2;
- int center_y=(gl_player.window_rect.bottom-gl_player.window_rect.top)/2;
-
- SetCursorPos(center_x, center_y);
-
- if(first_time_flag==YES) {
- first_time_flag=NO;
- return;
- }
- int diff_x=point.x-center_x;
- int diff_y=point.y-center_y;
- if(diff_x!=0)
- STATE_camera_rotate_z(camera, (double)-diff_x*MOUSE_SENSITIVITY,WORLD_SPACE);
- if(diff_y==0) return;
- double tilt=STATE_camera_get_tilt(camera);
- tilt-= (double)diff_y*MOUSE_SENSITIVITY;
- if(tilt>MAX_TILT) tilt=MAX_TILT;
- if(tilt<-MAX_TILT) tilt=-MAX_TILT;
- STATE_camera_set_tilt(camera, tilt);
-
- }
- void camera_update_location(DWORD camera, double walking_height_effect[], int *player_stage, int *player_stage_progress, DWORD sounds[])
- {
- camera_manage_free_falling(camera, walking_height_effect, player_stage, player_stage_progress, sounds);
- camera_move_according_to_keyboard_input(camera, player_stage, player_stage_progress, sounds);
- camera_move_according_to_mouse_input(camera);
- }
- void intitialize_walking_height_effect_array(double walking_height_effect[])
- {
- double step=2*M_PI/SIZE_OF_WALKING_EFFECT;
- double angle=0;
- for(int i=0; i<SIZE_OF_WALKING_EFFECT; i++) {
- walking_height_effect[i]=sin(angle)*WALKING_EFFECT_HEIGHT;
- angle+=step;
- }
- }
- void load_sounds(DWORD sounds[])
- {
- for(int i=0; i<4; i++) {
- char file_name[1000];
- sprintf(file_name,"sound\step%d.wav",i+1);
- sounds[i]=STATE_sound_load(file_name, NULL, SOUND_DISTANCE_DEFAULT);
- }
- sounds[SOUND_FALL]=STATE_sound_load("sound\fall1.wav", NULL, SOUND_DISTANCE_DEFAULT);
- sounds[SOUND_HIT_WALL]=STATE_sound_load("sound\hit_wall.wav", NULL, SOUND_DISTANCE_DEFAULT);
- sounds[SOUND_SHOOT]=STATE_sound_load("sound\shoot.wav", NULL, SOUND_DISTANCE_DEFAULT);
- }
- void create_the_weapon_fire_effect(void)
- {
- gl_player.fire_effect_polygon=STATE_polygon_create();
- int num_of_polygons=STATE_object_get_number_of_polygons(gl_player.weapon);
- DWORD *all_polygons=(DWORD *)GlobalAlloc(GPTR, num_of_polygons*sizeof(DWORD));
- STATE_object_get_all_polygons(gl_player.weapon, all_polygons);
- double edge_point[3];
- // find_a_point_at_the_end_of_the_weapon(all_polygons, num_of_polygons, edge_point);
- GlobalFree((HGLOBAL)all_polygons);
- double point1[6]={0,0,0, 0,0, 100};
- double point2[6]={0,0,0, 1,0, 100};
- double point3[6]={0,0,0, 1,1, 100};
- double point4[6]={0,0,0, 0,1, 100};
- double size=VIEWER_SIZE/10;
- set_vector(point1, edge_point[0], edge_point[1]-size, edge_point[2]+size);
- set_vector(point2, edge_point[0], edge_point[1]+size, edge_point[2]+size);
- set_vector(point3, edge_point[0], edge_point[1]+size, edge_point[2]-size);
- set_vector(point4, edge_point[0], edge_point[1]-size, edge_point[2]-size);
-
- STATE_polygon_add_point(gl_player.fire_effect_polygon, point1);
- STATE_polygon_add_point(gl_player.fire_effect_polygon, point2);
- STATE_polygon_add_point(gl_player.fire_effect_polygon, point3);
- STATE_polygon_add_point(gl_player.fire_effect_polygon, point4);
-
- STATE_object_add_polygon(gl_player.weapon, gl_player.fire_effect_polygon);
- STATE_polygon_set_animation(gl_player.fire_effect_polygon, gl_player.fire_animation);
- STATE_polygon_set_translucent(gl_player.fire_effect_polygon,LIGHT_SOURCE_GLASS);
- STATE_polygon_disable(gl_player.fire_effect_polygon);
- }
- DWORD create_master_shred(void)
- {
- DWORD obj=STATE_object_create("shred");
- DWORD poly=STATE_polygon_create();
-
- double point1[6]={0,0,0, 0,0, 100};
- double point2[6]={0,0,0, 1,0, 100};
- double point3[6]={0,0,0, 1,1, 100};
- double point4[6]={0,0,0, 0,1, 100};
- double size=SHRED_SIZE;
- set_vector(point1, 0, -size, size);
- set_vector(point2, 0, size, size);
- set_vector(point3, 0, size, -size);
- set_vector(point4, 0, -size, -size);
- STATE_polygon_add_point(poly, point1);
- STATE_polygon_add_point(poly, point2);
- STATE_polygon_add_point(poly, point3);
- STATE_polygon_add_point(poly, point4);
-
- STATE_object_add_polygon(obj, poly);
- STATE_polygon_set_rotated(poly, YES);
- DWORD mask_bitmap=STATE_bitmap_load("weapon\mask.bmp",-1);
- STATE_polygon_set_second_bitmap(poly, mask_bitmap);
- STATE_polygon_set_translucent(poly, LIGHT_SOURCE_GLASS );
-
- STATE_object_disable(obj);
- return(obj);
- }
- int load_weapon(void)
- {
- gl_player.weapon = STATE_object_create_from_file("weapon\weapon2.md2");
- if(gl_player.weapon == NULL)
- return(VR_ERROR);
-
- DWORD skin = STATE_bitmap_load("weapon\weapon2.bmp",-1);
- STATE_object_set_bitmap(gl_player.weapon, skin);
- double box[2][3];
- STATE_object_get_bounding_box(gl_player.weapon, box);
- double weapon_size=box[1][0]-box[0][0];
- if(weapon_size==0) return(VR_ERROR);
- double factor=VIEWER_SIZE/(2*weapon_size);
- double scale[3] = {factor,factor,factor};
- STATE_object_set_scale(gl_player.weapon, scale);
- DWORD anim3d = STATE_object_get_3D_animation(gl_player.weapon);
- if(anim3d != NULL) {
- gl_player.weapon_idle_sequence = STATE_3D_sequence_get_using_name(anim3d, "idle");
- STATE_object_set_3D_sequence(gl_player.weapon, gl_player.weapon_idle_sequence, 0);
- gl_player.weapon_shooting_sequence=STATE_3D_sequence_get_using_name(anim3d, "shot");
- }
- gl_player.fire_animation=STATE_animation_create("shoot");
- DWORD frame1=STATE_bitmap_load("weapon\Mflash2.bmp",-1);
- DWORD frame2=STATE_bitmap_load("weapon\Mflash3.bmp",-1);
- DWORD frame3=STATE_bitmap_load("weapon\Mflash4.bmp",-1);
- STATE_animation_add_bitmap(gl_player.fire_animation, BITMAP_LIST_FRONT, frame1, -1);
- STATE_animation_add_bitmap(gl_player.fire_animation, BITMAP_LIST_FRONT, frame2, -1);
- STATE_animation_add_bitmap(gl_player.fire_animation, BITMAP_LIST_FRONT, frame3, -1);
- DWORD times[3]={1,1,1};
- STATE_animation_set_times(gl_player.fire_animation, times, 3);
- create_the_weapon_fire_effect();
- gl_player.is_shooting=NO;
- gl_player.weapon_shooting_mark_bitmap=STATE_bitmap_load("weapon\smark.bmp",-1);
- gl_player.shooting_shred=create_master_shred();
- return(OK);
- }
- int initialize(double walking_height_effect[], DWORD sounds[])
- {
-
-
-
-
- int rc=STATE_engine_load_world("arena.STATE","", "bitmaps", USER_DEFINED_BEHAVIOR | MIPMAP_STABLE);
- if(rc==VR_ERROR)
- return(VR_ERROR);
-
- ShowCursor(FALSE);
-
- STATE_engine_maximize_default_rendering_window();
-
- intitialize_walking_height_effect_array(walking_height_effect);
- DWORD camera=STATE_camera_get_default_camera();
-
- STATE_camera_set_chase_type(camera,NO_CHASE);
- if(load_weapon()==VR_ERROR) return(VR_ERROR);
- load_sounds(sounds);
- for (int i=0;i<100;i++)
- g_skyArray[i]=NULL;
- int sky_poly_count=0;
- for (DWORD poly=STATE_polygon_get_first_polygon();poly!=NULL;poly=STATE_polygon_get_next(poly))
- {
- if (!strcmp(STATE_polygon_get_name(poly),"Sky")){
-
- g_skyArray[sky_poly_count]=poly;
- sky_poly_count++;
-
- }
-
- }
-
- STATE_3D_card_set_full_screen_mode(800,600);
- GetClipCursor(&gl_player.window_rect);
- return(OK);
- }
- void draw_crosshair(HDC dc_handle, DWORD camera)
- {
- int width=STATE_camera_get_width(camera);
- int height=STATE_camera_get_height(camera);
- int center_x=width/2;
- int center_y=height/2;
- SelectObject(dc_handle, GetStockObject(GRAY_BRUSH));
- SelectObject(dc_handle, gl_player.crosshair_pen);
- Ellipse(dc_handle, center_x-3, center_y-3, center_x+3, center_y+3);
- Arc(dc_handle, center_x-12, center_y-12, center_x+12, center_y+12, center_x+12, center_y, center_x+12, center_y);
- MoveToEx(dc_handle, center_x-60, center_y, NULL);
- LineTo(dc_handle, center_x+60, center_y);
- MoveToEx(dc_handle, center_x, center_y-60, NULL);
- LineTo(dc_handle, center_x, center_y+60);
-
- }
- void move_sky()
- {
- int i=0;
- DWORD poly;
- while(1){
- poly=g_skyArray[i];
- if(poly==NULL)
- break;
- for (DWORD point=STATE_polygon_get_first_point(poly);point!=NULL;point=STATE_point_get_next_point(point))
- {
- double xy[2];
- STATE_point_get_bitmap_xy(point,xy);
- xy[0]+=0.005;
- STATE_point_set_bitmap_xy(point,poly,xy);
- }
- STATE_polygon_is_valid(poly);
- i++;
- }
- }
- void create_a_shooting_shred(double target[3], DWORD target_polygon, DWORD target_object)
- {
- if(target_object!=NULL)
- return;
-
- DWORD shred=STATE_object_duplicate(gl_player.shooting_shred, YES);
- DWORD bmp=STATE_polygon_get_bitmap_handle(target_polygon);
- if(bmp!=NULL) {
- DWORD all_polys[1000];
- STATE_object_get_all_polygons(shred, all_polys);
- STATE_polygon_set_bitmap_fill(all_polys[0], bmp);
- }
-
- double normal[4];
- STATE_polygon_get_plane(target_polygon, normal);
- mul_vector(normal, 5);
- add_vector(target, normal);
- STATE_object_set_location(shred, target[0], target[1], target[2]);
- STATE_object_set_chase_type(shred,CHASE_PHYSICS);
-
- STATE_object_set_max_speed(shred, SHRED_SPEED*10);
-
- double speed[3]={rand()-RAND_MAX/2,rand()-RAND_MAX/2,rand()};
- STATE_object_set_speed(shred,speed);
- STATE_object_set_absolute_speed(shred,SHRED_SPEED);
- STATE_object_set_friction(shred, 0);
- STATE_object_set_elasticity(shred,0.4);
- double force[3]={0,0,-1};
- STATE_object_set_force(shred,force);
- STATE_object_set_event(shred, 5000, STATE_DELETE);
- }
- void set_weapon_direction(DWORD camera, double intersection[3], DWORD *blocking_polygon, DWORD *blocking_object)
- {
- double location[3], weapon_location[3];
- set_vector(location, -VIEWER_SIZE/2, VIEWER_SIZE/4, -VIEWER_SIZE/4);
- STATE_camera_convert_point_to_world_space(camera, location, weapon_location);
- STATE_object_set_location(gl_player.weapon, weapon_location[0], weapon_location[1], weapon_location[2]);
- double camera_location[3]={0,0,0};
- double far_ahead[3]={-10000000, 0,0};
- *blocking_polygon=NULL;
- *blocking_object=NULL;
- double direction[3];
- int rc=STATE_engine_is_movement_possible_camera_space(camera_location, far_ahead, blocking_polygon, intersection, blocking_object);
- if(rc==NO) {
- copy_vector(direction, intersection);
- sub_vector(direction, weapon_location);
- }
- else {
- STATE_camera_get_direction(camera, &direction[0], &direction[1], &direction[2]);
- }
-
- double old_direction[3];
- STATE_object_get_direction(gl_player.weapon, &old_direction[0], &old_direction[1], &old_direction[2]);
-
- mul_vector(direction, GUN_MOVING_SPEED);
- mul_vector(old_direction, (1-GUN_MOVING_SPEED));
- add_vector(direction, old_direction);
- STATE_object_set_direction(gl_player.weapon, direction[0], direction[1], direction[2]);
- }
- void manage_shooting(DWORD sounds[], double target[3], DWORD target_polygon, DWORD target_object)
- {
-
- int mouse_left_button= (GetAsyncKeyState(VK_LBUTTON)<0);
- if( (gl_player.is_shooting==NO) && mouse_left_button) {
- gl_player.is_shooting=YES;
- STATE_sound_play(sounds[SOUND_SHOOT], SOUND_NO_LOOP);
- STATE_polygon_enable(gl_player.fire_effect_polygon);
- STATE_object_set_3D_sequence(gl_player.weapon, gl_player.weapon_shooting_sequence, 0);
- return;
-
- }
- if( (gl_player.is_shooting==YES) && (mouse_left_button==0)) {
- gl_player.is_shooting=NO;
- STATE_sound_stop(sounds[SOUND_SHOOT]);
- STATE_polygon_disable(gl_player.fire_effect_polygon);
- STATE_object_set_3D_sequence(gl_player.weapon, gl_player.weapon_idle_sequence, 0);
- return;
- }
- if( gl_player.is_shooting==YES) {
- if(STATE_sound_is_sound_playing(sounds[SOUND_SHOOT])==NO) {
- gl_player.is_shooting=NO;
- STATE_polygon_disable(gl_player.fire_effect_polygon);
- STATE_object_set_3D_sequence(gl_player.weapon, gl_player.weapon_idle_sequence, 0);
- return;
- }
- // add_shooting_patch(target, target_polygon, target_object);
- create_a_shooting_shred(target, target_polygon, target_object);
- // if(target_object==gl_opponent.handle) {
- // gl_opponent.got_hit_flag=YES;
- // }
-
- }
- }
- void weapon_update(DWORD camera, DWORD sounds[])
- {
- double target[3];
- DWORD target_polygon, target_object;
-
- if(gl_player.weapon==NULL) return;
-
- set_weapon_direction(camera, target, &target_polygon, &target_object);
- manage_shooting(sounds, target, target_polygon, target_object);
- }
- int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- int initialize(double walking_height_effect[], DWORD sounds[]);
- void camera_update_location(DWORD camera, double walking_height_effect[], int *player_stage, int *player_stage_progress, DWORD sounds[]);
- void weapon_update(DWORD camera, DWORD sounds[]);
-
- DWORD sounds[NUMBER_OF_SOUNDS];
-
- double walking_height_effect[SIZE_OF_WALKING_EFFECT];
- int player_stage=STANDING;
- int player_stage_progress=0;
-
- if(initialize(walking_height_effect, sounds)==VR_ERROR) return(VR_ERROR);
- DWORD camera=STATE_camera_get_default_camera();
- while( (GetAsyncKeyState(VK_ESCAPE)&1) ==0 ) {
-
- HDC dc_handle=STATE_engine_render_on_dc(NULL,camera);
- draw_crosshair(dc_handle, camera);
- STATE_engine_copy_image_from_dc_to_screen();
- camera_update_location(camera, walking_height_effect, &player_stage, &player_stage_progress, sounds);
- weapon_update(camera, sounds);
-
- move_sky();
- }
-
- STATE_engine_close();
- return(OK);
- }