1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186 |
- #include <OVGA.h>
- #include <OMOUSE.h>
- #include <OFONT.h>
- #include <OBUTT3D.h>
- #include <OVBROWSE.h>
- #include <ONATION.h>
- #include <OFIRM.h>
- #include <OTOWN.h>
- #include <OSITE.h>
- #include <OUNIT.h>
- #include <OHELP.h>
- #include <OTUTOR.h>
- #include <ONEWS.h>
- #include <OBULLET.h>
- #include <OREBEL.h>
- #include <OREMOTE.h>
- #include <OSPY.h>
- #include <OINFO.h>
- #include <OGAME.h>
- #include <OWORLD.h>
- #include <OSYS.h>
- #include <ORAWRES.h>
- #include <OTALKRES.h>
- #include <OWEATHER.h>
- #include <OANLINE.h>
- #include <OTORNADO.h>
- #include <OSE.h>
- #include <OSNOWG.h>
- #include <OROCK.h>
- #include <OEFFECT.h>
- #include <OLOG.h>
- #include <OCONFIG.h>
- #include <OPOWER.h>
- #include <OSERES.h>
- #include <OIMGRES.h>
- #include <OWARPT.h>
- #include <OMOUSECR.h>
- #include <OFIRMDIE.h>
- #include <OOPTMENU.h>
- #include <OINGMENU.h>
- static int report_disp_frame_no;
- static Button3D button_menu;
- void Sys::detect()
- {
-
- if( view_mode != MODE_NORMAL &&
-
- !report_disp_frame_no )
-
- {
- return;
- }
-
- mouse.get_event();
- if( option_menu.is_active() )
- {
- option_menu.detect();
- return;
- }
- if( in_game_menu.is_active() )
- {
- in_game_menu.detect();
- return;
- }
- if( VBrowse::press_record )
- {
- VBrowse::press_vbrowse_ptr->detect();
- }
- if( mouse.is_key_event() )
- {
- process_key(mouse.scan_code, mouse.event_skey_state);
- }
- detect_button();
- detect_view();
- }
- void Sys::process()
- {
-
- if( vga_front.is_buf_lost() || vga_back.is_buf_lost() )
- {
- if (!restore())
- pause();
- }
-
- frame_count++;
- is_sync_frame = frame_count%3==0;
-
- se_ctrl.flush();
-
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin unit_array.process()");
- unit_array.process();
- seek_path.reset_total_node_avail();
- LOG_MSG("end unit_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin firm_array.process()");
- firm_array.process();
- LOG_MSG("end firm_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin town_array.process()");
- town_array.process();
- LOG_MSG("end town_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin nation_array.process()");
- nation_array.process();
- LOG_MSG("end nation_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin bullet_array.process()");
- bullet_array.process();
- LOG_MSG("end bullet_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin world.process()");
- world.process();
- LOG_MSG("end world.process()");
- LOG_MSG(m.get_random_seed());
- #ifndef AMPLUS
-
- LOG_MSG("begin anim_line.inc_phase()");
- anim_line.inc_phase();
- LOG_MSG("end anim_line.inc_phase()");
- LOG_MSG(m.get_random_seed());
- #endif
- LOG_MSG("begin tornado_array.process()");
- tornado_array.process();
- LOG_MSG("begin tornado_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin snow_ground_array.process()");
- snow_ground_array.process();
- LOG_MSG("end snow_ground_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin rock_array.process()");
- rock_array.process();
- LOG_MSG("end rock_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin dirt_array.process()");
- dirt_array.process();
- LOG_MSG("end dirt_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin effect_array.process()");
- effect_array.process();
- LOG_MSG("end effect_array.process()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin war_point_array.process()");
- war_point_array.process();
- LOG_MSG("end war_point_array.process()");
- LOG_MSG("begin firm_die.process()");
- firm_die_array.process();
- LOG_MSG("end firm_die.process()");
-
- if( ++day_frame_count > FRAMES_PER_DAY )
- {
- LOG_MSG("begin info.next_day()");
- info.next_day();
- LOG_MSG("end info.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin world.next_day()");
- world.next_day();
- LOG_MSG("end world.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin site_array.next_day()");
- site_array.next_day();
- LOG_MSG("end site_array.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin rebel_array.next_day()");
- rebel_array.next_day();
- LOG_MSG("end rebel_array.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin spy_array.next_day()");
- spy_array.next_day();
- LOG_MSG("end spy_array.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin sprite_res.update_speed()");
- if( config.weather_effect)
- sprite_res.update_speed();
- LOG_MSG("end sprite_res.update_speed()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin raw_res.next_day()");
- raw_res.next_day();
- LOG_MSG("end raw_res.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin talk_res.next_day()");
- talk_res.next_day();
- LOG_MSG("end talk_res.next_day()");
- LOG_MSG(m.get_random_seed());
- LOG_MSG("begin region_array.next_day()");
- region_array.next_day();
- LOG_MSG("end region_array.next_day()");
- LOG_MSG(m.get_random_seed());
- day_frame_count = 0;
- }
-
-
- unit_array.update_selected_trade_unit_info();
-
-
- LOG_MSG("begin sys.disp_frame");
- m.lock_seed();
- disp_frame();
- m.unlock_seed();
- LOG_MSG("end sys.disp_frame");
- LOG_MSG(m.get_random_seed() );
-
-
- unit_array.mp_mark_selected_caravan();
- unit_array.mp_mark_selected_ship();
-
-
-
-
- #ifdef DEBUG
- if(debug_sim_game_type==2)
- {
-
- if(m.random(50)==0)
- {
- #define MAX_ATTACKER 30
- int arraySize = unit_array.size();
- int i, j, i2, j2;
- short nationRecno;
- Unit *unitPtr, *targetPtr;
- short attackerArray[MAX_ATTACKER];
- short attackerCount = 0;
-
-
-
- for(i=int(m.get_random_seed()%arraySize)+1, j=1; j<=arraySize; j++, i++)
- {
- if(i>arraySize)
- i = 1;
- if(unit_array.is_deleted(i))
- continue;
- unitPtr = (Unit*) unit_array[i];
- if(!unitPtr->is_visible())
- continue;
- if(attackerCount)
- {
- if(unitPtr->nation_recno!=nationRecno)
- continue;
- }
- else
- nationRecno = unitPtr->nation_recno;
- err_when(i!=unitPtr->sprite_recno);
- err_when(i>arraySize);
- if(m.random(4)==0)
- attackerArray[attackerCount++] = i;
- if(attackerCount>=MAX_ATTACKER/2)
- break;
- }
-
-
-
- if(m.random(10))
- {
-
- for(i2=int(m.get_random_seed()%arraySize)+1, j2=1; j2<=arraySize; j2++, i2++)
- {
- if(i2>arraySize)
- i2 = 1;
- if(unit_array.is_deleted(i2))
- continue;
- targetPtr = (Unit*) unit_array[i2];
- if(!targetPtr->is_visible())
- continue;
- if(targetPtr->nation_recno==unitPtr->nation_recno)
- continue;
- err_when(i2>arraySize);
- unit_array.attack(targetPtr->next_x_loc(), targetPtr->next_y_loc(), 0, attackerArray, attackerCount, 0, 0);
- break;
- }
- }
- else
- unit_array.move_to(m.random(MAX_WORLD_X_LOC), m.random(MAX_WORLD_Y_LOC), 0, attackerArray, attackerCount, 1);
- }
- }
- #endif
-
- }
- void Sys::disp_button()
- {
- vga.use_back();
- button_menu.paint( 720, 6, "MENU-U", "MENU-D" );
- button_menu.set_help_code( "GAMEMENU" );
- vga.use_front();
- }
- void Sys::detect_button()
- {
-
- if( button_menu.detect() )
- {
-
-
- in_game_menu.enter(!remote.is_enable());
-
- return;
- }
-
- #define VIEW_MODE_BUTTON_WIDTH 58
- #define VIEW_MODE_BUTTON_HEIGHT 16
- #define VIEW_MODE_BUTTON_X_SPACE 5
- int i, x=6, y=8;
- static char viewModeArray[] =
- {
- MODE_NATION, MODE_TOWN, MODE_ECONOMY, MODE_TRADE, MODE_MILITARY, MODE_TECH, MODE_SPY, MODE_RANK
- };
- for( i=0 ; i<8 ; i++, x+=VIEW_MODE_BUTTON_WIDTH+VIEW_MODE_BUTTON_X_SPACE )
- {
- if( i==4 )
- {
- x=12;
- y=29;
- }
- if( nation_array.player_recno==0 && i<7 )
- continue;
- if( mouse.single_click( x, y, x+VIEW_MODE_BUTTON_WIDTH-1, y+VIEW_MODE_BUTTON_HEIGHT-1 ) )
- {
- int newMode = viewModeArray[i];
- if( view_mode == newMode )
- set_view_mode(MODE_NORMAL);
- else
- set_view_mode(newMode);
- break;
- }
- }
- }
- void Sys::set_view_mode(int viewMode, int viewingNationRecno, int viewingSpyRecno)
- {
- if( view_mode == viewMode )
- return;
-
- err_when( viewingNationRecno && nation_array.is_deleted(viewingNationRecno) );
- if( nation_array.is_deleted(info.default_viewing_nation_recno) )
- {
- if( viewMode != MODE_NORMAL && viewMode != MODE_RANK )
- return;
- }
-
- if( info.viewing_spy_recno )
- {
- if( !spy_array.is_deleted(info.viewing_spy_recno) )
- {
- Spy* spyPtr = spy_array[info.viewing_spy_recno];
- int needViewSecretSkill = spy_array.needed_view_secret_skill(info.viewing_spy_recno);
- int escapeChance = spyPtr->spy_skill - needViewSecretSkill;
- int killFlag = 0;
- if( escapeChance > 0 )
- {
- if( m2.random( escapeChance/15 )==0 )
- killFlag = 1;
- }
- if( killFlag )
- spyPtr->set_exposed(COMMAND_PLAYER);
- }
- info.viewing_spy_recno = 0;
- }
-
- if( viewMode == MODE_NORMAL )
- {
- info.viewing_nation_recno = info.default_viewing_nation_recno;
- }
- else
- {
- if( viewingNationRecno )
- info.viewing_nation_recno = viewingNationRecno;
- else
- info.viewing_nation_recno = info.default_viewing_nation_recno;
- info.viewing_spy_recno = viewingSpyRecno;
- }
- view_mode = viewMode;
- disp_view_mode();
- disp_view();
- }
- void Sys::disp_frame()
- {
- if( sys.signal_exit_flag )
- return;
- if( option_menu.is_active() )
- {
-
- option_menu.disp(need_redraw_flag);
-
- blt_virtual_buf();
- }
- else
- {
-
- if( need_redraw_flag )
- {
- info.disp_panel();
- world.paint();
- disp_button();
- world.refresh();
- disp_view();
- if( in_game_menu.is_active() )
- {
- vga.use_back();
- in_game_menu.disp();
- vga.use_front();
- }
- vga.blt_buf(0,0, VGA_WIDTH-1, VGA_HEIGHT-1, 0);
-
- disp_view_mode();
-
- info.disp();
- }
- else
- {
- update_view();
- info.update();
- }
-
- disp_map();
- blt_virtual_buf();
-
- if( !remote.is_enable() )
- help.disp();
- }
-
- #ifdef AMPLUS
- anim_line.inc_phase();
- #endif
- need_redraw_flag = 0;
- }
- void Sys::disp_view()
- {
- disp_zoom();
-
- report_disp_frame_no = 0;
-
-
- if( view_mode!=MODE_NORMAL )
- {
-
-
-
-
- vga.use_back();
- Vga::opaque_flag = config.opaque_report;
- switch( view_mode )
- {
- case MODE_TRADE:
- info.disp_trade(INFO_REPAINT);
- break;
- case MODE_MILITARY:
- info.disp_military(INFO_REPAINT);
- break;
- case MODE_ECONOMY:
- info.disp_economy(INFO_REPAINT);
- break;
- case MODE_TOWN:
- info.disp_town(INFO_REPAINT);
- break;
- case MODE_NATION:
- info.disp_nation(INFO_REPAINT);
- break;
- case MODE_TECH:
- info.disp_tech(INFO_REPAINT);
- break;
- case MODE_SPY:
- info.disp_spy(INFO_REPAINT);
- break;
- case MODE_RANK:
- info.disp_rank(INFO_REPAINT);
- break;
- case MODE_NEWS_LOG:
- info.disp_news_log(INFO_REPAINT);
- break;
- case MODE_AI_ACTION:
- info.disp_ai_action(INFO_REPAINT);
- break;
- }
- vga.use_front();
- Vga::opaque_flag = 0;
-
- report_disp_frame_no = 1;
-
- }
- }
- void Sys::update_view()
- {
- if( view_mode==MODE_NORMAL )
- {
- disp_zoom();
-
- report_disp_frame_no = 0;
-
-
- if( game.game_mode == GAME_TUTORIAL )
- tutor.disp();
-
- if( config.show_ai_info )
- {
- vga.use_back();
- nation_array.draw_profile();
- firm_array.draw_profile();
- town_array.draw_profile();
- unit_array.draw_profile();
- vga.use_front();
- }
- if( in_game_menu.is_active() )
- {
- vga.use_back();
- in_game_menu.disp();
- vga.use_front();
- }
-
- vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2);
- }
- else
- {
-
-
-
-
-
-
-
- if( report_disp_frame_no )
- {
- disp_zoom();
- report_disp_frame_no = 0;
- }
- else
- {
- vga.use_back();
- Vga::opaque_flag = config.opaque_report;
- switch( view_mode )
- {
- case MODE_TRADE:
- info.disp_trade(INFO_UPDATE);
- break;
- case MODE_MILITARY:
- info.disp_military(INFO_UPDATE);
- break;
- case MODE_ECONOMY:
- info.disp_economy(INFO_UPDATE);
- break;
- case MODE_TOWN:
- info.disp_town(INFO_UPDATE);
- break;
- case MODE_NATION:
- info.disp_nation(INFO_UPDATE);
- break;
- case MODE_TECH:
- info.disp_tech(INFO_UPDATE);
- break;
- case MODE_SPY:
- info.disp_spy(INFO_UPDATE);
- break;
- case MODE_RANK:
- info.disp_rank(INFO_UPDATE);
- break;
- case MODE_NEWS_LOG:
- info.disp_news_log(INFO_UPDATE);
- break;
- case MODE_AI_ACTION:
- info.disp_ai_action(INFO_UPDATE);
- break;
- }
- if( in_game_menu.is_active() )
- {
- in_game_menu.disp();
- }
- vga.use_front();
- Vga::opaque_flag = 0;
- vga.blt_buf(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2);
-
- report_disp_frame_no = 1;
-
- }
- }
- }
- void Sys::detect_view()
- {
- int enableAction;
- #ifdef AMPLUS
- enableAction = config.frame_speed > 0 || !remote.is_enable();
- #else
- enableAction = config.frame_speed > 0;
- #endif
- if( enableAction )
- info.detect();
- vga.use_back();
- switch( view_mode )
- {
- case MODE_TRADE:
- info.detect_trade();
- break;
- case MODE_MILITARY:
- info.detect_military();
- break;
- case MODE_ECONOMY:
- info.detect_economy();
- break;
- case MODE_TOWN:
- info.detect_town();
- break;
- case MODE_NATION:
- info.detect_nation();
- break;
- case MODE_TECH:
- info.detect_tech();
- break;
- case MODE_SPY:
- info.detect_spy();
- break;
- case MODE_RANK:
- info.detect_rank();
- break;
- case MODE_NEWS_LOG:
- info.detect_news_log();
- break;
- case MODE_AI_ACTION:
- info.detect_ai_action();
- break;
- }
- vga.use_front();
-
- if( view_mode==MODE_NORMAL && game.game_mode==GAME_TUTORIAL )
- {
- if( tutor.detect() )
- return;
- }
-
-
- if( news_array.detect() )
- return;
-
-
- if( mouse.any_click(RIGHT_BUTTON) && power.command_id )
- {
- power.command_id = 0;
- mouse.reset_click();
- info.disp();
- return;
- }
-
-
- if( world.detect() )
- return;
- if( view_mode == MODE_NORMAL )
- {
- if( world.detect_firm_town() )
- return;
-
- if( power.detect_frame() )
- return;
- }
- else
- {
- mouse_cursor.set_frame(0);
- }
-
- if( enableAction && power.detect_action() )
- {
- if(unit_array.selected_recno && se_res.mark_command_time() )
- {
- Unit *unitPtr = unit_array[unit_array.selected_recno];
- se_res.far_sound( unitPtr->cur_x_loc(), unitPtr->cur_y_loc(), 1, 'S',
- unitPtr->sprite_id, "ACK");
- }
- return;
- }
-
- if( !(mouse.event_skey_state & SHIFT_KEY_MASK) &&
- mouse.any_click(ZOOM_X1, ZOOM_Y1, ZOOM_X2, ZOOM_Y2, RIGHT_BUTTON) &&
- power.detect_select(mouse.click_x(RIGHT_BUTTON), mouse.click_y(RIGHT_BUTTON),
- mouse.click_x(RIGHT_BUTTON),mouse.click_y(RIGHT_BUTTON), 1, 0) )
- {
- return;
- }
-
-
- }
- void Sys::disp_map()
- {
-
- if( map_need_redraw )
- {
- world.map_matrix->draw();
- map_need_redraw = 0;
- }
- world.map_matrix->disp();
-
- firm_array.draw_dot();
- town_array.draw_dot();
- site_array.draw_dot();
- unit_array.draw_dot();
- war_point_array.draw_dot();
- tornado_array.draw_dot();
- world.map_matrix->draw_square();
-
- vga.blt_buf( MAP_X1, MAP_Y1 , MAP_X2 , MAP_Y2);
- }
- void Sys::disp_zoom()
- {
-
- ZoomMatrix* zoomMatrix = world.zoom_matrix;
- err_when(zoomMatrix->top_x_loc<0 || zoomMatrix->top_x_loc>=MAX_WORLD_X_LOC);
- err_when(zoomMatrix->top_y_loc<0 || zoomMatrix->top_y_loc>=MAX_WORLD_Y_LOC);
- World::view_top_x = zoomMatrix->top_x_loc * ZOOM_LOC_WIDTH;
- World::view_top_y = zoomMatrix->top_y_loc * ZOOM_LOC_HEIGHT;
-
- if( zoom_need_redraw )
- {
- long backupSeed = m.get_random_seed();
-
- world.zoom_matrix->draw();
- zoom_need_redraw = 0;
- }
-
- world.zoom_matrix->disp();
-
- #ifdef DEBUG
- if(debug2_enable_flag)
- world.zoom_matrix->draw_white_site();
- #endif
-
- world.zoom_matrix->draw_frame();
-
- info.draw_selected();
-
- news_array.disp();
-
- sys.frames_in_this_second++;
- if( view_mode==MODE_NORMAL )
- disp_frames_per_second();
- }
- void Sys::blt_virtual_buf()
- {
- if( !sys.debug_session )
- return;
-
- int frontLocked=0;
- if( vga_front.buf_locked )
- {
- vga_front.unlock_buf();
- frontLocked=1;
- }
- RECT bltRect;
- bltRect.left = 0;
- bltRect.top = 0;
- bltRect.right = VGA_WIDTH-1;
- bltRect.bottom = VGA_HEIGHT-1;
- int rc = vga_true_front.dd_buf->BltFast(
- 0, 0,
- vga_front.dd_buf,
- &bltRect,
- DDBLTFAST_WAIT );
- if( frontLocked )
- vga_front.lock_buf();
- }
- void Sys::disp_frames_per_second()
- {
- if( !config.show_ai_info )
- return;
- if( game.game_mode == GAME_TUTORIAL )
- return;
-
- DWORD curTime = m.get_time();
-
- if( last_second_time==0 )
- {
- last_second_time = curTime;
- frames_in_this_second = 0;
- return;
- }
-
- if( curTime >= last_second_time+1000 )
- {
- frames_per_second = frames_in_this_second;
-
- last_second_time += 1000;
- frames_in_this_second = 0;
- }
-
- String str;
- str = "Frames per second: ";
- str += frames_per_second;
- vga.use_back();
- font_news.disp( ZOOM_X1+10, ZOOM_Y1+10, str, MAP_X2);
- vga.use_front();
- }
- void Sys::disp_view_mode(int observeMode)
- {
-
- const int MIN_MODE_TO_DISPLAY = 1;
- const int MAX_MODE_TO_DISPLAY = 8;
- const int MODE_TO_DISPLAY_COUNT = MAX_MODE_TO_DISPLAY - MIN_MODE_TO_DISPLAY + 1;
- static short highLightX[MODE_TO_DISPLAY_COUNT] = { 0, 62, 124, 186, 7, 68, 129, 192};
- static short highLightY[MODE_TO_DISPLAY_COUNT] = { 0, 0, 0, 0, 19, 19, 19, 19};
- static short darkenX[MODE_TO_DISPLAY_COUNT] = { 7, 69, 132, 195, 13, 75, 139, 201};
- static short darkenY[MODE_TO_DISPLAY_COUNT] = { 8, 8, 8, 8, 29, 29, 29, 29};
- const int darkenWidth = 58;
- const int darkenHeight = 16;
- char scrollName[] = "SCROLL-0";
-
- scrollName[7] = 'B';
- image_button.put_front( 0,0, scrollName);
-
- if( view_mode >= MIN_MODE_TO_DISPLAY && view_mode <= MAX_MODE_TO_DISPLAY )
- {
-
- scrollName[7] = '0' + view_mode;
- image_button.put_front( highLightX[view_mode-MIN_MODE_TO_DISPLAY],
- highLightY[view_mode-MIN_MODE_TO_DISPLAY], scrollName);
- }
-
- if( observeMode || !nation_array.player_recno )
- {
- for( int j = 1; j <= 7; ++j )
- {
-
-
- vga_front.adjust_brightness(
- darkenX[j-MIN_MODE_TO_DISPLAY], darkenY[j-MIN_MODE_TO_DISPLAY],
- darkenX[j-MIN_MODE_TO_DISPLAY]+darkenWidth-1,
- darkenY[j-MIN_MODE_TO_DISPLAY]+darkenHeight-1, -8 );
- }
- }
- }
|