806 lines
25 KiB
C
806 lines
25 KiB
C
#ifndef RES_TGA_H_INCLUDED
|
|
#define RES_TGA_H_INCLUDED
|
|
|
|
#include <BaseTypes.h>
|
|
#include <lib/InsGL.h>
|
|
|
|
#include "RenderUtils.h"
|
|
|
|
enum
|
|
{
|
|
Tga_Unload = 0,
|
|
Tga_Loaded,
|
|
Tga_TexGen,
|
|
Tga_LoadFail,
|
|
};
|
|
|
|
static const char *tgaFilePath[] =
|
|
{
|
|
"./Res/image/logo.tga",
|
|
|
|
"./Res/image/AI_parking_available_leftarea.tga",
|
|
"./Res/image/AI_parking_available_leftslot1.tga",
|
|
"./Res/image/AI_parking_available_leftslot2.tga",
|
|
"./Res/image/AI_parking_available_leftslot3.tga",
|
|
"./Res/image/AI_parking_available_rightarea.tga",
|
|
"./Res/image/AI_parking_available_rightslot1.tga",
|
|
"./Res/image/AI_parking_available_rightslot2.tga",
|
|
"./Res/image/AI_parking_available_rightslot3.tga",
|
|
"./Res/image/AI_parking_unavailable_leftslot1.tga",
|
|
"./Res/image/AI_parking_unavailable_leftslot2.tga",
|
|
"./Res/image/AI_parking_unavailable_leftslot3.tga",
|
|
"./Res/image/AI_parking_unavailable_rightslot1.tga",
|
|
"./Res/image/AI_parking_unavailable_rightslot2.tga",
|
|
"./Res/image/AI_parking_unavailable_rightslot3.tga",
|
|
"./Res/image/AI_parking_used_leftslot1.tga",
|
|
"./Res/image/AI_parking_used_leftslot2.tga",
|
|
"./Res/image/AI_parking_used_leftslot3.tga",
|
|
"./Res/image/AI_parking_used_rigthslot1.tga",
|
|
"./Res/image/AI_parking_used_rigthslot2.tga",
|
|
"./Res/image/AI_parking_used_rigthslot3.tga",
|
|
|
|
"./Res/image/alert_dialog_background.tga",
|
|
"./Res/image/alert_dialog_cancel.tga",
|
|
"./Res/image/alert_dialog_confirm.tga",
|
|
"./Res/image/alert_dialog_confirm_single.tga",
|
|
"./Res/image/alert_simple_background.tga",
|
|
|
|
"./Res/image/charging_range_digit_0.tga",
|
|
"./Res/image/charging_range_digit_1.tga",
|
|
"./Res/image/charging_range_digit_2.tga",
|
|
"./Res/image/charging_range_digit_3.tga",
|
|
"./Res/image/charging_range_digit_4.tga",
|
|
"./Res/image/charging_range_digit_5.tga",
|
|
"./Res/image/charging_range_digit_6.tga",
|
|
"./Res/image/charging_range_digit_7.tga",
|
|
"./Res/image/charging_range_digit_8.tga",
|
|
"./Res/image/charging_range_digit_9.tga",
|
|
"./Res/image/charging_range_unit_KM.tga",
|
|
|
|
"./Res/image/cruise_arrow.tga",
|
|
"./Res/image/cruise_pointer_blue.tga",
|
|
"./Res/image/cruise_scale_disk_blue.tga",
|
|
|
|
"./Res/image/driving_high_beam.tga",
|
|
"./Res/image/driving_low_beam.tga",
|
|
"./Res/image/driving_white_body.tga",
|
|
"./Res/image/driving_white_led_brake.tga",
|
|
"./Res/image/driving_white_led_off.tga",
|
|
"./Res/image/driving_white_led_position.tga",
|
|
"./Res/image/driving_white_led_turn_left.tga",
|
|
"./Res/image/driving_white_led_turn_right.tga",
|
|
|
|
"./Res/image/hint_background.tga",
|
|
|
|
"./Res/image/gear_tip_d.tga",
|
|
// "./Res/image/gear_tip_d_gray.tga",
|
|
"./Res/image/gear_tip_n.tga",
|
|
// "./Res/image/gear_tip_n_gray.tga",
|
|
"./Res/image/gear_tip_p.tga",
|
|
// "./Res/image/gear_tip_p_gray.tga",
|
|
"./Res/image/gear_tip_r.tga",
|
|
// "./Res/image/gear_tip_r_gray.tga",
|
|
|
|
"./Res/image/led_acc_blue.tga",
|
|
"./Res/image/led_acc_blue_pointer.tga",
|
|
"./Res/image/led_acc_white_arrow.tga",
|
|
|
|
"./Res/image/led_brake_syserr.tga",
|
|
"./Res/image/led_main_alert.tga",
|
|
"./Res/image/led_charge_conn.tga",
|
|
"./Res/image/led_rear_fog.tga",
|
|
"./Res/image/led_high_beam.tga",
|
|
"./Res/image/led_high_beam_A.tga",
|
|
"./Res/image/led_low_beam.tga",
|
|
"./Res/image/led_low_beam_A.tga",
|
|
"./Res/image/led_position_hint.tga",
|
|
"./Res/image/led_epb.tga",
|
|
"./Res/image/led_seatbelt_d.tga",
|
|
"./Res/image/led_seatbelt_p.tga",
|
|
"./Res/image/led_car_body.tga",
|
|
"./Res/image/led_door_lb.tga",
|
|
"./Res/image/led_door_lf.tga",
|
|
"./Res/image/led_door_rb.tga",
|
|
"./Res/image/led_door_rf.tga",
|
|
"./Res/image/led_seatbelt_bl.tga",
|
|
"./Res/image/led_seatbelt_bl_gray.tga",
|
|
"./Res/image/led_seatbelt_bm.tga",
|
|
"./Res/image/led_seatbelt_bm_gray.tga",
|
|
"./Res/image/led_seatbelt_br.tga",
|
|
"./Res/image/led_seatbelt_br_gray.tga",
|
|
// "./Res/image/led_auto_pilot_blue.tga",
|
|
// "./Res/image/led_auto_pilot_gray.tga",
|
|
// "./Res/image/led_auto_pilot_red.tga",
|
|
"./Res/image/led_ac_overcost.tga",
|
|
"./Res/image/led_acc_hold.tga",
|
|
"./Res/image/led_battery_cold.tga",
|
|
"./Res/image/led_speed_limit_bg.tga",
|
|
"./Res/image/led_traffic_camera.tga",
|
|
"./Res/image/led_turn_left.tga",
|
|
"./Res/image/led_turn_right.tga",
|
|
|
|
"./Res/image/led_12v_bat.tga",
|
|
"./Res/image/led_abs.tga",
|
|
"./Res/image/led_air_bag.tga",
|
|
"./Res/image/led_anti_theft.tga",
|
|
"./Res/image/led_avh_green.tga",
|
|
"./Res/image/led_avh_yellow.tga",
|
|
"./Res/image/led_back_trunk_err.tga",
|
|
"./Res/image/led_battery_err.tga",
|
|
"./Res/image/led_bat_lack.tga",
|
|
"./Res/image/led_battery_lack.tga",
|
|
"./Res/image/led_battery_off.tga",
|
|
"./Res/image/led_battery_overheat.tga",
|
|
"./Res/image/led_epb_err.tga",
|
|
"./Res/image/led_eps.tga",
|
|
"./Res/image/led_esp.tga",
|
|
"./Res/image/led_esp_off.tga",
|
|
"./Res/image/led_hdc_green.tga",
|
|
"./Res/image/led_hdc_yellow.tga",
|
|
"./Res/image/led_intelligent_sys_err.tga",
|
|
"./Res/image/led_motor_err.tga",
|
|
"./Res/image/led_motor_overheat.tga",
|
|
"./Res/image/led_scrubbing_lack.tga",
|
|
"./Res/image/led_tpms.tga",
|
|
"./Res/image/led_power_limit.tga",
|
|
|
|
"./Res/image/menu_2nd_bg.tga",
|
|
"./Res/image/menu_2nd_icon_brightness.tga",
|
|
"./Res/image/menu_2nd_icon_fan.tga",
|
|
"./Res/image/menu_2nd_icon_temp_bg.tga",
|
|
"./Res/image/menu_2nd_icon_temp_progress.tga",
|
|
"./Res/image/menu_2nd_icon_windymode_down.tga",
|
|
"./Res/image/menu_2nd_icon_windymode_side.tga",
|
|
"./Res/image/menu_2nd_icon_windymode_up.tga",
|
|
"./Res/image/menu_2nd_value_set_cursor.tga",
|
|
"./Res/image/menu_2nd_value_set_progress.tga",
|
|
"./Res/image/menu_2nd_value_set_progress_bg.tga",
|
|
"./Res/image/menu_icon_brightness.tga",
|
|
"./Res/image/menu_icon_camera.tga",
|
|
"./Res/image/menu_icon_fan.tga",
|
|
"./Res/image/menu_icon_media.tga",
|
|
"./Res/image/menu_icon_thermometer.tga",
|
|
"./Res/image/menu_icon_version.tga",
|
|
"./Res/image/menu_icon_windymode.tga",
|
|
"./Res/image/menu_2nd_icon_music_blt.tga",
|
|
"./Res/image/menu_2nd_icon_music_local.tga",
|
|
"./Res/image/menu_2nd_icon_radio_local.tga",
|
|
"./Res/image/menu_2nd_icon_radio_tbook.tga",
|
|
|
|
"./Res/image/menu_left_acc_1.tga",
|
|
"./Res/image/menu_left_acc_2.tga",
|
|
"./Res/image/menu_left_acc_3.tga",
|
|
"./Res/image/menu_left_acc_4.tga",
|
|
"./Res/image/menu_left_acc_5.tga",
|
|
"./Res/image/menu_left_bg.tga",
|
|
"./Res/image/menu_left_icon_voice.tga",
|
|
"./Res/image/menu_left_progress_bar.tga",
|
|
"./Res/image/menu_left_progress_cursor.tga",
|
|
"./Res/image/menu_left_shadow.tga",
|
|
"./Res/image/menu_left_txt_acc.tga",
|
|
"./Res/image/menu_left_txt_voice_ai.tga",
|
|
"./Res/image/menu_left_txt_voice_media.tga",
|
|
"./Res/image/menu_left_txt_voice_phone.tga",
|
|
|
|
"./Res/image/module_L0_text_energy.tga",
|
|
"./Res/image/module_L0_text_media.tga",
|
|
"./Res/image/module_L0_text_navigation.tga",
|
|
"./Res/image/module_L0_text_null.tga",
|
|
"./Res/image/module_L0_text_status.tga",
|
|
"./Res/image/module_L0_text_telephone.tga",
|
|
"./Res/image/module_L0_text_trip.tga",
|
|
"./Res/image/module_L0_text_weather.tga",
|
|
"./Res/image/module_L0_text_clock.tga",
|
|
|
|
"./Res/image/nav_icon_nav_disable.tga",
|
|
"./Res/image/nav_icon_destination.tga",
|
|
"./Res/image/nav_icon_enter_roundabout.tga",
|
|
"./Res/image/nav_icon_enter_toll_station.tga",
|
|
"./Res/image/nav_icon_enter_tunnel.tga",
|
|
"./Res/image/nav_icon_exit_roundabout.tga",
|
|
"./Res/image/nav_icon_go_straight.tga",
|
|
"./Res/image/nav_icon_left_back.tga",
|
|
"./Res/image/nav_icon_left_front.tga",
|
|
"./Res/image/nav_icon_right_back.tga",
|
|
"./Res/image/nav_icon_right_front.tga",
|
|
"./Res/image/nav_icon_turn_left.tga",
|
|
"./Res/image/nav_icon_turn_right.tga",
|
|
"./Res/image/nav_icon_turn_round.tga",
|
|
"./Res/image/nav_tips_arrive_destination.tga",
|
|
"./Res/image/nav_tips_cost_left.tga",
|
|
"./Res/image/nav_tips_next_enter.tga",
|
|
"./Res/image/nav_unit_next_distance_km.tga",
|
|
"./Res/image/nav_unit_next_distance_m.tga",
|
|
"./Res/image/nav_module_shadow.tga",
|
|
"./Res/image/nav_tips_disable.tga",
|
|
|
|
"./Res/image/traffic_line_dotted.tga",
|
|
"./Res/image/traffic_line_solid.tga",
|
|
|
|
"./Res/image/ui3_basic_battery_bg.tga",
|
|
"./Res/image/ui3_basic_battery_full_green.tga",
|
|
"./Res/image/ui3_basic_battery_full_red.tga",
|
|
"./Res/image/ui3_basic_battery_full_yellow.tga",
|
|
"./Res/image/ui3_basic_battery_high_light.tga",
|
|
|
|
// "./Res/image/ui3_basic_bg_backing.tga",
|
|
"./Res/image/ui3_basic_bg_bottom.tga",
|
|
// "./Res/image/ui3_basic_bg_parking.tga",
|
|
"./Res/image/ui3_basic_temperature_icon.tga",
|
|
"./Res/image/ui3_basic_mute_icon.tga",
|
|
// "./Res/image/ui3_basic_bg_backing_night.tga",
|
|
"./Res/image/ui3_basic_bg_bottom_night.tga",
|
|
// "./Res/image/ui3_basic_bg_parking_night.tga",
|
|
|
|
"./Res/image/ui3_gear_D_gray.tga",
|
|
"./Res/image/ui3_gear_N_gray.tga",
|
|
"./Res/image/ui3_gear_PRND_gray.tga",
|
|
"./Res/image/ui3_gear_P_gray.tga",
|
|
"./Res/image/ui3_gear_R_gray.tga",
|
|
|
|
"./Res/image/ui3_led_ready.tga",
|
|
};
|
|
|
|
static const Vec2i tgaLtp[] =
|
|
{
|
|
{0,0},//logo
|
|
{630,397},//AI_parking_available_leftarea
|
|
{773,401},//AI_parking_available_leftslot1
|
|
{740,474},//AI_parking_available_leftslot2
|
|
{704,548},//AI_parking_available_leftslot3
|
|
{1040,397},//AI_parking_available_rightarea
|
|
{1057,401},//AI_parking_available_rightslot1
|
|
{1085,474},//AI_parking_available_rightslot2
|
|
{1113,548},//AI_parking_available_rightslot3
|
|
{773,401},//AI_parking_unavailable_leftslot1
|
|
{738,474},//AI_parking_unavailable_leftslot2
|
|
{704,548},//AI_parking_unavailable_leftslot3
|
|
{1057,401},//AI_parking_unavailable_rightslot1
|
|
{1084,474},//AI_parking_unavailable_rightslot2
|
|
{1113,548},//AI_parking_unavailable_rightslot3
|
|
{773,401},//AI_parking_used_leftslot1
|
|
{738,474},//AI_parking_used_leftslot2
|
|
{704,548},//AI_parking_used_leftslot3
|
|
{1057,401},//AI_parking_used_rigthslot1
|
|
{1082,474},//AI_parking_used_rigthslot2
|
|
{1113,548},//AI_parking_used_rigthslot3
|
|
|
|
{715,448},//alert_dialog_background
|
|
{778,546},//alert_dialog_cancel
|
|
{943,546},//alert_dialog_confirm
|
|
{840,546},//alert_dialog_confirm_single
|
|
{715,518},//alert_simple_background
|
|
|
|
{898,566},//charging_range_digit_0
|
|
{903,566},//charging_range_digit_1
|
|
{897,566},//charging_range_digit_2
|
|
{898,566},//charging_range_digit_3
|
|
{895,566},//charging_range_digit_4
|
|
{898,567},//charging_range_digit_5
|
|
{897,566},//charging_range_digit_6
|
|
{898,567},//charging_range_digit_7
|
|
{898,566},//charging_range_digit_8
|
|
{898,566},//charging_range_digit_9
|
|
{1041,599},//charging_range_unit_KM
|
|
|
|
{749+41-10,156+44-60},//cruise_arrow
|
|
{769+41-10,155+44-60},//cruise_pointer_blue
|
|
{764+41-10,136+44-60},//cruise_scale_disk_blue
|
|
|
|
{821,385},//driving_high_beam
|
|
{821,410},//driving_low_beam
|
|
{786,428},//driving_white_body
|
|
{898,528},//driving_white_led_brake
|
|
{897,542},//driving_white_led_off
|
|
{898,556},//driving_white_led_position
|
|
{899,562},//driving_white_led_turn_left
|
|
{983,562},//driving_white_led_turn_right
|
|
|
|
{715,270},//hint_background
|
|
|
|
{853+36,86+16},//gear_tip_d
|
|
// {853,91},//gear_tip_d_gray
|
|
{853+36,86+16},//gear_tip_n
|
|
// {853,91},//gear_tip_n_gray
|
|
{853+36,86+16},//gear_tip_p
|
|
// {853,91},//gear_tip_p_gray
|
|
{853+36,86+16},//gear_tip_r
|
|
// {853+36,91},//gear_tip_r_gray
|
|
|
|
{831,204},//led_acc_blue
|
|
{0,0},//led_acc_blue_pointer
|
|
{0,0},//led_acc_white_arrow
|
|
|
|
{1665,47},//led_brake_syserr
|
|
{1593,47},//led_main_alert
|
|
{1521,47},//led_charge_conn
|
|
{1449,47},//led_rear_fog
|
|
{1377,47},//led_high_beam
|
|
{1377,47},//led_high_beam_A
|
|
{1377,47},//led_low_beam
|
|
{1377,47},//led_low_beam_A
|
|
{1305,47},//led_position_hint
|
|
{1233,47},//led_epb
|
|
{758,47},//led_seatbelt_d
|
|
{1161,47},//led_seatbelt_p
|
|
{686,47},//led_car_body
|
|
{671,49},//led_door_lb
|
|
{671,40},//led_door_lf
|
|
{694,50},//led_door_rb
|
|
{694,41},//led_door_rf
|
|
{470,47},//led_seatbelt_bl
|
|
{470,47},//led_seatbelt_bl_gray
|
|
{542,46},//led_seatbelt_bm
|
|
{542,46},//led_seatbelt_bm_gray
|
|
{614,47},//led_seatbelt_br
|
|
{614,47},//led_seatbelt_br_gray
|
|
// {1092+3,203-57},//led_auto_pilot_blue
|
|
// {1092+3,203-57},//led_auto_pilot_gray
|
|
// {1092,203-60},//led_auto_pilot_red
|
|
{752,662},//led_ac_overcost
|
|
{959,225+7},//led_acc_hold
|
|
{753,662},//led_battery_cold
|
|
{849,313},//led_speed_limit_bg
|
|
{1068,313},//led_traffic_camera
|
|
{732,202},//led_turn_left
|
|
{1188,202},//led_turn_right
|
|
|
|
{0,0},//led_12v_bat
|
|
{0,0},//led_abs
|
|
{0,0},//led_air_bag
|
|
{0,0},//led_anti_theft
|
|
{0,0},//led_avh_green
|
|
{0,0},//led_avh_yellow
|
|
{0,0},//led_back_trunk_err
|
|
{0,0},//led_bat_lack
|
|
{0,0},//led_battery_err
|
|
{0,0},//led_battery_lack
|
|
{0,0},//led_battery_off
|
|
{0,0},//led_battery_overheat
|
|
{0,0},//led_epb_err
|
|
{0,0},//led_eps
|
|
{0,0},//led_esp
|
|
{0,0},//led_esp_off
|
|
{0,0},//led_hdc_green
|
|
{0,0},//led_hdc_yellow
|
|
{0,0},//led_intelligent_sys_err
|
|
{0,0},//led_motor_err
|
|
{0,0},//led_motor_overheat
|
|
{0,0},//led_scrubbing_lack
|
|
{0,0},//led_tpms
|
|
{0,0},//led_power_limit
|
|
|
|
{1302,250},//menu_2nd_bg
|
|
{1337,312},//menu_2nd_icon_brightness
|
|
{1337,297},//menu_2nd_icon_fan
|
|
{1342,298},//menu_2nd_icon_temp_bg
|
|
{1354,323},//menu_2nd_icon_temp_progress
|
|
{1407,432},//menu_2nd_icon_windymode_down
|
|
{1407,251},//menu_2nd_icon_windymode_side
|
|
{1407,251},//menu_2nd_icon_windymode_up
|
|
{1672,381},//menu_2nd_value_set_cursor
|
|
{1673,250},//menu_2nd_value_set_progress
|
|
{1673,250},//menu_2nd_value_set_progress_bg
|
|
{1413,514},//menu_icon_brightness
|
|
{1416,348},//menu_icon_camera
|
|
{1413,248},//menu_icon_fan
|
|
{1417,428},//menu_icon_media
|
|
{1423,157},//menu_icon_thermometer
|
|
{1418,519},//menu_icon_version
|
|
{1407,348},//menu_icon_windymode
|
|
{0,0},//menu_2nd_icon_music_blt
|
|
{0,0},//menu_2nd_icon_music_local
|
|
{0,0},//menu_2nd_icon_radio_local
|
|
{0,0},//menu_2nd_icon_radio_tbook
|
|
|
|
{463,323},//menu_left_acc_1
|
|
{450,323},//menu_left_acc_2
|
|
{437,323},//menu_left_acc_3
|
|
{423,323},//menu_left_acc_4
|
|
{410,323},//menu_left_acc_5
|
|
{184,273},//menu_left_bg
|
|
{259,335},//menu_left_icon_voice
|
|
{607,288},//menu_left_progress_bar
|
|
{575,388},//menu_left_progress_cursor
|
|
{176,528},//menu_left_shadow
|
|
{245,390},//menu_left_txt_acc
|
|
{450,389},//menu_left_txt_voice_ai
|
|
{450,389},//menu_left_txt_voice_media
|
|
{450,389},//menu_left_txt_voice_phone
|
|
|
|
{408,345-35-8},//module_L0_text_energy
|
|
{408,345-35-8},//module_L0_text_media
|
|
{408,345-35-8},//module_L0_text_navigation
|
|
{408,345-35-8},//module_L0_text_null
|
|
{408,345-35-8},//module_L0_text_status
|
|
{408,345-35-8},//module_L0_text_telephone
|
|
{408,345-35-8},//module_L0_text_trip
|
|
{408,345-35-8},//module_L0_text_weather
|
|
{408,345-35-8},//module_L0_text_clock
|
|
|
|
{166,263},//nav_icon_nav_disable
|
|
{171,265},//nav_icon_destination
|
|
{187,266},//nav_icon_enter_roundabout
|
|
{163,274},//nav_icon_enter_toll_station
|
|
{182,284},//nav_icon_enter_tunnel
|
|
{187,265},//nav_icon_exit_roundabout
|
|
{216,262},//nav_icon_go_straight
|
|
{204,262},//nav_icon_left_back
|
|
{208,262},//nav_icon_left_front
|
|
{186,262},//nav_icon_right_back
|
|
{188,262},//nav_icon_right_front
|
|
{190,262},//nav_icon_turn_left
|
|
{190,262},//nav_icon_turn_right
|
|
{186,262},//nav_icon_turn_round
|
|
{331,346},//nav_tips_arrive_destination
|
|
{332,407},//nav_tips_cost_left
|
|
{331,346},//nav_tips_next_enter
|
|
{456,314},//nav_unit_next_distance_km
|
|
{456,313},//nav_unit_next_distance_m
|
|
{103,483},//nav_module_shadow
|
|
{418,341},//nav_tips_disable
|
|
|
|
{0,0},//traffic_line_dotted
|
|
{0,0},//traffic_line_solid
|
|
|
|
{834,656},//ui3_basic_battery_bg
|
|
{834,656},//ui3_basic_battery_full_green
|
|
{834,656},//ui3_basic_battery_full_red
|
|
{834,656},//ui3_basic_battery_full_yellow
|
|
{838,662},//ui3_basic_battery_high_light
|
|
|
|
// {0,0},//ui3_basic_bg_backing
|
|
{0,626},//ui3_basic_bg_bottom
|
|
// {0,0},//ui3_basic_bg_parking
|
|
{1447,653},//ui3_basic_temperature_icon
|
|
{100,338-6},//ui3_basic_mute_icon
|
|
// {0,0},//ui3_basic_bg_backing_night
|
|
{0,630},//ui3_basic_bg_bottom_night
|
|
// {0,0},//ui3_basic_bg_parking_night
|
|
|
|
{1081,23},//ui3_gear_D_gray
|
|
{1024,23},//ui3_gear_N_gray
|
|
{923,33},//ui3_gear_PRND_gray
|
|
{910,23},//ui3_gear_P_gray
|
|
{967,23},//ui3_gear_R_gray
|
|
|
|
{800,34},//ui3_led_ready
|
|
};
|
|
|
|
enum
|
|
{
|
|
TGA_logo,
|
|
|
|
TGA_AI_parking_available_leftarea,
|
|
TGA_AI_parking_available_leftslot1,
|
|
TGA_AI_parking_available_leftslot2,
|
|
TGA_AI_parking_available_leftslot3,
|
|
TGA_AI_parking_available_rightarea,
|
|
TGA_AI_parking_available_rightslot1,
|
|
TGA_AI_parking_available_rightslot2,
|
|
TGA_AI_parking_available_rightslot3,
|
|
TGA_AI_parking_unavailable_leftslot1,
|
|
TGA_AI_parking_unavailable_leftslot2,
|
|
TGA_AI_parking_unavailable_leftslot3,
|
|
TGA_AI_parking_unavailable_rightslot1,
|
|
TGA_AI_parking_unavailable_rightslot2,
|
|
TGA_AI_parking_unavailable_rightslot3,
|
|
TGA_AI_parking_used_leftslot1,
|
|
TGA_AI_parking_used_leftslot2,
|
|
TGA_AI_parking_used_leftslot3,
|
|
TGA_AI_parking_used_rigthslot1,
|
|
TGA_AI_parking_used_rigthslot2,
|
|
TGA_AI_parking_used_rigthslot3,
|
|
|
|
TGA_alert_dialog_background,
|
|
TGA_alert_dialog_cancel,
|
|
TGA_alert_dialog_confirm,
|
|
TGA_alert_dialog_confirm_single,
|
|
TGA_alert_simple_background,
|
|
|
|
TGA_charging_range_digit_0,
|
|
TGA_charging_range_digit_1,
|
|
TGA_charging_range_digit_2,
|
|
TGA_charging_range_digit_3,
|
|
TGA_charging_range_digit_4,
|
|
TGA_charging_range_digit_5,
|
|
TGA_charging_range_digit_6,
|
|
TGA_charging_range_digit_7,
|
|
TGA_charging_range_digit_8,
|
|
TGA_charging_range_digit_9,
|
|
TGA_charging_range_unit_KM,
|
|
|
|
TGA_cruise_arrow,
|
|
TGA_cruise_pointer_blue,
|
|
TGA_cruise_scale_disk_blue,
|
|
|
|
TGA_driving_high_beam,
|
|
TGA_driving_low_beam,
|
|
TGA_driving_white_body,
|
|
TGA_driving_white_led_brake,
|
|
TGA_driving_white_led_off,
|
|
TGA_driving_white_led_position,
|
|
TGA_driving_white_led_turn_left,
|
|
TGA_driving_white_led_turn_right,
|
|
|
|
TGA_hint_background,
|
|
|
|
TGA_gear_tip_D,
|
|
// TGA_gear_tip_D_gray,
|
|
TGA_gear_tip_N,
|
|
// TGA_gear_tip_N_gray,
|
|
TGA_gear_tip_P,
|
|
// TGA_gear_tip_P_gray,
|
|
TGA_gear_tip_R,
|
|
// TGA_gear_tip_R_gray,
|
|
|
|
TGA_led_acc_blue,
|
|
TGA_led_acc_blue_pointer,
|
|
TGA_led_acc_white_arrow,
|
|
|
|
TGA_led_brake_syserr,
|
|
TGA_led_main_alert,
|
|
TGA_led_charge_conn,
|
|
TGA_led_rear_fog,
|
|
TGA_led_high_beam,
|
|
TGA_led_high_beam_A,
|
|
TGA_led_low_beam,
|
|
TGA_led_low_beam_A,
|
|
TGA_led_position_hint,
|
|
TGA_led_epb,
|
|
TGA_led_seatbelt_d,
|
|
TGA_led_seatbelt_p,
|
|
TGA_led_car_body,
|
|
TGA_led_door_lb,
|
|
TGA_led_door_lf,
|
|
TGA_led_door_rb,
|
|
TGA_led_door_rf,
|
|
TGA_led_seatbelt_bl,
|
|
TGA_led_seatbelt_bl_gray,
|
|
TGA_led_seatbelt_bm,
|
|
TGA_led_seatbelt_bm_gray,
|
|
TGA_led_seatbelt_br,
|
|
TGA_led_seatbelt_br_gray,
|
|
// TGA_led_auto_pilot_blue,
|
|
// TGA_led_auto_pilot_gray,
|
|
// TGA_led_auto_pilot_red,
|
|
TGA_led_ac_overcost,
|
|
TGA_led_acc_hold,
|
|
TGA_led_battery_cold,
|
|
TGA_led_speed_limit_bg,
|
|
TGA_led_traffic_camera,
|
|
TGA_led_turn_left,
|
|
TGA_led_turn_right,
|
|
|
|
TGA_led_12v_bat,
|
|
TGA_led_abs,
|
|
TGA_led_air_bag,
|
|
TGA_led_anti_theft,
|
|
TGA_led_avh_green,
|
|
TGA_led_avh_yellow,
|
|
TGA_led_back_trunk_err,
|
|
TGA_led_battery_err,
|
|
TGA_led_bat_lack,
|
|
TGA_led_battery_lack,
|
|
TGA_led_battery_off,
|
|
TGA_led_battery_overheat,
|
|
TGA_led_epb_err,
|
|
TGA_led_eps,
|
|
TGA_led_esp,
|
|
TGA_led_esp_off,
|
|
TGA_led_hdc_green,
|
|
TGA_led_hdc_yellow,
|
|
TGA_led_intelligent_sys_err,
|
|
TGA_led_motor_err,
|
|
TGA_led_motor_overheat,
|
|
TGA_led_scrubbing_lack,
|
|
TGA_led_tpms,
|
|
TGA_led_power_limit,
|
|
|
|
TGA_menu_2nd_bg,
|
|
TGA_menu_2nd_icon_brightness,
|
|
TGA_menu_2nd_icon_fan,
|
|
TGA_menu_2nd_icon_temp_bg,
|
|
TGA_menu_2nd_icon_temp_progress,
|
|
TGA_menu_2nd_icon_windymode_down,
|
|
TGA_menu_2nd_icon_windymode_side,
|
|
TGA_menu_2nd_icon_windymode_up,
|
|
TGA_menu_2nd_value_set_cursor,
|
|
TGA_menu_2nd_value_set_progress,
|
|
TGA_menu_2nd_value_set_progress_bg,
|
|
TGA_menu_icon_brightness,
|
|
TGA_menu_icon_camera,
|
|
TGA_menu_icon_fan,
|
|
TGA_menu_icon_media,
|
|
TGA_menu_icon_thermometer,
|
|
TGA_menu_icon_version,
|
|
TGA_menu_icon_windymode,
|
|
TGA_menu_2nd_icon_music_blt,
|
|
TGA_menu_2nd_icon_music_local,
|
|
TGA_menu_2nd_icon_radio_local,
|
|
TGA_menu_2nd_icon_radio_tbook,
|
|
|
|
TGA_menu_left_acc_1,
|
|
TGA_menu_left_acc_2,
|
|
TGA_menu_left_acc_3,
|
|
TGA_menu_left_acc_4,
|
|
TGA_menu_left_acc_5,
|
|
TGA_menu_left_bg,
|
|
TGA_menu_left_icon_voice,
|
|
TGA_menu_left_progress_bar,
|
|
TGA_menu_left_progress_cursor,
|
|
TGA_menu_left_shadow,
|
|
TGA_menu_left_txt_acc,
|
|
TGA_menu_left_txt_voice_ai,
|
|
TGA_menu_left_txt_voice_media,
|
|
TGA_menu_left_txt_voice_phone,
|
|
|
|
TGA_module_L0_text_energy,
|
|
TGA_module_L0_text_media,
|
|
TGA_module_L0_text_navigation,
|
|
TGA_module_L0_text_null,
|
|
TGA_module_L0_text_status,
|
|
TGA_module_L0_text_telephone,
|
|
TGA_module_L0_text_trip,
|
|
TGA_module_L0_text_weather,
|
|
TGA_module_L0_text_clock,
|
|
|
|
TGA_nav_icon_nav_disable,
|
|
TGA_nav_icon_destination,
|
|
TGA_nav_icon_enter_roundabout,
|
|
TGA_nav_icon_enter_toll_station,
|
|
TGA_nav_icon_enter_tunnel,
|
|
TGA_nav_icon_exit_roundabout,
|
|
TGA_nav_icon_go_straight,
|
|
TGA_nav_icon_left_back,
|
|
TGA_nav_icon_left_front,
|
|
TGA_nav_icon_right_back,
|
|
TGA_nav_icon_right_front,
|
|
TGA_nav_icon_turn_left,
|
|
TGA_nav_icon_turn_right,
|
|
TGA_nav_icon_turn_round,
|
|
TGA_nav_tips_arrive_destination,
|
|
TGA_nav_tips_cost_left,
|
|
TGA_nav_tips_next_enter,
|
|
TGA_nav_unit_next_distance_km,
|
|
TGA_nav_unit_next_distance_m,
|
|
TGA_nav_module_shadow,
|
|
TGA_nav_tips_disable,
|
|
|
|
TGA_traffic_line_dotted,
|
|
TGA_traffic_line_solid,
|
|
|
|
TGA_ui3_basic_battery_bg,
|
|
TGA_ui3_basic_battery_full_green,
|
|
TGA_ui3_basic_battery_full_red,
|
|
TGA_ui3_basic_battery_full_yellow,
|
|
TGA_ui3_basic_battery_high_light,
|
|
|
|
// TGA_ui3_basic_bg_backing,
|
|
TGA_ui3_basic_bg_bottom,
|
|
// TGA_ui3_basic_bg_parking,
|
|
TGA_ui3_basic_temperature_icon,
|
|
TGA_ui3_basic_mute_icon,
|
|
// TGA_ui3_basic_bg_backing_night,
|
|
TGA_ui3_basic_bg_bottom_night,
|
|
// TGA_ui3_basic_bg_parking_night,
|
|
|
|
TGA_ui3_gear_D,
|
|
TGA_ui3_gear_N,
|
|
TGA_ui3_gear_PRND_gray,
|
|
TGA_ui3_gear_P,
|
|
TGA_ui3_gear_R,
|
|
|
|
TGA_ui3_led_ready,
|
|
|
|
TGA_NUM
|
|
};
|
|
|
|
static UInt08 tgaStatus[TGA_NUM];
|
|
static Image tgaImg[TGA_NUM];
|
|
|
|
static void Once_InitTgaInfo()
|
|
{
|
|
static Bool flag = INS_FALSE;
|
|
if(flag == INS_TRUE)return;
|
|
flag = INS_TRUE;
|
|
|
|
Int32 i;
|
|
for(i = 0; i < TGA_NUM; i++)
|
|
{
|
|
tgaImg[i].ltx = tgaLtp[i].x;
|
|
tgaImg[i].lty = tgaLtp[i].y;
|
|
tgaImg[i].dat = NULL;
|
|
tgaImg[i].tex = INS_INVALID_RES_ID;
|
|
tgaImg[i].w = 0;
|
|
tgaImg[i].h = 0;
|
|
tgaStatus[i] = Tga_Unload;
|
|
}
|
|
}
|
|
|
|
static void Once_LoadTgaData(Int32 id)
|
|
{
|
|
if(id < 0 || id >= TGA_NUM || tgaStatus[id] != Tga_Unload)return;
|
|
|
|
if(LoadTga(tgaFilePath[id], &tgaImg[id]) != INS_TRUE)
|
|
{
|
|
printf("load tga file fail[%s]\n", tgaFilePath[id]);
|
|
tgaStatus[id] = Tga_LoadFail;
|
|
return;
|
|
}
|
|
// tgaImg[id].ltx = tgaLtp[id].x;
|
|
// tgaImg[id].lty = tgaLtp[id].y;
|
|
// printf("Image ltx:%d, lty:%d w:%d, h:%d, fmt:0x%x[%s]\n",
|
|
// tgaImg[id].ltx, tgaImg[id].lty,
|
|
// tgaImg[id].w, tgaImg[id].h, tgaImg[id].fmt, tgaFilePath[id]);
|
|
|
|
tgaStatus[id] = Tga_Loaded;
|
|
// PrintCurrentTimeMs();
|
|
}
|
|
|
|
static void Once_GenTgaTexture(Int32 id, GLint interalformat, GLenum format)
|
|
{
|
|
if(id < 0 || id >= TGA_NUM || tgaStatus[id] != Tga_Loaded)return;// || tgaImg[id].tex[id] != 0
|
|
tgaStatus[id] = Tga_TexGen;
|
|
|
|
//printf("before Once_GenTgaTexture GL_ERR_CODE[0x%x]\n", glGetError());
|
|
glGenTextures(1, &(tgaImg[id].tex));
|
|
//printf("glGenTextures GL_ERR_CODE[0x%x]\n", glGetError());
|
|
glBindTexture(GL_TEXTURE_2D, tgaImg[id].tex);
|
|
//printf("glBindTexture GL_ERR_CODE[0x%x]\n", glGetError());
|
|
if(interalformat == GL_RGBA)
|
|
{
|
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
|
//printf("glPixelStorei 4 GL_ERR_CODE[0x%x]\n", glGetError());
|
|
}
|
|
else
|
|
{
|
|
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
|
//printf("glPixelStorei 1 GL_ERR_CODE[0x%x]\n", glGetError());
|
|
}
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
//printf("glTexParameteri GL_ERR_CODE[0x%x]\n", glGetError());
|
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
//printf("glTexParameteri GL_ERR_CODE[0x%x]\n", glGetError());
|
|
|
|
glTexImage2D(GL_TEXTURE_2D, 0, interalformat, tgaImg[id].w, tgaImg[id].h, 0, format, GL_UNSIGNED_BYTE, tgaImg[id].dat);
|
|
//printf("glTexImage2D GL_ERR_CODE[0x%x]\n", glGetError());
|
|
if(tgaImg[id].dat != NULL)
|
|
{
|
|
free(tgaImg[id].dat);
|
|
tgaImg[id].dat = NULL;
|
|
}
|
|
}
|
|
|
|
static void DestroyTgaResources(Int32 idRangeBegin, Int32 idRangeEnd)
|
|
{
|
|
Int32 i;
|
|
|
|
if(idRangeBegin < 0)
|
|
{
|
|
idRangeBegin = 0;
|
|
}
|
|
if(idRangeEnd >= PNG_NUM)
|
|
{
|
|
idRangeEnd = PNG_NUM-1;
|
|
}
|
|
|
|
for(i = idRangeBegin; i <= idRangeEnd; i++)
|
|
{
|
|
if(tgaImg[i].dat != NULL)
|
|
{
|
|
free(tgaImg[i].dat);
|
|
tgaImg[i].dat = NULL;
|
|
}
|
|
if(tgaImg[i].tex != INS_INVALID_RES_ID)
|
|
{
|
|
glDeleteTextures(1, &(tgaImg[i].tex));
|
|
tgaImg[i].tex = INS_INVALID_RES_ID;
|
|
}
|
|
tgaStatus[i] = Tga_Unload;
|
|
}
|
|
}
|
|
|
|
#endif // RES_TGA_H_INCLUDED
|
|
|