| 169 | enum { |
| 170 | kCHeader, |
| 171 | kCText |
| 172 | }; |
| 173 | |
| 174 | enum { |
| 175 | kITEPC = (1 << 0), |
| 176 | kITEPCCD = (1 << 1), |
| 177 | kITEMac = (1 << 2), |
| 178 | kITEWyrmKeep = (1 << 3), |
| 179 | kITEAny = 0xffff, |
| 180 | kITENotWyrmKeep = kITEAny & ~kITEWyrmKeep |
| 181 | }; |
| 182 | |
| 183 | #define INV(n) (kITEAny & ~(n)) |
| 184 | |
| 185 | // Queue a page of credits text. The original interpreter did word-wrapping |
| 186 | // automatically. We currently don't. |
| 187 | |
| 188 | EVENT *Scene::ITEQueueCredits(SCENE_INFO *scene_info, int delta_time, int duration, int n_credits, const INTRO_CREDIT credits[]) { |
| 189 | int game; |
| 190 | |
| 191 | // The assumption here is that all WyrmKeep versions have the same |
| 192 | // credits, regardless of which operating system they're for. |
| 193 | |
| 194 | if (_vm->_features & GF_WYRMKEEP) { |
| 195 | game = kITEWyrmKeep; |
| 196 | } else if (_vm->_features & GF_MAC_RESOURCES) { |
| 197 | game = kITEMac; |
| 198 | } else if (_vm->_gameId == GID_ITE_CD_G) { |
| 199 | game = kITEPCCD; |
| 200 | } else { |
| 201 | game = kITEPC; |
| 202 | } |
| 203 | |
| 204 | int line_spacing = 0; |
| 205 | int paragraph_spacing; |
| 206 | int font = 0; |
| 207 | int i; |
| 208 | |
| 209 | int n_paragraphs = 0; |
| 210 | int credits_height = 0; |
| 211 | |
| 212 | for (i = 0; i < n_credits; i++) { |
| 213 | if (!(credits[i].game & game)) { |
| 214 | continue; |
| 215 | } |
| 216 | |
| 217 | switch (credits[i].type) { |
| 218 | case kCHeader: |
| 219 | font = SMALL_FONT_ID; |
| 220 | line_spacing = 4; |
| 221 | n_paragraphs++; |
| 222 | break; |
| 223 | case kCText: |
| 224 | font = MEDIUM_FONT_ID; |
| 225 | line_spacing = 2; |
| 226 | break; |
| 227 | default: |
| 228 | error("Unknown credit type"); |
| 229 | } |
| 230 | |
| 231 | credits_height += (_vm->_font->getHeight(font) + line_spacing); |
| 232 | } |
| 233 | |
| 234 | paragraph_spacing = (200 - credits_height) / (n_paragraphs + 3); |
| 235 | credits_height += (n_paragraphs * paragraph_spacing); |
| 236 | |
| 237 | int y = paragraph_spacing; |
| 238 | |
| 239 | TEXTLIST_ENTRY text_entry; |
| 240 | TEXTLIST_ENTRY *entry_p; |
| 241 | EVENT event; |
| 242 | EVENT *q_event = NULL; |
| 243 | |
| 244 | text_entry.color = 255; |
| 245 | text_entry.effect_color = 0; |
| 246 | text_entry.flags = FONT_OUTLINE | FONT_CENTERED; |
| 247 | text_entry.text_x = 160; |
| 248 | |
| 249 | for (i = 0; i < n_credits; i++) { |
| 250 | if (!(credits[i].game & game)) { |
| 251 | continue; |
| 252 | } |
| 253 | |
| 254 | switch (credits[i].type) { |
| 255 | case kCHeader: |
| 256 | font = SMALL_FONT_ID; |
| 257 | line_spacing = 4; |
| 258 | y += paragraph_spacing; |
| 259 | break; |
| 260 | case kCText: |
| 261 | font = MEDIUM_FONT_ID; |
| 262 | line_spacing = 2; |
| 263 | break; |
| 264 | default: |
| 265 | break; |
| 266 | } |
| 267 | |
| 268 | text_entry.string = credits[i].string; |
| 269 | text_entry.font_id = font; |
| 270 | text_entry.text_y = y; |
| 271 | |
| 272 | entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry); |
| 273 | |
| 274 | // Display text |
| 275 | event.type = ONESHOT_EVENT; |
| 276 | event.code = TEXT_EVENT; |
| 277 | event.op = EVENT_DISPLAY; |
| 278 | event.data = entry_p; |
| 279 | event.time = delta_time; |
| 280 | |
| 281 | q_event = _vm->_events->queue(&event); |
| 282 | |
| 283 | // Remove text |
| 284 | event.type = ONESHOT_EVENT; |
| 285 | event.code = TEXT_EVENT; |
| 286 | event.op = EVENT_REMOVE; |
| 287 | event.data = entry_p; |
| 288 | event.time = duration; |
| 289 | |
| 290 | q_event = _vm->_events->chain(q_event, &event); |
| 291 | |
| 292 | y += (_vm->_font->getHeight(font) + line_spacing); |
| 293 | } |
| 294 | |
| 295 | return q_event; |
| 296 | } |
| 297 | |
657 | | {160, 44, 9000, CREDIT_DURATION1, |
658 | | "Producer", SMALL_FONT_ID}, |
659 | | {160, 56, 0, CREDIT_DURATION1, |
660 | | "Walter Hochbrueckner", MEDIUM_FONT_ID}, |
661 | | {160, 88, 0, CREDIT_DURATION1, |
662 | | "Executive Producer", SMALL_FONT_ID}, |
663 | | {160, 100, 0, CREDIT_DURATION1, |
664 | | "Robert McNally", MEDIUM_FONT_ID}, |
665 | | {160, 132, 0, CREDIT_DURATION1, |
666 | | "Publisher", SMALL_FONT_ID}, |
667 | | {160, 144, 0, CREDIT_DURATION1, |
668 | | "Jon Van Caneghem", MEDIUM_FONT_ID} |
| 783 | {kITEAny, kCHeader, "Producer"}, |
| 784 | {kITEAny, kCText, "Walter Hochbrueckner"}, |
| 785 | {kITEAny, kCHeader, "Executive Producer"}, |
| 786 | {kITEAny, kCText, "Robert McNally"}, |
| 787 | {kITEWyrmKeep, kCHeader, "2nd Executive Producer"}, |
| 788 | {kITENotWyrmKeep, kCHeader, "Publisher"}, |
| 789 | {kITEAny, kCText, "Jon Van Caneghem"} |
736 | | text_entry.color = 255; |
737 | | text_entry.effect_color = 0; |
738 | | text_entry.flags = FONT_OUTLINE | FONT_CENTERED; |
739 | | |
740 | | for (i = 0; i < n_credits; i++) { |
741 | | text_entry.string = credits[i].string; |
742 | | text_entry.font_id = credits[i].font_id; |
743 | | text_entry.text_x = credits[i].text_x; |
744 | | text_entry.text_y = credits[i].text_y; |
745 | | |
746 | | entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry); |
747 | | |
748 | | // Display text |
749 | | event.type = ONESHOT_EVENT; |
750 | | event.code = TEXT_EVENT; |
751 | | event.op = EVENT_DISPLAY; |
752 | | event.data = entry_p; |
753 | | event.time = event_delay += credits[i].delta_time; |
754 | | |
755 | | q_event = _vm->_events->queue(&event); |
756 | | |
757 | | // Remove text |
758 | | event.type = ONESHOT_EVENT; |
759 | | event.code = TEXT_EVENT; |
760 | | event.op = EVENT_REMOVE; |
761 | | event.data = entry_p; |
762 | | event.time = credits[i].duration; |
763 | | |
764 | | q_event = _vm->_events->chain(q_event, &event); |
765 | | } |
| 856 | q_event = ITEQueueCredits(scene_info, 12000, CREDIT_DURATION1, n_credits, credits); |
798 | | const INTRO_CREDIT credits[] = { |
799 | | {160, 58, 2000, CREDIT_DURATION1, |
800 | | "Game Design", SMALL_FONT_ID}, |
801 | | {160, 70, 0, CREDIT_DURATION1, |
802 | | "Talin, Joe Pearce, Robert McNally", MEDIUM_FONT_ID}, |
803 | | {160, 80, 0, CREDIT_DURATION1, |
804 | | "and Carolly Hauksdottir", MEDIUM_FONT_ID}, |
805 | | {160, 119, 0, CREDIT_DURATION1, |
806 | | "Screenplay and Dialog", SMALL_FONT_ID}, |
807 | | {160, 131, 0, CREDIT_DURATION1, |
808 | | "Robert Leh, Len Wein, and Bill Rotsler", |
809 | | MEDIUM_FONT_ID}, |
810 | | {160, 54, 5000, CREDIT_DURATION1, |
811 | | "Art", SMALL_FONT_ID}, |
812 | | {160, 66, 0, CREDIT_DURATION1, |
813 | | "Edward Lacabanne, Glenn Price, April Lee,", |
814 | | MEDIUM_FONT_ID}, |
815 | | {160, 76, 0, CREDIT_DURATION1, |
816 | | "Lisa Iennaco, Brian Dowrick, Reed", MEDIUM_FONT_ID}, |
817 | | {160, 86, 0, CREDIT_DURATION1, |
818 | | "Waller, Allison Hershey and Talin", MEDIUM_FONT_ID}, |
819 | | {160, 123, 0, CREDIT_DURATION1, |
820 | | "Art Direction", SMALL_FONT_ID}, |
821 | | {160, 135, 0, CREDIT_DURATION1, |
822 | | "Allison Hershey", MEDIUM_FONT_ID} |
| 893 | int n_credits1 = ARRAYSIZE(credits1); |
| 894 | |
| 895 | const INTRO_CREDIT credits2[] = { |
| 896 | {kITEWyrmKeep, kCHeader, "Art Direction"}, |
| 897 | {kITEWyrmKeep, kCText, "Allison Hershey"}, |
| 898 | {kITEAny, kCHeader, "Art"}, |
| 899 | {kITEAny, kCText, "Edward Lacabanne, Glenn Price, April Lee,"}, |
| 900 | {kITEWyrmKeep, kCText, "Lisa Sample, Brian Dowrick, Reed Waller,"}, |
| 901 | {kITEWyrmKeep, kCText, "Allison Hershey and Talin"}, |
| 902 | {kITENotWyrmKeep, kCText, "Lisa Iennaco, Brian Dowrick, Reed"}, |
| 903 | {kITENotWyrmKeep, kCText, "Waller, Allison Hershey and Talin"}, |
| 904 | {kITENotWyrmKeep, kCHeader, "Art Direction"}, |
| 905 | {kITENotWyrmKeep, kCText, "Allison Hershey"} |
853 | | text_entry.color = 255; |
854 | | text_entry.effect_color = 0; |
855 | | text_entry.flags = FONT_OUTLINE | FONT_CENTERED; |
856 | | |
857 | | for (i = 0; i < n_credits; i++) { |
858 | | text_entry.string = credits[i].string; |
859 | | text_entry.font_id = credits[i].font_id; |
860 | | text_entry.text_x = credits[i].text_x; |
861 | | text_entry.text_y = credits[i].text_y; |
862 | | |
863 | | entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry); |
864 | | |
865 | | // Display text |
866 | | event.type = ONESHOT_EVENT; |
867 | | event.code = TEXT_EVENT; |
868 | | event.op = EVENT_DISPLAY; |
869 | | event.data = entry_p; |
870 | | event.time = event_delay += credits[i].delta_time; |
871 | | |
872 | | q_event = _vm->_events->queue(&event); |
873 | | |
874 | | // Remove text |
875 | | event.type = ONESHOT_EVENT; |
876 | | event.code = TEXT_EVENT; |
877 | | event.op = EVENT_REMOVE; |
878 | | event.data = entry_p; |
879 | | event.time = credits[i].duration; |
880 | | |
881 | | q_event = _vm->_events->chain(q_event, &event); |
882 | | } |
| 933 | q_event = ITEQueueCredits(scene_info, DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1); |
| 934 | q_event = ITEQueueCredits(scene_info, DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); |
915 | | INTRO_CREDIT credits[] = { |
916 | | {160, 58, 2000, CREDIT_DURATION1, |
917 | | "Original Game Engine Programming", SMALL_FONT_ID}, |
918 | | |
919 | | {160, 70, 0, CREDIT_DURATION1, |
920 | | "Talin, Walter Hochbrueckner,", MEDIUM_FONT_ID}, |
921 | | |
922 | | {160, 80, 0, CREDIT_DURATION1, |
923 | | "Joe Burks and Robert Wiggins", MEDIUM_FONT_ID}, |
924 | | |
925 | | {160, 119, 0, CREDIT_DURATION1, |
926 | | "Music and Sound", SMALL_FONT_ID}, |
927 | | |
928 | | {160, 131, 0, CREDIT_DURATION1, |
929 | | "Matt Nathan", MEDIUM_FONT_ID}, |
930 | | |
931 | | {160, 58, 5000, CREDIT_DURATION1, |
932 | | "Directed by", SMALL_FONT_ID}, |
933 | | |
934 | | {160, 70, 0, CREDIT_DURATION1, |
935 | | "Talin", MEDIUM_FONT_ID}, |
| 963 | const INTRO_CREDIT credits1[] = { |
| 964 | {kITEAny, kCHeader, "Programming"}, |
| 965 | {kITEAny, kCText, "Talin, Walter Hochbrueckner,"}, |
| 966 | {kITEAny, kCText, "Joe Burks and Robert Wiggins"}, |
| 967 | {kITEPCCD | kITEWyrmKeep, kCHeader, "Additional Programming"}, |
| 968 | {kITEPCCD | kITEWyrmKeep, kCText, "John Bolton"}, |
| 969 | {kITEMac, kCHeader, "Macintosh Version"}, |
| 970 | {kITEMac, kCText, "Michael McNally and Robert McNally"}, |
| 971 | {kITEAny, kCHeader, "Music and Sound"}, |
| 972 | {kITEAny, kCText, "Matt Nathan"} |
| 973 | }; |
972 | | text_entry.color = 255; |
973 | | text_entry.effect_color = 0; |
974 | | text_entry.flags = FONT_OUTLINE | FONT_CENTERED; |
975 | | |
976 | | for (i = 0; i < n_credits; i++) { |
977 | | text_entry.string = credits[i].string; |
978 | | text_entry.font_id = credits[i].font_id; |
979 | | text_entry.text_x = credits[i].text_x; |
980 | | text_entry.text_y = credits[i].text_y; |
981 | | |
982 | | entry_p = _vm->textAddEntry(scene_info->text_list, &text_entry); |
983 | | |
984 | | // Display text |
985 | | event.type = ONESHOT_EVENT; |
986 | | event.code = TEXT_EVENT; |
987 | | event.op = EVENT_DISPLAY; |
988 | | event.data = entry_p; |
989 | | event.time = event_delay += credits[i].delta_time; |
990 | | |
991 | | q_event = _vm->_events->queue(&event); |
992 | | |
993 | | // Remove text |
994 | | event.type = ONESHOT_EVENT; |
995 | | event.code = TEXT_EVENT; |
996 | | event.op = EVENT_REMOVE; |
997 | | event.data = entry_p; |
998 | | event.time = credits[i].duration; |
999 | | |
1000 | | q_event = _vm->_events->chain(q_event, &event); |
1001 | | } |
| 1007 | q_event = ITEQueueCredits(scene_info, DISSOLVE_DURATION + 2000, CREDIT_DURATION1, n_credits1, credits1); |
| 1008 | q_event = ITEQueueCredits(scene_info, DISSOLVE_DURATION + 7000, CREDIT_DURATION1, n_credits2, credits2); |