Rename and clean up

This commit is contained in:
Jackson Davis 2015-04-05 07:55:04 -07:00
parent 1a4ca6e19d
commit 4143574243
3 changed files with 10 additions and 8 deletions

View File

@ -28,6 +28,8 @@
#include "../world/sprite.h"
#include "news_item.h"
rct_news_item *newsItems = RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item);
void window_game_bottom_toolbar_invalidate_news_item();
static int news_item_get_new_history_slot();
@ -348,10 +350,10 @@ void news_item_open_subject(int type, int subject)
/**
* rct2: 0x0066E407
*/
void news_item_peep_removed(uint8 type, uint32 sprite_index) {
rct_news_item* newsItem = RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item);
void news_item_disable_news(uint8 type, uint32 assoc) {
rct_news_item* newsItem = newsItems;
while (newsItem->type != NEWS_ITEM_NULL) {
if (type == newsItem->type && sprite_index == newsItem->assoc) {
if (type == newsItem->type && assoc == newsItem->assoc) {
newsItem->flags |= 0x1;
if (newsItem == RCT2_ADDRESS(RCT2_ADDRESS_NEWS_ITEM_LIST, rct_news_item)) {
window_game_bottom_toolbar_invalidate_news_item();
@ -360,9 +362,9 @@ void news_item_peep_removed(uint8 type, uint32 sprite_index) {
newsItem++;
}
newsItem = RCT2_ADDRESS(0x013CB2D8, rct_news_item);
newsItem = &newsItems[11]; //0x13CB2D8
while (newsItem->type != NEWS_ITEM_NULL) {
if (type == newsItem->type && sprite_index == newsItem->assoc) {
if (type == newsItem->type && assoc == newsItem->assoc) {
newsItem->flags |= 0x1;
window_invalidate_by_class(WC_RECENT_NEWS);
}

View File

@ -58,6 +58,6 @@ void news_item_close_current();
void news_item_get_subject_location(int type, int subject, int *x, int *y, int *z);
void news_item_add_to_queue(uint8 type, rct_string_id string_id, uint32 assoc);
void news_item_open_subject(int type, int subject);
void news_item_peep_removed(uint8 type, uint32 sprite_index);
void news_item_disable_news(uint8 type, uint32 assoc);
#endif

View File

@ -567,7 +567,7 @@ void peep_sprite_remove(rct_peep* peep){
if (peep->type == PEEP_TYPE_GUEST){
window_invalidate_by_class(WC_GUEST_LIST);
news_item_peep_removed(NEWS_ITEM_PEEP_ON_RIDE, peep->sprite_index);
news_item_disable_news(NEWS_ITEM_PEEP_ON_RIDE, peep->sprite_index);
}
else{
window_invalidate_by_class(WC_STAFF_LIST);
@ -577,7 +577,7 @@ void peep_sprite_remove(rct_peep* peep){
sub_6C0C3F();
peep->type = PEEP_TYPE_STAFF;
news_item_peep_removed(NEWS_ITEM_PEEP, peep->sprite_index);
news_item_disable_news(NEWS_ITEM_PEEP, peep->sprite_index);
}
sprite_remove((rct_sprite*)peep);
}